Void die bugs.
Whenever I use the void die command, if I add more than 2 lines after it the D-Mod freezes and all Dink can do is stand like an idiot, breathing slowly. Can anyone help?
void die ( void) { freeze(1); say_stop("Bla bla bla", 1); unfreeze(1); }
This is easy. The whole procedure won't run because the sprite is killed the next update and so the script stops, never getting to your unfreeze command.
You need to put that code into an external .c file and call that in the die() procedure. Like this:
and in that file you put your previous code under its void main().
Hope that helps
You need to put that code into an external .c file and call that in the die() procedure. Like this:
void die () { external("file"); }
and in that file you put your previous code under its void main().
Hope that helps

Don't forget to add: kill_this_task(); (This is needed because otherwise the script won't terminate and go on and use computer resources.)
So the full script would be:
So the full script would be:
void die(void) { freeze(1); say_stop("Bla bla bla", 1); unfreeze(1); kill_this_task(); }
I have a write-up about this behaviour in this thread. The interesting part is:
- Dink kills monster
- Engine runs die() procedure, and makes sure that the sprite is killed whenever the engine has the chance to do something.
- die() procedure has one of the previously mentioned pausing commands. (in this case say_stop)
- Engine pauses the script, and does something else.
- Engine chooses to kill the sprite.
- Engine kills sprite, and thus the script.
- Engine can no longer continue running the die() procedure.
- Dink kills monster
- Engine runs die() procedure, and makes sure that the sprite is killed whenever the engine has the chance to do something.
- die() procedure has one of the previously mentioned pausing commands. (in this case say_stop)
- Engine pauses the script, and does something else.
- Engine chooses to kill the sprite.
- Engine kills sprite, and thus the script.
- Engine can no longer continue running the die() procedure.