The Dink Network

Amusing bug?

July 27th 2004, 10:26 PM
anon.gif
MiloBones
Ghost They/Them
 
Has anyone else experienced that using the hurt command on a sprite causes emake to run? This might have been due to the circumstances I called it under, but is extremely funny in any case... I'm trying to poison a bonca, and everytime the poison does damage, the bonca makes me some gold, or a big heart...
July 28th 2004, 05:05 AM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
Where in the script are you calling the hurt command?
July 28th 2004, 08:51 AM
anon.gif
MiloBones
Ghost They/Them
 
In a poison() proc, called from another script via is_script_attached and run_script_by_number. The proc looks something like this:

void poison( void )
{
loop_here:
wait(500);
&random = random(2,1);
if (&random == 2)
{
hurt(&current_sprite, 5);
goto loop_here;
}
}

It'll probably work if I make it return at the end, but there are two things which are weird about this.

1. It only ran emake when hurt was actually called. If &random was 1 the first time through, it did nothing.

2. It JUST ran emake. No corspe...
July 28th 2004, 10:01 AM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
I'm stumped. Probably just an another stupid bug with the DinkC.

BTW, try what happens if you switch the die and poison procedures' places. I.e. if you had poison before die, switch places that die is before poison.
July 28th 2004, 10:08 AM
spike.gif
That most surely happens because it runs the die procedure after hurting the sprite... I've had similar odd problems (several times) and I've in fact encountered the very same problem as you. (except that I tried to do something else than hurt the enemy) MadStalker's way should fix it, but if not I recall that putting a return; in the end of the procedure should do the trick.
July 28th 2004, 10:39 AM
anon.gif
MiloBones
Ghost They/Them
 
Neither worked. I'll figure something out, though. I could always just have die() check if the thing is really dead...
July 28th 2004, 01:33 PM
farmer.gif
void poison( void )
{
loop_here:
wait(500);
&random = random(2,1);
if (&random == 2)
{
hurt(&current_sprite, 5);
}
goto loop_here;
}

i fixed it so that it doesn't just do nothing when the random number is 2.
July 28th 2004, 05:24 PM
anon.gif
MiloBones
Ghost They/Them
 
That kinda misses the point, since it would last forever. How dare you not be telepathic... Thanks, though.