What exactly happens when a sprite dies?
January 7th 2006, 08:33 PM
abjabj
Hi,
I didn't find anything useful in the documentation, so here's the problem.
I placed some code in the die()procedure of an sprite and only the first few commands were executed -- after that: nothing.
The code is ok.
I copied it in the hit procedure and it worked perfectly.
So what is it with dying?
Is there a time limit or something like that?
Thanks in advance, ABJ
I didn't find anything useful in the documentation, so here's the problem.
I placed some code in the die()procedure of an sprite and only the first few commands were executed -- after that: nothing.
The code is ok.
I copied it in the hit procedure and it worked perfectly.
So what is it with dying?
Is there a time limit or something like that?
Thanks in advance, ABJ
Umm... what is the code you put in? We can't help you without knowing what code you used.
Immediately after calling the die procedure, the sprite becomes inactive and the script is terminated.
The engine does not wait until the die procedure is done executing, only until it has a chance to.
So, if you can't have any wait-type commands in the die procedure (say_stop, move_stop, wait, etc) .
Or you could try something like this:
void die(void)
{
script_attach(0);
freeze(1);
say_stop("Aha! I can speak!", 1);
say_stop("Multiple lines!", 1);
unfreeze(1);
kill_this_task();
}
The engine does not wait until the die procedure is done executing, only until it has a chance to.
So, if you can't have any wait-type commands in the die procedure (say_stop, move_stop, wait, etc) .
Or you could try something like this:
void die(void)
{
script_attach(0);
freeze(1);
say_stop("Aha! I can speak!", 1);
say_stop("Multiple lines!", 1);
unfreeze(1);
kill_this_task();
}
Isn't there some way to artificially keep the sprite alive, so wait-type commands can be executed and still use ¤t_sprite?
Check the mog script in the original game. I presume another sprite was created on that spot and had a script attached.
January 9th 2006, 09:03 PM
abjabj
You want me
That's so nice from you, but i'm married
ABJ are my initials, and a whole bunch of people call me ABJ.
So there must be a really good or at least sad story to let me give up ABJ.
Let's see if i can do it...
CU, Andy.
That's so nice from you, but i'm married
ABJ are my initials, and a whole bunch of people call me ABJ.
So there must be a really good or at least sad story to let me give up ABJ.
Let's see if i can do it...
CU, Andy.
Depends if you are already married or not.
You say I do, then she say's "Oh no you don't."
But yes, I'm bitter.
mm
You say I do, then she say's "Oh no you don't."
But yes, I'm bitter.
mm