Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Best on Thu 04/09/2003 11:48:08

Title: set-globalint function in dialogs
Post by: Best on Thu 04/09/2003 11:48:08
I dont think someone will help me, but lets try:

I have a problem with set-globalint function in dialogs. I set the GI 5 to VAL 1. (set-globalint 5, 1)
Than I clicked on character interactions and did this:

Talk to character: Conditional-if variable is set to certain value (5, 1)
child action was: Enable dialog option.

Nothing happened.

Than I tried to use scripting so I did this:

Talk to character: Run script
 if (GetGlobalInt(5)==1) {
    GetDialogOption (2, 3);
}

And this two thangs were not the only ones I tried. Dont laugh bout my english cuz Im a Slovak and please help me. I dunno what to do.

Thanks
Title: Re:BIG PROBLEM
Post by: Ishmael on Thu 04/09/2003 11:53:44
set-globalint 5 1 // in dialog scritp

// Talk to Charcter
if (GetGlobalInt(5)==1) {
SetDialogOption(3,2,1); // would enable option 2 in dialog 3
}
RunDialog(3); // you maybe want to run the dialog, too

Anyhelp?
Title: Re:BIG PROBLEM
Post by: Best on Thu 04/09/2003 13:37:28
You know, this is crazy!

I need to switch an object back on, but if I wanna do it, just nothing happened. In dialog i tried to set-globalint 5, 1 and set-globalint 5 1. Than I left the room and came back (In room interactions: Player enters room (after faiden) there was this: Conditional: if variable is set to ceratain value (5, 1)
child action: Switch an object back on (2).

And just nothing happend.
Title: Re:BIG PROBLEM
Post by: Scorpiorus on Thu 04/09/2003 16:53:30
Quote from: Best Willis on Thu 04/09/2003 13:37:28
You know, this is crazy!

I need to switch an object back on, but if I wanna do it, just nothing happened. In dialog i tried to set-globalint 5, 1 and set-globalint 5 1. Than I left the room and came back (In room interactions: Player enters room (after faiden) there was this: Conditional: if variable is set to ceratain value (5, 1)
child action: Switch an object back on (2).

And just nothing happend.
That's because interaction editor's global variables are different from usual GlobalInts. You have to use run script option instead of the conditional-if:

on player enters room (after faiden):

if (GetGlobalInt(5)==1) ObjectOn(2);

-Cheers
Title: Re:set-globalint function in dialogs
Post by: Best on Thu 04/09/2003 17:36:53
Thank you guys. Really much.
Title: Re:set-globalint function in dialogs
Post by: Totoro on Fri 05/09/2003 06:55:45
Hi again,
could you tell me if there is a problem about this script within the dialog-editor?

@8  // option 8
DAVID: Right now I have no big orders...
DAVID: But I feel bored.
DAVID: Get me something exciting.
EGO: Aye aye, Sir!
set-globalint Knowledge 3
option-off-forever 8

Am I maybe not allowed to use "Knowledge", do I have to use a numbered global value for that?

EDIT: Got it now... its because of the fact you mentioned, that global-values in script and global-values in interaction editor are not the same, right?
Title: Re:set-globalint function in dialogs
Post by: Scorpiorus on Fri 05/09/2003 12:46:01
Yep, the set-globalint <GI> <value> dialog script command operates with the GlobalInts that are accesible via GetGlobalInt() / SetGlobalInt() functions.

~Cheers