OK, I'm pretty new to this so bear with me...
I managed (using a Run Script) to get my suit of armour to animate when I interact with it (go me! ;D)
What I want is to run a different loop the second time I click on the armour. I think I probably have to use a variable for this, so this is how I tried to do it...
In my global script, at the game start, I have
int (Armour_Click);
Armour_Click=0;
Then in my interaction script I have
function object0_a() {
// script for object0: Interact object
SetObjectView(0, 6);
if (Armour_Click==0) {
AnimateObject(0,0,2,0);
}
Armour_Click+=1
}
I tested this before trying to add a second loop, and before the game started up I got the error "undefined symbol (Armour_Click)."
Sorry, no parentheses when I create the variable.
int Armour_Click;
I guess by your silence you may not know, so here's the workaround I found:
I turned my armour "object" into a character, and then made the animations conditional based on its inventory (the armour's inventory, not the player's.) Then I add an invetory item after each animation Seems to be working.
Quoten my global script, at the game start, I have
int Armour_Click;
Armour_Click=0;
The problem is that if you put this in the game_start function, the variable gets destroyed once the function finished running.
You have to put the declaration outside all functions at the top of the global script in order for all
global functions to be able to access it:
int Armour_Click=0;
But this way, the variable still isn't available in room scripts. You could export it and then import it in the script header or the room script, but if you don't need the variable in any global function, it's easier to just put the declaration at the top of the room script.
It retains its value even when you change rooms.