Okay, I'm just going to add my personal take on GlobalInts here, in case it helps.
A GlobalInt is what you use when, say, you want a different response for the same action after something has happened.
For example, if you look at a house, the character might say, "What a pretty house". If you break a window, and THEN look at the house, the character might say something different like, "There's a broken window".
In this example, you would use GlobalInts to tell the game what action would make the response change - in this case, the window breaking. You pick a number (any number) for the global int... this is just like a title to tell you which GlobalInt you're using for what. In this case, we'll say the number 1. Then you would make the second number (the number the global int "contains" 0 before the window is broken, and 1 if the window is broken.
So, Global Int number 1 will equal 0 before the broken window, and it will equal 1 when the window is broken.
To use this, you would tell the game when you look at the house, that if Global Int number 1 equals 0, to have the character say, "What a pretty house". If it equals 2, have the character say, "There's a broken window". Wherever in the game script you have the window break, you would include somewhere in that script a line telling the game to change Global Int number 1 to equal 1 (by default, it will be 0).
So, in the script [in the room editor => hotspot (house) interaction => Look At...] for the hotspot, you would put something like:
Code: ags
In the script where the window gets broken, you would put:
Code: ags
...which would change the value of the Global Int #1 from 0 to 1.
This was as simply as I could put it, sorry if it's overboard, or if it doesn't answer your question.
///////////////////
A quick way to try this out yourself would be to open up a room, make a new hotspot, and then in the Interaction Editor for that hotspot, click on "Look At Hotspot", choose "Run script" and in that script put this:
Code: ags
Test your game in this room and try looking at the hotspot twice. This will change the value of the Global Int as soon as you've looked at the hotspot once. If you look at it a second time, the new interaction will be run. I'm assuming your main character is "EGO" (change it, if it isn't) and that you haven't used a GlobalInt anywhere else.
A GlobalInt is what you use when, say, you want a different response for the same action after something has happened.
For example, if you look at a house, the character might say, "What a pretty house". If you break a window, and THEN look at the house, the character might say something different like, "There's a broken window".
In this example, you would use GlobalInts to tell the game what action would make the response change - in this case, the window breaking. You pick a number (any number) for the global int... this is just like a title to tell you which GlobalInt you're using for what. In this case, we'll say the number 1. Then you would make the second number (the number the global int "contains" 0 before the window is broken, and 1 if the window is broken.
So, Global Int number 1 will equal 0 before the broken window, and it will equal 1 when the window is broken.
To use this, you would tell the game when you look at the house, that if Global Int number 1 equals 0, to have the character say, "What a pretty house". If it equals 2, have the character say, "There's a broken window". Wherever in the game script you have the window break, you would include somewhere in that script a line telling the game to change Global Int number 1 to equal 1 (by default, it will be 0).
So, in the script [in the room editor => hotspot (house) interaction => Look At...] for the hotspot, you would put something like:
if (GetGlobalInt(1)==0) {
DisplaySpeech (EGO, "What a pretty house");
}
else if (GetGlobalInt(1)==1) {
DisplaySpeech (EGO, "There's a broken window");
}
In the script where the window gets broken, you would put:
SetGlobalInt(1,1);
...which would change the value of the Global Int #1 from 0 to 1.
This was as simply as I could put it, sorry if it's overboard, or if it doesn't answer your question.
///////////////////
A quick way to try this out yourself would be to open up a room, make a new hotspot, and then in the Interaction Editor for that hotspot, click on "Look At Hotspot", choose "Run script" and in that script put this:
if (GetGlobalInt(1)==0) {
DisplaySpeech (EGO, "Global Int number 1 equals 0");
SetGlobalInt (1,1);
}
else if (GetGlobalInt(1)==1) {
DisplaySpeech (EGO, "Global Int number 1 now equals 1");
}
Test your game in this room and try looking at the hotspot twice. This will change the value of the Global Int as soon as you've looked at the hotspot once. If you look at it a second time, the new interaction will be run. I'm assuming your main character is "EGO" (change it, if it isn't) and that you haven't used a GlobalInt anywhere else.