dantedevil
Well-known member
I'm try to use this script for stairs:
Then in the character:
But when the character reach a wall with only 1 of (alt), can cross walking over the wall. He stop, like a big wall is in front.
What am I doing wrong?
Code:
void stairwalk(int Dist, int Move, int Height)
{// Checks if there is short wall in front of player
// If there is short wall, player will move up to walk up stairs
// Dist = checking distance in x axis
// Move = moving distance in x axis
// Height = checking height
void self = getlocalvar("self");
int Direction = getentityproperty(self, "direction");
int x = getentityproperty(self, "x");
int y = getentityproperty(self, "a");
int z = getentityproperty(self, "z");
int b = getentityproperty(self, "base");
float H;
int Move;
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);
if(H > b && H <= Height+b){
changeentityproperty(self, "position", x+Move, NULL(), y+10);
}
}
Then in the character:
Code:
anim walk
loop 1
delay 3
offset 68 131
bbox 61 76 20 56
@cmd stairwalk 3 3 9
frame data/chars/billy/walk1.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk1.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk1.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk1.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk2.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk2.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk2.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk2.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk3.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk3.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk3.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk3.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk4.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk4.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk4.png
@cmd stairwalk 3 3 9
frame data/chars/billy/walk4.png
But when the character reach a wall with only 1 of (alt), can cross walking over the wall. He stop, like a big wall is in front.
What am I doing wrong?