Set Global Integer in Dialog Script

Started by subspark, Mon 01/09/2003 10:41:57

Previous topic - Next topic

subspark

I want to set a flag while the player chooses a dialog option.
I need to do this through the dialog script.

Heres my code:

Character: Wizard: Interactions: Talk to: Run Script:


 // script for character1: Talk to character
MoveCharacter (EGO, 170, 130);
while (character[EGO].walking) Wait (1); //Waits until the character has arrived to the location
FaceCharacter(EGO,WIZ);

//When I want to put anything before the dialog choices, I usually put them right here.

if (GetGlobalInt(8)==1) {
 // code here

DisplaySpeech (0,"Excuse me...");
DisplaySpeech (2,"Anything more?");
RunDialog (5); //Starts the programmed dialog number 0. (topic 0 in the 'dialogs' tab)
}
else {
DisplaySpeech (0,"Excuse me...");
DisplaySpeech (2,"Yes?");
RunDialog (1); //Starts the programmed dialog number 0. (topic 0 in the 'dialogs' tab)
}


My dialog script won't except SetGlobalInt
How can i achieve setting some kind of flag in the dialog script that i can call/get in a character's interaction's talk to script?

Ishmael

"We are now live from the AGS manual, from the converstaions in Tutorials -> Setting up the game"

set-globalint GI VAL

Changes text script GlobalInt number GI to have the value VAL. This is equivalent to the SetGlobalInt text script command, and allows you to quickly set things without having to go through a run-script just to set an int value.

Whattayathink? And I think you kindof doubleposted..?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

subspark

I really do appreciate your help TK. I think your fantastic and I have now fully solved my problem. Thanks to you.

Cheers,
Sparky.

Ishmael

No problem, glad to help. ;) And besides... I had nothing better to do then post into the forum... :P
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

subspark

#4
just maybe one more quessy tho.

You did mention Setting Global Integer "GI" to value "VAL"
where infact the code in my interactions script only accepts numbers for example:

if (GetGlobalInt(8)==1) {
DisplaySpeech (0,"Excuse me...");
DisplaySpeech (2,"Anything more?");
RunDialog (5); //Starts the programmed dialog number 5. (topic 0 in the 'dialogs' tab)
}
else {
DisplaySpeech (0,"Excuse me...");
DisplaySpeech (2,"Yes?");
RunDialog (1); //Starts the programmed dialog number 1. (topic 0 in the 'dialogs' tab)
}


I wrote the number eight in there but can you actually have word values here too?

just to be more organized?!

Ishmael

to set GlobalInt 8 to 1, put

set-globalint 8 1

in the dialog script
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk