sp_target
I noticed that this command (present in many monsterscripts) is automaticly executed, whether you have it in your script or not:
sp_target(¤t_sprite,&enemy_sprite);
Now the problem is that I let Dink fight alongside with a friend, so for the friend's script I want:
if (&enemy_sprite != 1)
{
sp_target(¤t_sprite,&enemy_sprite);
}
That doesn't work because of what I just said, I could fix it by do this:
if (&enemy_sprite == 1)
{
sp_target(¤t_sprite,1000);
}
but that's a pretty ugly fix, the only other thing I can think of is setting the target to be an random enemy. Or does any of you know a better fix?
sp_target(¤t_sprite,&enemy_sprite);
Now the problem is that I let Dink fight alongside with a friend, so for the friend's script I want:
if (&enemy_sprite != 1)
{
sp_target(¤t_sprite,&enemy_sprite);
}
That doesn't work because of what I just said, I could fix it by do this:
if (&enemy_sprite == 1)
{
sp_target(¤t_sprite,1000);
}
but that's a pretty ugly fix, the only other thing I can think of is setting the target to be an random enemy. Or does any of you know a better fix?
void main(void)
{
int &last_target = 1000;
}
void hit(void)
{
if (&enemy_sprite != 1)
{
&last_target = &enemy_sprite;
}
sp_target(¤t_sprite, &last_target);
}
{
int &last_target = 1000;
}
void hit(void)
{
if (&enemy_sprite != 1)
{
&last_target = &enemy_sprite;
}
sp_target(¤t_sprite, &last_target);
}
Thanks! It works a lot better then my ideas. It isn't perfect (the sprite first tries to hit me once, then goes back fighting the enemy), but it's still a pretty good fix.

SimonK used an allied in pq. He should tell us how he did.
Thanks, I'll look into the PQ sourcecode first...