|
Post by The Final Rune on Dec 2, 2004 15:28:41 GMT -5
I was reading a post at the pavilion about variable arrays and their creation and I was wondering if you throw out a psuedo how to for something simple so I can study it and see if I can use to my advantage in my games.
Thanks guys!
|
|
|
Post by Doan the Nado on Dec 2, 2004 16:24:21 GMT -5
Yes, I'd be interested in this, too. I'm assuming it uses one of the pre-made databases.
|
|
|
Post by Dungeon Warden on Dec 2, 2004 17:18:20 GMT -5
As I said in my post at the pavillion, the databases are essentially arrays already. For example, Var86: member number determines which data to load into the member variable set. Switching members allows you to switch sets. You could also set up an array using variables and flags. You just need to keep track of each data set with a variable and some sort commands. This could use up a lot of variables unless the array is small.
If you're really interested in this I'll look into how to set it up once I get back home. Ves may have some ideas on how to do this as well.
|
|
|
Post by vespuleth on Dec 2, 2004 19:24:40 GMT -5
i set one up for x, back when he was still around. ill dig up my notes and post it.
|
|
|
Post by vespuleth on Dec 12, 2004 15:40:40 GMT -5
dw is right, first of all. all of the preset databases are arrays. so you can use there idea, and build your own.
basically, what you will need is a master variable, and then a variable for each attribute in the array. . also, as a note, it is far more efficient to use the 'string' for this, as they can hold alot more then just the nubmers.
so what you need to do is write a sort script that identifies each possibility for the master variable, and changes the attributes.
if you want to change a number in the array, is when it gets tricky. say you have an array that shows all the players hp, and one gets hit. the master variable is the player id, and the attribute is his hp. now anytime i call the sort of the master variable, the hp will revert. how do you get around this? you will need to write a condition of the variable being modified. which means you need to identify its modification somehow. what i did, was everytime it was modified positively, add 10000000 to it, and everytime it was modified negatively, subtract 10000000 + 2Xoriginal var. (this makes it the same number in the negative). now, you can divide by 1000000 and find out the mod value, and if it is what modded at all. if it has been modded, just check to make sure the modded value correlates to the original value +/- the mod value. hope that isnt greek, and that it helps. have fun!
|
|