Simple question
Were just wondering... Is "void die(void)" an existing command?
Like when a pillbug (or something else) die and they have a "Void die(void)" command, will they say like aaargh! (for example) when I kill them?
Like when a pillbug (or something else) die and they have a "Void die(void)" command, will they say like aaargh! (for example) when I kill them?
Sort of. void die(void) isn't a command, it is a function.
So to make a pillbug say "aaargh!" when it dies, it should have this in its script:
void die(void)
{
say("aaargh!", ¤t_sprite);
}
Note that the text will probably not display for very long, because I think it is removed when the sprite is removed.
So to make a pillbug say "aaargh!" when it dies, it should have this in its script:
void die(void)
{
say("aaargh!", ¤t_sprite);
}
Note that the text will probably not display for very long, because I think it is removed when the sprite is removed.
okay, cool! Then I'll use that function in my D-Mod
thanks redink1!

thanks redink1!
For anyone that interested it can be fized with a simple command:
wait(x);
Where x is a number of your choosing in miliseconds. This line would go below the say line.
wait(x);
Where x is a number of your choosing in miliseconds. This line would go below the say line.
No, it can't.
Not in the way you're saying anyway.
Not in the way you're saying anyway.
What? But I thought the wait command made the rest of the srcipt wait a set ammount of time (x).
True, it makes the script wait, but it doesn't stop the Dink engine from killing the sprite and thus the script. With 'killing', I mean "real" killing, as in removing from the game world. That's why you should use spawn(), script_attach() or something similar, when you want a cut-scene after an enemy's death.
Try
void die (void)
{
wait(&long_enough);
say("Blaaat",¤t_sprite);
}
For large values of &long_enough (10000 should do the trick), you will not see the text.
Try
void die (void)
{
wait(&long_enough);
say("Blaaat",¤t_sprite);
}
For large values of &long_enough (10000 should do the trick), you will not see the text.
Actually... I don't think you'd see the text at all. You wouldn't even see the text with a wait(1).
The engine will kill the sprite as soon as the die procedure stops executing, either when it finishes or when it has a wait say_stop, or similar command.
The engine will kill the sprite as soon as the die procedure stops executing, either when it finishes or when it has a wait say_stop, or similar command.
What about having about a say_stop and a wait(1) in a 200 lenght loop?
Well, couldn't you just put the wait and say(Blargh) in a repeating loop? Sure, the text would theoretically be placed and erased from the screen many times, but wouldn't this have the effect of just having the text appear as displays don't refresh screens that fast?
N/m. I just realized how stupid I am. Sorry.
Or does DinkC not have loops? I don't remember to tell the truth.
N/m. I just realized how stupid I am. Sorry.

Or does DinkC not have loops? I don't remember to tell the truth.
DinkC has loops, in this way:
loop:
//do loop stuff here, maybe a counter variable check.
goto loop
But as you might have realised, the first wait(&whatever) in the loop will cause the script to pause and give the engine the change to kill the sprite (and thus the script).
loop:
//do loop stuff here, maybe a counter variable check.
goto loop
But as you might have realised, the first wait(&whatever) in the loop will cause the script to pause and give the engine the change to kill the sprite (and thus the script).