I need some help, guys
I know how to make a script spawn to another script, like this
Here's my script now:
(the die prodecue isn't completed yet)
So, as you can see, the script would spawn to another script named "duckstuff", but how can I make it to spawn to the "duckstuff" after 10 seconds, again? This would need to continue as long, until the enemy is dead.
Thanks,
Skull
spawn("someotherscript") but how can I make the script so after certain amount of time, it spawns to the other script again?Here's my script now:
//THE DUCK!!
void main(void)
{
//the duck's standard things
say("`%YOU WILL NEVER WIN, SMALLWOOD!!", ¤t_sprite);
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 3);
sp_exp(¤t_sprite, 500);
sp_base_walk(¤t_sprite, 20);
sp_base_death(¤t_sprite, 111);
sp_touch_damage(¤t_sprite, 10);
sp_hitpoints(¤t_sprite, 800);
preload_seq(131);
preload_seq(133);
preload_seq(141);
preload_seq(143);
if (random(2,1) == 1)
{
sp_target(¤t_sprite, 1);
}
spawn("duckstuff")
}
void hit( void )
{
//lock on to the guy who just hit us
sp_target(¤t_sprite, &enemy_sprite);
//play the "Quack!" sound
Playsound(21,22050,0,0,0);
}
void die( void )
{
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 6);
&save_x = sp_x(¤t_sprite, -1);
&save_y = sp_y(¤t_sprite, -1);
external("emake","small");
}
}(the die prodecue isn't completed yet)
So, as you can see, the script would spawn to another script named "duckstuff", but how can I make it to spawn to the "duckstuff" after 10 seconds, again? This would need to continue as long, until the enemy is dead.
Thanks,
Skull
I would say just put a 10 second loop in, but it'll probably leave the loop whenever the hit procedure is run... hmm.
Only way I can think of offhand is to have the loop in a seperate script, but that could get messy if you have more than one of these ducks on the screen.
Edit: Or it might work to have the loop in duckstuff.c and use external instead of spawn, then you can use ¤t_sprite to control the duck and there'll be no problems with more than one. Hopefully.
Only way I can think of offhand is to have the loop in a seperate script, but that could get messy if you have more than one of these ducks on the screen.
Edit: Or it might work to have the loop in duckstuff.c and use external instead of spawn, then you can use ¤t_sprite to control the duck and there'll be no problems with more than one. Hopefully.
//the duck
void main (void)
{
//blah blah
external("duckstuff", "main");
}
//duckstuff.c
void main (void)
{
loop:
wait(10000);
//whatever happens... use ¤t_sprite
goto loop;
}
Thanks, gonna try out your script soon. A massive laziness attack just hit me










