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 15th 2006, 02:34 PM
knightg.gif
cypry
Peasant He/Him Romania
Chop your own wood, and it will warm you twice. 
Why don't you create another sprite on the screen, that should call the procedure.
In your monster's main procedure, use:
int &caller = create_sprite(0,0,0,100,1);//just random numbers
sp_nodraw(&caller,1);
sp_nohit(&caller,1);
sp_brain_parm(&caller,&current_sprite);
sp_script(&caller,"caller");

now, the "caller" script:
void main(void)
{
int &monster = sp_brain_parm(&current_sprite,-1);
set_callback_random("woo",500,2000);
}
void woo(void)
{
//place here your procedure
//just refer to &monster
}

in the monster's die procedure, don't forget to add
sp_active(&caller,0);

Hope it works. I didn't test it.