DD Tokki
Well-known member
The "wallbons" script effect causes enemies to bounce off walls when knocked down. I thought it was solved before, but there is one problem.
The player can move to both sides of the stage, and if the enemy leaves the screen while downed, they will ascend to the sky as shown in the video.
The script is like this:
C:
void main()
{
wallBounce();
wallUnlock();
}
void wallBounce()
{// Wall bounce on falling state
void self = getlocalvar("self");
int Vx = getentityproperty(self,"xdir");
int Vy = getentityproperty(self,"tossv");
int Vz = getentityproperty(self,"zdir");
int Fall = getentityproperty(self, "aiflag", "drop");
if(Fall==1){
changeentityproperty(self, "velocity", -Vx*0.5, -Vz*0.5, Vy+1); // bounced
}
}
void wallUnlock()
{//Unlock the screen edge (for enemies) according to defined animations
void self = getlocalvar("self");
void type = getentityproperty(self,"type");
int anim = getentityproperty(self, "animationID");
if(type == openborconstant("TYPE_ENEMY")){
if( anim == openborconstant("ANI_WALK")||
anim == openborconstant("ANI_RUN")){
changeentityproperty(self, "subject_to_screen", 0);
}
}
}
I would like to fix an issue with enemies ascending when they are off screen.