Re: Create sprite, wait(50);, remove sprite?
Here is my code:
I want to create the sprite, put it above everything, wait(50); and then remove it from the screen.
It creates, but it does not remove. It simply stays there. Anyone know why?
int &red = create_sprite(423, 295, 0, 38, 7); sp_que(&red, 10000); wait(50); sp_active(&red, 0);
I want to create the sprite, put it above everything, wait(50); and then remove it from the screen.
It creates, but it does not remove. It simply stays there. Anyone know why?
It's probably the wait() killing the script. When is the code run?
Inside a procedure called with external(); from another script.
Well, if the parent sprite dies after calling this (or possibly does some other bizarre thing...) the externaled script will die with it. (the engine will "jump" back to the parent script when it encounters the wait() command. If you haven't read it, Someone explains the stuff pretty well in his FIFO variable thing =)
If possible (ie, there's no other stuff that will stop working), you could use spawn() instead of external(), or sp_kill(&red,50) instead of wait() and sp_active().
If possible (ie, there's no other stuff that will stop working), you could use spawn() instead of external(), or sp_kill(&red,50) instead of wait() and sp_active().
sp_kill(&red, 50); works perfectly.
But it sounds like it may be worth it to read the FIFI variable thing.

But it sounds like it may be worth it to read the FIFI variable thing.