The Dink Network

Reply to Re: projectile script

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:
 
 
October 30th 2005, 05:40 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
I have some ideas for a script, but they work only if you want it as an item (not-magic) and you're also in bad luck if you want to let it stick to moving things, but maybe you can use a shadow brain for that. Dummy code:

void main( void )
{
//This is the missile
sp_strength(&current_sprite, 0);
}

void damage( void )
{
//hooray, we hit something.
sp_speed(&current_sprite, 0);
sp_brain(&current_sprite, 0);
//I don't know if it works, but you might want to set this brain to a shadow brain, with a brain parm of the missile target.
loop:
wait(10);
wait_for_button();
if (&result == &whatever_key_the_ctrl_is)
{
//explosion code, probably copied from a bomb script
}
goto loop;
}

LATE ADDITION: You can copy the fireball script (item script, not missile script) for this, but you must fix it so that it remembers if there's already a missile out there. Probably by &sticky = create_sprite(#missile parms); and making &sticky a global. Then maybe using the sp_gold trick to determine on other screens if there's a missile of the sticky type in there. Anyway, I'm out, maybe some other author can help you