I have in my game a lift mechanism which spans three rooms (actually the third, top room isn't finished). The lift travels through a middle room, which is just a blank room. I can make the lift part work and the player move with it, but I'm having trouble setting a lift direction in the middle room.
I've decided that when the lift is activated from the bottom, it sets a variable lift_entry to 0, meaning that it came from the bottom. If it is activated at the top it'll be lift_entry = 1. The middle screen will have two lift objects, one at the top and one at the bottom. When the player enters the middle screen, a script will run. If lift_entry = 0, it'll delete the top lift object and set the bottom one and the player moving upwards. If lift_entry = 1 it's just the opposite.
A recent topic in the forum covered SetGlobalInt and GetGlobalInt which I weren't aware of. I've put these into my script but I don't understand exactly how these global integers work. Here's what I have so far:
Bottom screen - Player walks off top screen edge
(Go to middle room)
Run script:
SetGlobalInt(10,0)
Middle screen - Player enters screen (after fadein):
Run script:
GetGlobalInt(10);
if (GlobalInt(10) == 0) {
DisplaySpeech(DARREN,"J");
}
else {
DisplaySpeech(DARREN,"K");
}
I've just made the character say 'J' or 'K' for now. 'J' for bottom and 'K' for top.
The GlobalInt bit inside the 'if' part is made up, and it won't compile in the script. What should I put in there, because this integer doesn't have a name (it's just global integer 10). Do I have to assign a name or something?
Thanks in advance.