Reply to Script that does not work
If you don't have an account, just leave the password field blank.
What I'm trying to do in the script below is to get the bonca run away before he is killed - but unfortunately the script doesn't work. So what's wrong?
//blood bonca that lives in the cellar
void main( void )
{
int &mcounter;
sp_brain(&current_sprite, 9);
sp_speed(&current_sprite, 2);
sp_distance(&current_sprite, 50);
sp_timing(&current_sprite, 0);
sp_exp(&current_sprite, 100);
sp_base_walk(&current_sprite, 860);
sp_base_death(&current_sprite, 880);
sp_base_attack(&current_sprite, 870);
sp_defense(&current_sprite, 0);
sp_strength(&current_sprite, 10);
sp_touch_damage(&current_sprite, 5);
sp_hitpoints(&current_sprite, 100);
sp_target(&current_sprite, 1);
preload_seq(861);
preload_seq(863);
preload_seq(867);
preload_seq(869);
preload_seq(872);
preload_seq(874);
preload_seq(876);
preload_seq(878);
preload_seq(881);
preload_seq(883);
preload_seq(887);
preload_seq(889);
mainloop:
int &rough = sp_hitpoints(&current_sprite, -1);
if (&rough < 20)
{
end();
}
wait(1);
goto mainloop;
}
void hit( void )
{
playsound(29, 22050,0,&current_sprite, 0);
sp_target(&current_sprite, &enemy_sprite);
}
void talk( void )
{
if (sp_target(&current_sprite, -1) == 1)
{
say("`#Now you will die!", &current_sprite);
}
if (sp_target(&current_sprite, -1) != 1)
{
playsound(29, 22050,0,&current_sprite, 0);
say("`#Get away from me!", &current_sprite);
}
}
void end( void )
{
script_attach(1000);
say("`#Arruunk!", &current_sprite);
sp_speed(&current_sprtie, 4);
sp_timing(&current_sprite, 0);
move_stop(&current_sprite, 4, 0, 1);
sp_active(&current_sprite, 0);
freeze(1);
sp_dir(1, 4);
wait(1000);
say_stop("Stupid bonca...", 1);
wait(250);
unfreeze(1);
if (&get_sprite_with_this_brain(9 == 0)
{
screenlock(0);
if (&story == 13)
{
playmidi("winter.mid");
}
}
}
void attack( void )
{
playsound(31, 22050,0,&current_sprite, 0);
&mcounter = random(1000,0);
sp_attack_wait(&current_sprite, &mcounter);
}
//blood bonca that lives in the cellar
void main( void )
{
int &mcounter;
sp_brain(&current_sprite, 9);
sp_speed(&current_sprite, 2);
sp_distance(&current_sprite, 50);
sp_timing(&current_sprite, 0);
sp_exp(&current_sprite, 100);
sp_base_walk(&current_sprite, 860);
sp_base_death(&current_sprite, 880);
sp_base_attack(&current_sprite, 870);
sp_defense(&current_sprite, 0);
sp_strength(&current_sprite, 10);
sp_touch_damage(&current_sprite, 5);
sp_hitpoints(&current_sprite, 100);
sp_target(&current_sprite, 1);
preload_seq(861);
preload_seq(863);
preload_seq(867);
preload_seq(869);
preload_seq(872);
preload_seq(874);
preload_seq(876);
preload_seq(878);
preload_seq(881);
preload_seq(883);
preload_seq(887);
preload_seq(889);
mainloop:
int &rough = sp_hitpoints(&current_sprite, -1);
if (&rough < 20)
{
end();
}
wait(1);
goto mainloop;
}
void hit( void )
{
playsound(29, 22050,0,&current_sprite, 0);
sp_target(&current_sprite, &enemy_sprite);
}
void talk( void )
{
if (sp_target(&current_sprite, -1) == 1)
{
say("`#Now you will die!", &current_sprite);
}
if (sp_target(&current_sprite, -1) != 1)
{
playsound(29, 22050,0,&current_sprite, 0);
say("`#Get away from me!", &current_sprite);
}
}
void end( void )
{
script_attach(1000);
say("`#Arruunk!", &current_sprite);
sp_speed(&current_sprtie, 4);
sp_timing(&current_sprite, 0);
move_stop(&current_sprite, 4, 0, 1);
sp_active(&current_sprite, 0);
freeze(1);
sp_dir(1, 4);
wait(1000);
say_stop("Stupid bonca...", 1);
wait(250);
unfreeze(1);
if (&get_sprite_with_this_brain(9 == 0)
{
screenlock(0);
if (&story == 13)
{
playmidi("winter.mid");
}
}
}
void attack( void )
{
playsound(31, 22050,0,&current_sprite, 0);
&mcounter = random(1000,0);
sp_attack_wait(&current_sprite, &mcounter);
}