O Ilusionista
Captain 80K
Hi there.
After some months of study, I am confortable with OpenBOR script and managed to reach my goal in many of my attempts (with help of others, for sure). But there is something which is still bothering me - Antiwall code, on a specific case.
This is the antiwall code I use:
It works great, and I made many variations of it (detect wall colisions, bounce on the wall, change animation upon wall detect, etc). But I need to check if my char is OVER a wall, like when we use walls as platform.
How I can do that? by checking the if the "a" position is different than "base" position?
After some months of study, I am confortable with OpenBOR script and managed to reach my goal in many of my attempts (with help of others, for sure). But there is something which is still bothering me - Antiwall code, on a specific case.
This is the antiwall code I use:
Code:
void antiwall(int Dist, int Move, int Distz)
{// Checks if there is wall at defined distance
// If there is wall, entity will be moved away with defined movement
void self = getlocalvar("self");
int Direction = getentityproperty(self, "direction");
int x = getentityproperty(self, "x");
int z = getentityproperty(self, "z");
float H;
float Hz;
if (Direction == 0){ //Is entity facing left?
Dist = -Dist; //Reverse Dist to match facing
Move = -Move; //Reverse Move to match facing
}
H = checkwall(x+Dist,z);
Hz = checkwall(x+Dist,z+Distz);
if(Hz > 0)
{
changeentityproperty(self, "position", x, z-Distz);
}
if(H > 0)
{
changeentityproperty(self, "position", x+Move);
}
}
It works great, and I made many variations of it (detect wall colisions, bounce on the wall, change animation upon wall detect, etc). But I need to check if my char is OVER a wall, like when we use walls as platform.
How I can do that? by checking the if the "a" position is different than "base" position?