variables
I've always wondered, if you make a variable like &story, how much can the value of it max be?
is it 9 or... much higher?
is it 9 or... much higher?
Variables can be set to any integer between -2,147,483,647 and 2,147,483,648. So unless you're doing something really bizarre, you won't have to worry about a variable having a value that is too high (or too low).
woah, did you pull that number out of your ass, or is that real?
I pulled it out of the DinkC Reference v3.1.
Anyway, its quite easy to verify. The save game format sets aside 4 bytes for the value of each variable. Each byte can hold up to 16 values. So 4^16 is 4,294,967,296, the total number of unique values each variable can hold. However, when you think of negative numbers and 0 (by dividing 4,294,967,296 by two for positive/negative, and subtracting one of the halves by 1 for the zero) then you get the numbers that I posted earlier.
Anyway, its quite easy to verify. The save game format sets aside 4 bytes for the value of each variable. Each byte can hold up to 16 values. So 4^16 is 4,294,967,296, the total number of unique values each variable can hold. However, when you think of negative numbers and 0 (by dividing 4,294,967,296 by two for positive/negative, and subtracting one of the halves by 1 for the zero) then you get the numbers that I posted earlier.
How come my brain just withered up and...CLUNK
That is really cool.
I always assumed that it was 9 didgets(and had it verified in my mind by the supervar you did) I guess I could probably use that somehow to make a.. super duper var?
Probably not, and probably won't be necesary with the engine being tweaked to use supervars at all
I always assumed that it was 9 didgets(and had it verified in my mind by the supervar you did) I guess I could probably use that somehow to make a.. super duper var?
Probably not, and probably won't be necesary with the engine being tweaked to use supervars at all
And now for a really newbie-ish question: "What is a supervar". I read things about it in different posts, but I still don't know what they are. I'm probably already using it without knowing that they're called that way, but still... WHAT are supervariables.
Check out the SuperVar Source, and Dink's Trunk which has a much better implementation. Basically, it is treating a single variable like this:
&inventory = 1246784;
As multiple variables like this:
&bombs = 2;
&heals = 4;
&manas = 6;
&swords = 7;
&axes = 8;
&boomerangs = 4;
Thanks to Division and Multiplication.
&inventory = 1246784;
As multiple variables like this:
&bombs = 2;
&heals = 4;
&manas = 6;
&swords = 7;
&axes = 8;
&boomerangs = 4;
Thanks to Division and Multiplication.