The Dink Network

Variable Limit, Clean Up and Save Game Editor

May 31st 2007, 01:08 PM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
I was checking out some stuff that I never really thought about in the past, things such as the variable limit. Back then I wasn't much of a programmer, just a kid trying to learn how to do some Dink stuff. But now that I've finished my computer science education I have the urge to do everything RIGHT from the beginning

So, onto my question...

I've been eliminating all left over variables in Legend's Tale that weren't disposed of correctly, but I've run into a dubious situation... When I use var_used() I get the current amount of variables in use, correct? So, I've been running around checking if it increases beyond the normal amount all over the map, during and after events, etc... So far, I only encountered a few of them and fixed them. But, then I checked again using the Save Game Editor of Justice and, well, there were a lot of other variables in there, often present in large amounts of the same variable... So, now onto the REAL QUESTION: Which one counts toward the variable limit, var_used() or those that can be seen in the save game editor?

Hopefully someone here has the experience or knowledge to help me out

May 31st 2007, 03:30 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
I think save.dat file includes variables that are 'dead'. So, the next time you need a variable, it just replaces the first 'dead' one.
May 31st 2007, 03:43 PM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
That's great news, thanks.
May 31st 2007, 04:51 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Does that mean that the amount of variables shown in the savegame editor is equal to the maximum amount ever used at the same time? It would be a convenient way to see if you're well below the maximum at all times...
May 31st 2007, 09:48 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Hmm, yes, I believe so.
June 2nd 2007, 09:12 AM
pillbug.gif
Drink
Peasant He/Him Chile
Don't drink 
I believe that the savegame file records a fixed block of memory used for DinkC variables. When one variable is temporaryly created, and then disposed, then the values of the name of the variable, its value, and other things remains unchanged (like being in use), but one value, the one that says if that space is currently in use or is available, is the only one that changes. That could explain the repeated or not in use names of variables that Kyle sees.