I have a room, with 4 spirits.
I dont want him to animate from the begining, so I added
// script for Room: Player enters room (before fadein)
SetBackgroundFrame(0);
what I want to do is that when the player is interact with hotspot, then the background will start the animation, and will stop after 1 loop.
I thought to do something like this:
// script for Hotspot 1 (Hotspot 1): Interact hotspot
while (GetBackgroundFrame() < 3) {
GetBackgroundFrame ()++ = SetBackgroundFrame;
}
But i get an error... (Expected ';' ).
what's the problem?
thanks alot... ;)
You probably meant
SetBackgroundFrame(GetBackgroundFrame()+1);
instead of what you've got now.
Use this
while (GetBackgroundFrame()<3) {
SetBackgroundFrame(GetBackgroundFrame()+1);
Wait(10); // change the param to set the speed
}
With variables, put the variable to be set to the left of the "="; put the expression it gets set to to the right:
variable_to_be_changed = expression;
So say there was a variable called Room.BackgroundFrame which one could use to change the frame, one would write:
Room.BackgroundFrame=Room.BackgroundFrame+1;
Or the short version:
Room.BackgroundFrame++;
Edit: Did you put the wait command in there?
Thanks, but instead to do the animation, he jump to the last frame. :o
Why?