The Dink Network

Reply to Re: Custom procedures

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:
 
 
December 21st 2024, 01:18 AM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
I'm not convinced that set_callback_random actually calls itself infinitely until the script that has it is killed.

I've been testing a callback function that checks if an enemy sprite is trapped in the bottom right hand corner, and if so, break out of that with a move in direction 7 to x co-ord 300. This works if I have a callback command at the end of the custom command, and was something I remember Paul Pliska did for his enemy sprite script that could fire off magic missiles at Dink which I used for my enemy at the end of story 2 of SOB

//It seems that I have to re-set the callbacks
//evrytime it is hit or attacks or shoots.

// ************ CALL BACKS *************
&cbsnd = set_callback_random( "sound",1000,8500);
//for Lich sound.
&cbfire = set_callback_random( "fb",500,4500);
//for FIREBALL
&mcounter = random(6000,2000);
sp_attack_wait(&current_sprite, &mcounter);
}


That's the code from Paul and his comments