Chase bug?

O Ilusionista

Captain 100K
I made a char which will chase the enemy but, for an unknow reason, if he is offscreen (sometimes, he is even on the screen but close to the edge) he stops to move, and play his idle animation until I get near of it. So, this render a bug when I use a move which blast the enemy far away - he never gets on the screen again and the game is stuck.

What could be wrong here?

Code:
name Sam
health 120
speed 9
type	enemy
gfxshadow 1
hostile player npc
candamage player npc obstacle
projectilehit enemy obstacle
aimove Chase
aggression 40
falldie  2
blockodds		1

The strange is: I have another enemy, which acts exactly on the same way, and I don't see it get stuck on the outside of the screen

Code:
name Riot
health 180
speed 9
type	enemy
gfxshadow 1
hostile player npc
candamage player npc obstacle
projectilehit enemy obstacle
aimove Chase
aggression 40
falldie  2
blockodds		1

Sidenote: after some openBOR version (I need to check which one), if you spawn an enemy too near of the screen edge, it will get stuck. I had no problem on my PDC demo, but when I updated the openBOR, enemies get stuck if you spawn it, say, 50 pixels beyond the screen.
 
I solved this using this script by bWWd:
Code:
@script
                void self = getlocalvar("self");
                int  pos  = openborvariant("xpos");
                int  selfx     = getentityproperty(self, "x");
                if ((selfx > pos + 480 )&&(frame == 0)){
                changeentityproperty(self, "direction", 0);
                performattack(self, openborconstant("ANI_FREESPECIAL3"));
      }
      if ((selfx < pos + 1 )&&(frame == 0)){
                changeentityproperty(self, "direction", 1);
                performattack(self, openborconstant("ANI_FREESPECIAL3"));
      }
   @end_script

But this is not right.
 
Back
Top Bottom