The Dink Network

Reply to Re: Two questions

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
August 14th 2006, 07:24 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
2) is a limitation of about anything: If a script attached to a monster does something, and then you hit it (or talk, touch, die, push, other built-in procs), it plainly forgets what it was supposed to do and continues to do the built-in proc.

Try it with an unfrozen Dink in a lengthy talk()-dialogue, then hit him. He'll stop talking.

The way I see it, set_callback_random(proc, base, range) is equivalent to:

int &rndtime = random(base, range);
wait(&rndtime);
proc();

So if you had it waiting before it runs proc(), and then hit it, the script forgets that it was waiting and runs the hit() thing.

It's also the reason why sp_touch_damage(&current_sprite,0); should be in the first line of a touch-proc: It detects that Dink touches it and forgets doing whatever it was doing in the touch-proc, and then runs the touch-proc.