void hit( void )
It appears that brain 9 monsters with a void hit( void ) attack &enemy_sprite by default. (Ever noticed a bug that makes people attack you when hit by a fireball?)
My guestion is is there a way to override this or do something before the monster targets &enemy_sprite?
My guestion is is there a way to override this or do something before the monster targets &enemy_sprite?
Well, to keep the monsters from actively attacking each other, I would always make sure they would go after Dink if they were ever hit, like this:
void hit()
{
if (&enemy_sprite == 1)
sp_target(¤t_sprite, 1);
}
But that's probably not what you want. You could try experiementing with them targeting themselves or maybe 0.
void hit()
{
if (&enemy_sprite == 1)
sp_target(¤t_sprite, 1);
}
But that's probably not what you want. You could try experiementing with them targeting themselves or maybe 0.
Though my guestion was more or less universal right now I'm trying to make some goblins and guards fight each other. I've got it to work fairly well but it could still work much better. :/ What annoys me is that if a goblin hits another goblin or a guard hits another guard they sometimes change their target.
Thanks for replying.
Thanks for replying.
How many goblins have you got on the screen? Is it a constant, fixed amount each time? If it's a number like 4 or so use some global variables... and assign each sprite's number to a global in their main function and use that to control the fights. Just an idea...