|
Atreides_096 Wanderer
Joined: 21 Jan 2005 Posts: 99 Location: Solvang, CA
|
Posted: Wed Apr 27, 2005 5:12 pm
ZMud not saving 0-value variables? |
After using ZMud 7.05 (and later 7.05a) for about a year, all of a sudden ZMud has decided to no longer save 0-valued variables.
Any variables that I have with a 0-value when I quit ZMud (or actually, even when I reconnect to the MUD I'm on without leaving the window) get reset to have NO value (just blank). This causes some severe problems, as in many scripts I use a toggle system (if variable = 0 do this, else do this) and I have many 0-based variables.
Any ideas?? This is really weird, just started out of the blue for no reason...
Thanks! |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Apr 27, 2005 5:53 pm |
Did you somehow turn on the "Use Default" option for the variable and have the default value set to an empty value? That's the only way I can think to have the variables reset to blank when you start. Normally it restores whatever values were in the variables when you last saved your settings.
|
|
|
|
Atreides_096 Wanderer
Joined: 21 Jan 2005 Posts: 99 Location: Solvang, CA
|
Posted: Wed Apr 27, 2005 6:19 pm |
How do I check for this? I looked through the options (in view->preferences)... skimmed down all the directories, and didn't see the applicable option, though it's quite possible I missed it...
Also I was assuming it was using the default value (as the majority of them don't have one set, since they constantly change through my scripts). Just didn''t want to say so and then be miles wrong (quite possible heh)... I would definately assume that that's what I screwed up though :P |
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Wed Apr 27, 2005 7:43 pm |
The option is in the variable settings itself. Pull up the variable in the editor and youll see a checkbox for (use default) or something like that. If it is not checked put a zero in the field right above it and place a check there. Next time its reset it will reset to zero.
|
|
|
|
Atreides_096 Wanderer
Joined: 21 Jan 2005 Posts: 99 Location: Solvang, CA
|
Posted: Wed Apr 27, 2005 7:54 pm |
Ok, I see the problem now. I was having issues with variables being written into the wrong classes before, using the format of:
Code: |
#CLASS {Whatever}
#var this {that}
#CLASS 0 |
And was advised to switch to the format of:
Code: |
#var this {that} {} {Whatever} |
Apparently, this format is rewriting the variables with the option of using default automatically. If there any way to avoid this? Or do I need to go back and rewrite all 650+ again? That present a problem as well though, since the vast majority of my scripts are intended to be continuously run counters, using incrementing variables (such as scripts to track the damage I do to mobs). If the variables had to reset, even to a pre-set default every time, these scripts would become defunct... |
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Wed Apr 27, 2005 9:53 pm |
If you want to save the variables over a reset/ reboot you can try the obvious =)
Code: |
#var this {that} {that} {Whatever} |
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Apr 27, 2005 10:33 pm |
If you don't care about the default value and want to retain whatever was last in it when you closed Zmud, use _nodef instead of {}:
#variable Name {Value} _nodef {Class}
EDIT: this is strictly for variables you programmatically (ie, command-line or via code in a trigger/alias/etc) create. When simply assigning a new value to the already-existing variable you can simply use var=name if this option is enabled (it should be by default). |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|