The Dink Network

What's wrong with this loop?

February 25th 2004, 03:09 PM
spike.gif
void hurt1_10( void )
{
&time = 10;
loop:
hurt(1, 1);
&time -= 1;
wait(1000);
if (&time < 1)
kill_this_task();
goto loop;
}

When I run this task, it hurts Dink for several points for a few seconds. So what's wrong??
February 25th 2004, 04:31 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
I know you're *supposed* to be able to stack some commands, but I wouldn't risk it.
...
if (&time < 1)
{
kill_this_task();
}
...
(edit)
then try adding this in the loop-
say_stop(&time,1);
that way you know where its at.
Of course its easier to ALT-D and read the Debug log...
February 25th 2004, 04:38 PM
spike.gif
I've tried that, but it didn't work.
February 25th 2004, 04:39 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Um...

What is the script supposed to do? It looks like it works.
February 25th 2004, 04:47 PM
spike.gif
To deal 1 point of damage per second for 10 seconds on Dink. What it does, it deals more than 10 points of damage in 2 seconds or less.

EDIT: If it has anything to do with anything, the script runs when Dink touches a bonca. It's called by an external("hurt", "hurt1_10);
The script has other similar procedures too, like "hurt5_10" and "hurt10_20"
February 25th 2004, 05:09 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
TOUCH???
o.k. Ive had that prob. Dink keeps checking over and over to see if youre still touching the Bonca.
First line in the touch proc need to make the sprite no_touch. ( I forget... sp_touch(&current_sprite,0); ??)
February 25th 2004, 05:28 PM
spike.gif
OMG, I can't believe I've been so stupid.. I've got a headache and the clock is 3:20 at night here, so I can always say that's the reason why I didn't figure that one out myself.

Thanks Ric!
February 25th 2004, 05:31 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
No problem.
Thats how I felt when someone on this board told me that too.(after I pulled out more hair than I can spare...)