Problems with stairs

dantedevil

Well-known member
I'm try to use this script for stairs:

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?
 
I have a big hole in the stage, then put a large table like bridge to cross.

Here the large table:

Code:
name	woodpan
health	10000
type	obstacle
shadow  0
facing   1
nolife 1
nomove 1 1
no_adjust_base 1
candamage  enemy
diesound 	data/sounds/wood.wav





anim idle
	loop	0
	offset	176 116
	delay	999
@script
void self = getlocalvar("self");

if(frame == 0){
  changeentityproperty(self, "setlayer", -1);
}

@end_script
        bbox    250 95 10 10
        platform 176 117 -118 -135 108 125 18 1  
        hitfx   data/sounds/empty.wav  
        attack  0 0 90 120 10000 1 1 1 0 200   
	frame	data/bgs/stage6-3/wood1.png






anim death
	loop	0
	delay	6
        nodieblink    3 
	offset	176 116
@script
void self = getlocalvar("self");

if(frame == 0){
  changeentityproperty(self, "setlayer", -1);
    }

if(frame == 0){
  changeentityproperty(self, "no_adjust_base", 0);
}

@end_script
	frame	data/bgs/stage6-3/wood1.png
	frame	data/bgs/stage6-3/wood2.png
	frame	data/bgs/stage6-3/wood3.png
	frame	data/bgs/stage6-3/wood4.png
	frame	data/bgs/stage6-3/wood5.png
	frame	data/bgs/stage6-3/wood6.png

The idea is the characters cross over this obstacle, while a bulldozer chasing you.
When the bulldozer passes over the table, this breaks and falls into the hole.
 
Back
Top Bottom