Reply to Re: projectile script
If you don't have an account, just leave the password field blank.
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(¤t_sprite, 0);
}
void damage( void )
{
//hooray, we hit something.
sp_speed(¤t_sprite, 0);
sp_brain(¤t_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
void main( void )
{
//This is the missile
sp_strength(¤t_sprite, 0);
}
void damage( void )
{
//hooray, we hit something.
sp_speed(¤t_sprite, 0);
sp_brain(¤t_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