Variables - Problems with saving them

Started by ROTh, Thu 28/10/2004 15:55:26

Previous topic - Next topic

ROTh

I connected some things if you have done something to the "If a variable is set to a certain value" option, but it seems that the value (Global int) which is set in the game isn't saved. Why? and how can I manage that??

Radiant

Global ints are saved in save game files.
My guess is that something else is wrong with your code; maybe you could post a sample?

strazer

Note that GlobalInts are different from the variables you set via the Interaction Editor. GlobalInts != Graphical variables.

For example, if you set a globalint in dialog script via set-globalint, you can only check its status with script using the GetGlobalInt function.
If you want to set a graphical variable via script, use the SetGraphicalVariable function.

ROTh

I set the variable value with the interaction editor and I use the conditional "If a variable is set to a certain value" (with the interaction editor, too). I don't use a script here. .... but the value isn't saved.

strazer

I'm using v2.62. I've tested it with "Interact" on characters, inventory items and objects. Worked fine.
In which interaction do you set the variable?
Maybe you have defined a global variable and a room variable with the same name, confusing the two?

ROTh

I'm using v2.52, but I think that couldn't be the problem, because it seems that I'm the first one with that problem.
I set the variables and ask for the variables at interactions with charakters or objects. (e.g. use inventory). So I couldn't post the script, I think.

Edwin Xie

Correction: 2.62 but anyway, you could always use a script like:


Put this script in, use dustbin with old man interaction (Don't delete the animation of the old man with the dustbin though):
SetGlobalInt(GLOBALINT,1);


Put this script in, use tire with old man interaction (Don't delete the animation of the old man with both though):
if (GetGlobalInt(GLOBALINT)== 1){ // if the dustbin is already on the old man
SetGlobalInt(GLOBALINT,2);
}


Put this in the interaction for the region of the old man:
if (GetGlobalInt(GLOBALINT)==1){ // The tire is on the old man
blahblah;
}
else if (GetGlobalInt(GLOBALINT)==2){ //The tire and the wastebasket is on the old man
blahblah;
}
Moving at superhigh speed getting to the planet called Earth. But it is boxed in white......thing.....

Pumaman

Can you clarify what you mean by "not getting saved" -- do you mean it works fine except if you save the game and then load it again, or do you mean it's not being saved in between interactions? If it's the latter, it's likely the logic is wrong in your interactions -- could you post what commands you're using in what order?

SMF spam blocked by CleanTalk