they attack eachother to
I have two enemies in one screen with the same script. But when they attack Dink. The attack eachother to.
How can I make sure that they won't attack eachother only Dink?
I am using this script.
void main( void )
{
int &mcounter;
//change blood sequence
sp_blood_seq(¤t_sprite, 470);
sp_blood_num(¤t_sprite, 3);
sp_flying(¤t_sprite, 1);
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 3);
sp_sound(¤t_sprite, 56);
sp_distance(¤t_sprite, 30);
sp_timing(¤t_sprite, 25);
sp_exp(¤t_sprite, 30);
sp_base_walk(¤t_sprite, 950);
sp_base_death(¤t_sprite, 970);
sp_base_attack(¤t_sprite, 960);
sp_defense(¤t_sprite, 3);
sp_strength(¤t_sprite, 9);
sp_touch_damage(¤t_sprite, 4);
sp_hitpoints(¤t_sprite, 20);
//fly
preload_seq(951);
preload_seq(953);
preload_seq(957);
preload_seq(959);
//death
preload_seq(971);
preload_seq(973);
preload_seq(977);
preload_seq(979);
//attack
preload_seq(962);
preload_seq(964);
preload_seq(966);
preload_seq(968);
if (random(2,1) == 1)
{
sp_target(¤t_sprite, 1);
}
}
void hit( void )
{
playsound(58, 22050,0,¤t_sprite, 0);
sp_target(¤t_sprite, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
}
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","medium");
}
void attack( void )
{
playsound(57, 22050,0,¤t_sprite, 0);
&mcounter = random(2000,0);
sp_attack_wait(¤t_sprite, &mcounter);
}
How can I make sure that they won't attack eachother only Dink?
I am using this script.
void main( void )
{
int &mcounter;
//change blood sequence
sp_blood_seq(¤t_sprite, 470);
sp_blood_num(¤t_sprite, 3);
sp_flying(¤t_sprite, 1);
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 3);
sp_sound(¤t_sprite, 56);
sp_distance(¤t_sprite, 30);
sp_timing(¤t_sprite, 25);
sp_exp(¤t_sprite, 30);
sp_base_walk(¤t_sprite, 950);
sp_base_death(¤t_sprite, 970);
sp_base_attack(¤t_sprite, 960);
sp_defense(¤t_sprite, 3);
sp_strength(¤t_sprite, 9);
sp_touch_damage(¤t_sprite, 4);
sp_hitpoints(¤t_sprite, 20);
//fly
preload_seq(951);
preload_seq(953);
preload_seq(957);
preload_seq(959);
//death
preload_seq(971);
preload_seq(973);
preload_seq(977);
preload_seq(979);
//attack
preload_seq(962);
preload_seq(964);
preload_seq(966);
preload_seq(968);
if (random(2,1) == 1)
{
sp_target(¤t_sprite, 1);
}
}
void hit( void )
{
playsound(58, 22050,0,¤t_sprite, 0);
sp_target(¤t_sprite, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
}
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","medium");
}
void attack( void )
{
playsound(57, 22050,0,¤t_sprite, 0);
&mcounter = random(2000,0);
sp_attack_wait(¤t_sprite, &mcounter);
}
Delete the sp_target line. This causes the sprite the script is attached to (¤t_sprite) to target whatever has attacked it (&enemy_sprite).
void hit( void )
{
playsound(58, 22050,0,¤t_sprite, 0);
sp_target(¤t_sprite, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
}
void hit( void )
{
playsound(58, 22050,0,¤t_sprite, 0);
sp_target(¤t_sprite, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
}
Unless it was changed in 1.08, that won't work... The monsters will still attack each other. I got really pissed off by this when trying to make a group fight with goblins and guards. ><
So yeah, you'll have to change &enemy_sprite into 1.
sp_target(¤t_sprite, 1);
So yeah, you'll have to change &enemy_sprite into 1.
sp_target(¤t_sprite, 1);
Truly? Ah well, I've always been a crappy scripter.
I didn't change it, and I think I remember that bug too.
Some consider this a bug, some others a fighting technique
If it gives a bug, why not try
sp_target(¤t_sprite, 1);
?
sp_target(¤t_sprite, 1);
?
It helps me out when idiot modders decide to put 50 boncas onscreen when Dink has about 3 attack and defense.
Then again, there is Ultimate Cheat...
Then again, there is Ultimate Cheat...















