The Dink Network

Simple question

April 25th 2006, 04:27 PM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
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?
April 25th 2006, 04:33 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
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!", &current_sprite);
}

Note that the text will probably not display for very long, because I think it is removed when the sprite is removed.
April 25th 2006, 04:39 PM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
okay, cool! Then I'll use that function in my D-Mod
thanks redink1!
April 26th 2006, 02:50 AM
dragon.gif
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.
April 26th 2006, 03:54 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
No, it can't.

Not in the way you're saying anyway.
April 26th 2006, 06:18 PM
dragon.gif
What? But I thought the wait command made the rest of the srcipt wait a set ammount of time (x).
April 26th 2006, 06:36 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
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",&current_sprite);
}

For large values of &long_enough (10000 should do the trick), you will not see the text.
April 26th 2006, 07:02 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
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.

April 26th 2006, 07:04 PM
wizard.gif
Chrispy
Peasant He/Him Canada
I'm a man, but I can change, if I have to.I guess. 
What about having about a say_stop and a wait(1) in a 200 lenght loop?
April 26th 2006, 07:39 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
I'm not quite sure what you mean?
April 27th 2006, 01:14 AM
wizard.gif
Chrispy
Peasant He/Him Canada
I'm a man, but I can change, if I have to.I guess. 
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.
April 27th 2006, 11:10 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
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).