Animate something, wait, then animate it again.

Started by Xyphox, Tue 28/07/2009 19:58:17

Previous topic - Next topic

Xyphox

I just can't figure out how to do this.

I tried object.animate, then using the wait, then object.animate again under repeatedly execute.  However, this blocks everything and I can't control the character.

Matti

#1
1. Don't use such a thing in the rep-ex. That is unnecessary and can cause problems. You only need to call it once

2. You can decide for yourself if the animation should be blocking or not.

object[].Animate(x, x, eOnce, eNoBlock);


[EDIT:]

Ah, yeah. Of course you cannot put that in the rep-ex. The wait command is blocking anyway, so if you put it there, it's blocking all the time. Also, when you put the animate command there, it's trying to start the animation 40(!) times a second - every gameloop.

Do you want that animation to happen continuously or just once?

Xyphox

I want it to happen once every 10 seconds or so, but not be blocking.

Matti

Well, I consider "once every 10 seconds" as continuously. The reason is that you can just use a delay for a certain frame of the animation. Make one frame of the object's animation the one that should be the "standing frame", the one that should fill the 10 seconds and set a delay of 400* for that frame. Also, use eRepeat instead of eOnce.

* I think a delay of 1 means a delay of one gameloop, so a delay of 400 would be 10 seconds. If it's not, just change the number.

Xyphox

I didn't think of that, thank you very much.

Matti

You're welcome.

Just make sure you call the animate command in the room's after_fadein event, not in the rep-ex.

SMF spam blocked by CleanTalk