Die_In_Fire
Well-known member
Everything is looking so amazing!!!
This is the default behavior of the engine - if an entity is inside a wall, the engine moves that entity to the top of the wall up to a certain limit (1000px). If the wall is higher than this limit, the entity is removed (dead).Throwing next to a wall teleports thrown entity onto the top of the wall
MAX_WALL_HEIGHT = 1000; // Max wall height that an entity can be spawned on
On that case, the engine is doing right: if the entity wasn't removed, it will be stuck forever inside the wall and the game won't continue.danno said:Thanks man, I have used anti wall and your tips releasing/not releasing at 0, I wished I knew a month ago but I eventually figured it all out hahaha, sometimes the default engine behaviour makes me want to quit hahaha but I understand
nedflandeurse said:I'm not sure for the blue and red "only" for p1 and p2.
I imagine some borders of sprites/a frame.
Thanks buddy! Yeah, I'm using the antiwall script at the moment the grabbed entity is released by the grabber.Kratus uses it differently - and very cleverly: In the fall animation of enemies, instead of whoever attacks
void throw(int damage, int type, int Vx, int Vy, int Vz, int face)
{//Damage as throw finisher
void self = getlocalvar("self");
void target = getentityvar(self,"grabbed");
int z = getentityproperty(self,"z");
int tDir = getentityproperty(target,"direction");
int vDir;
if(face == 0){ //SAME FACING?
vDir = tDir;
}
if(face == 1){ //OPPOSITE FACING?
if(tDir == 0){ //FACING LEFT?
vDir = 1;
}else{
vDir = 0;
}
}
if(target != NULL()){
void eType = getentityproperty(target,"type");
int dir = getentityproperty(target,"direction");
void atkType;
void projectile;
if(dir == 0){Vx = -Vx;}
if(type == 1){atkType = openborconstant("ATK_NORMAL8");}
if(type == 2){atkType = openborconstant("ATK_NORMAL9");}
if(z > (openborconstant("PLAYER_MIN_Z")+openborconstant("PLAYER_MAX_Z"))/2){Vz = -Vz ;}
if(eType == openborconstant("TYPE_PLAYER") || eType == openborconstant("TYPE_NPC")){
changeentityproperty(target, "projectilehit", "type_player", "type_npc", "type_obstacle");
}
else
if(eType == openborconstant("TYPE_ENEMY")){
changeentityproperty(target, "projectilehit", "type_enemy", "type_obstacle");
}
damageentity(target, self, 0, 1, atkType);
changeentityproperty(target, "direction", vDir);
changeentityproperty(target, "aiflag", "projectile", 1);
changeentityproperty(target, "damage_on_landing", damage); //RESET PROJECTILE STATUS TO 0 WHEN FALL ON THE GROUND, TOTAL DAMAGE
tossentity(target, Vy, Vx, Vz); //TOSS OPPONENT
antiWallG();
setentityvar(self, "grabbed", NULL()); //CLEAR ENTITYVAR
}
}
void slam(int damage, int type, int Vx, int Vy, int Vz, int face)
{//Damage as slam finisher
void self = getlocalvar("self");
void target = getentityvar(self,"grabbed");
int tDir = getentityproperty(target,"direction");
int vDir;
if(face == 0){ //SAME FACING?
vDir = tDir;
}
if(face == 1){ //OPPOSITE FACING?
if(tDir == 0){ //FACING LEFT?
vDir = 1;
}else{
vDir = 0;
}
}
if(target != NULL()){
void eType = getentityproperty(target,"type");
int dir = getentityproperty(target,"direction");
void atkType;
void projectile;
if(dir == 0){Vx = -Vx;}
if(type == 1){atkType = openborconstant("ATK_NORMAL8");}
if(type == 2){atkType = openborconstant("ATK_NORMAL9");}
if(eType == openborconstant("TYPE_PLAYER") || eType == openborconstant("TYPE_NPC")){
changeentityproperty(target, "projectilehit", "type_player", "type_npc", "type_obstacle");
}
else
if(eType == openborconstant("TYPE_ENEMY")){
changeentityproperty(target, "projectilehit", "type_enemy", "type_obstacle");
}
damageentity(target, self, damage/1.5, 1, atkType); //SPLIT DAMAGE
changeentityproperty(target, "direction", vDir);
changeentityproperty(target, "aiflag", "projectile", 1);
changeentityproperty(target, "damage_on_landing", damage/3); //RESET PROJECTILE STATUS TO 0 WHEN FALL ON THE GROUND, SPLIT DAMAGE
tossentity(target, Vy, Vx, Vz); //TOSS OPPONENT
antiWallG();
setentityvar(self, "grabbed", NULL()); //CLEAR ENTITYVAR
}
}
void antiWallG()
{//Checks distance from the walls, same as used in "animation event" but only for grab animations
//The grabber checks if the grabbed entity is inside any wall when the grab move ends
//In case the grabbed entity is inside any wall, the grabbed entity will be moved to the same grabber coordinates outside of the wall
void self = getlocalvar("self");
void target = getentityvar(self, "grabbed");
int x = getentityproperty(self, "x");
int Tx = getentityproperty(target, "x");
int z = getentityproperty(self, "z");
int Tz = getentityproperty(target, "z");
float wall = checkwall(Tx, Tz);
if(target != NULL()){
if(wall){
changeentityproperty(target, "position", x, z+1);
changeentityproperty(target, "velocity", 0, 0, NULL());
}
}
}
O_Ilusionista said:If you use z+1 instead of Z on a stage where you use a wall in front of the players, this will release the target inside a wall again.Code:changeentityproperty(target, "position", x, z+1);
changeentityproperty(target, "position", x-2, z);
Yeah, you're right. I only added this "z+1" because some grab moves make the character still stuck near diagonal walls if the angle comes to behind the character or on top of the screen.If you use z+1 instead of Z on a stage where you use a wall in front of the players, this will release the target inside a wall again.
Great! I saw your video and it seems that the script is working very well.I used this for jakes pile driver and all other throws when wall is in front of player, will do more tests
O_Ilusionista said:edit: ah the move at 0:32 should use a antiwall while throwing too, because you was able to bash the enemy inside the wall and while it won't bug, it looks a bit strange.
A tip that may help, it's possible to use the "player_max_z" as a "fake" wall if you need to block the player movement at the bottom of the screen. In SOR2X I always try to not use walls or platform below the character when I have walls at the left or right sides of the screen, and this way the "z+1" can work correctly.In night slashers sometimes there is a wall below and some walls the angle is towards you not away from player so z+1 can sometimes do the wall teleportbut I changed the throw move so entity is not tossed +z also
damageentity(target, self, damage/1.5, 1, atkType); //SPLIT DAMAGE
lockMpG();
specialCostG(damage);
changeentityproperty(target, "direction", vDir);
changeentityproperty(target, "aiflag", "projectile", 1);
changeentityproperty(target, "damage_on_landing", damage/3); //RESET PROJECTILE STATUS TO 0 WHEN FALL ON THE GROUND, SPLIT DAMAGE
tossentity(target, Vy, Vx, Vz); //TOSS OPPONENT
antiWallG();
setentityvar(self, "grabbed", NULL()); //CLEAR ENTITYVAR
damageentity(target, self, damage/1.5, 1, atkType); //SPLIT DAMAGE
lockMpG();
specialCostG(damage);
changeentityproperty(target, "direction", vDir);
changeentityproperty(target, "aiflag", "projectile", 1);
changeentityproperty(target, "damage_on_landing", damage/3); //RESET PROJECTILE STATUS TO 0 WHEN FALL ON THE GROUND, SPLIT DAMAGE
antiWallG();
tossentity(target, Vy, Vx, Vz); //TOSS OPPONENT
setentityvar(self, "grabbed", NULL()); //CLEAR ENTITYVAR
@cmd keyint "ANI_FREESPECIAL40" 0 "UJ" 0 25
@cmd keyint "ANI_FREESPECIAL29" 0 "FJ" 0 25
@cmd keyint "ANI_FREESPECIAL30" 0 "BJ" 0 25
@cmd keyint "ANI_FREESPECIAL42" 0 "DJ" 0 25
@cmd keyint "ANI_FREESPECIAL43" 0 "J" 0 25
@cmd keyint "ANI_FREESPECIAL24" 0 "UJ" 0 200
@cmd keyint "ANI_FREESPECIAL34" 0 "DJ" 0 200
@cmd keyint "ANI_FREESPECIAL17" 0 "FJ" 0 200
@cmd keyint "ANI_FREESPECIAL27" 0 "BJ" 0 200