• All, Gmail is currently rejecting messages from my host. I have a ticket in process, but it may take some time to resolve. Until further notice, do NOT use Gmail for your accounts. You will be unable to receive confirmations and two factor messages to login.

Climbing (or Walking) on Walls and Ceilings

maxman

Well-known member
I have some issues with how the character interacts with the bottom of the platform (or ceiling). I got that climbing script on ceiling working, but when I'm dropping myself after the jumping momentum and touching the bottom of the platform overhead, I'm able to grip while being a bit far away from the ceiling and it's weird. Also, while gripping the ceiling, I can move only right, but I cannot move left. How am I going to press left after making this keyscript for it? How can I make the character grip the ceiling overhead without gripping far away from it?

Character text file:

wolvkey.c:
C:
void main(){
    int index = getlocalvar("player");
    void self = getplayerproperty(index, "entity");
    void aniID = getentityproperty(self, "animationid");
    int dir = getentityproperty(self, "direction");
    int x = getentityproperty(self, "x");
    int z = getentityproperty(self, "z");
    int y = getentityproperty(self, "a");
    int frame = getentityproperty(self, "animpos");

    // Holds
    void UpH = playerkeys(index, 0, "moveup");
    void RightH = playerkeys(index, 0, "moveright");
    void LeftH = playerkeys(index, 0, "moveright");
    void DownH = playerkeys(index, 0, "movedown");

    void JumpH = playerkeys(index, 0, "jump");

    // Presses
    void Up = playerkeys(index, 1, "moveup");
    void Right = playerkeys(index, 1, "moveright");
    void Left = playerkeys(index, 1, "moveright");
    void Down = playerkeys(index, 1, "movedown");

    void Jump = playerkeys(index, 1, "jump");

    // Releases
    void UpR = playerkeys(index, 2, "moveup");
    void RightR = playerkeys(index, 2, "moveright");
    void LeftR = playerkeys(index, 2, "moveright");
    void DownR = playerkeys(index, 2, "movedown");

    void Plat = checkplatformabove(x, z, y+1);
    //void PlatSide = checkplatformbetween(x, z, y+0, y+14); // checkplatformbetween(x,z,ymin,ymax);
    int Length; int Px; int Py; void PlatA; void PlatB; int Wall;
    int PlatY = getentityproperty(Plat, "y");
    void PlatBase = getentityproperty(Plat, "base");


    /*
    if(Plat){
        Length = getentityproperty(Plat, "antigrab");
        Px = getentityproperty(Plat, "x");
    }
    */
    
    //Grip the ceiling
    if(UpH && Plat){
        if(aniID == openborconstant("ANI_JUMP") ){
            changeentityproperty(self, "subject_to_gravity", 0);
            changeentityproperty(self, "aiflag", "jumping", 0);
            Length = getentityproperty(Plat, "antigrab");
            Px = getentityproperty(Plat, "x");
            Py = getentityproperty(Plat, "a");
            performattack(self, openborconstant("ANI_FOLLOW8"));
        }
    }
    

    /*
    if(Plat){
        if(aniID == openborconstant("ANI_FOLLOW8")){
            if(LeftR || LeftR){
                if(!LeftH && !RightH){
                    changeentityproperty(self, "velocity", 0, 0, 0);
                }
            }else if(Left){
                changeentityproperty(self, "velocity", -1, 0, 0);
                changeplayerproperty(self, "playkeys, 0);
                performattack(self, openborconstant("ANI_FOLLOW5"));
            }else if(Right){
                changeentityproperty(self, "velocity", 1, 0, 0);
                changeplayerproperty(self, "playkeys, 0);
                performattack(self, openborconstant("ANI_FOLLOW5"));
                }
            }
        }

        if(aniID == openborconstant("ANI_FOLLOW5")){
            if(LeftR || LeftR){
                if(!LeftH && !RightH){
                    changeentityproperty(self, "velocity", 0);
                    performattack(self, openborconstant("ANI_FOLLOW8"));
                }
            }
        }
    }
    */

    
    // Move around the ceiling
    if(aniID == openborconstant("ANI_FOLLOW8")){
        if(LeftR || RightR || DownR){
            if(!LeftH || !RightH || !DownH ){
                changeentityproperty(self, "velocity", 0, NULL(), NULL());
                //changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW8"));
            }
        }
        if(Left){
            changeentityproperty(self, "direction", 0);
            changeentityproperty(self, "velocity", -1.5, NULL(), NULL());
            changeplayerproperty(self, "playkeys", 0);
            changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW5"));
            //performattack(self, openborconstant("ANI_FOLLOW5"));
        }if(Right){
            changeentityproperty(self, "direction", 1);
            changeentityproperty(self, "velocity", 1.5, NULL(), NULL());
            changeplayerproperty(self, "playkeys", 0);
            changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW5"));
            //performattack(self, openborconstant("ANI_FOLLOW5"));
        }
        
        if(DownH && Jump){
            //tossentity(self, -1, 0, 0);
            performattack(self, openborconstant("ANI_FREESPECIAL4"));
            changeentityproperty(self, "subject_to_gravity", 1);
            changeentityproperty(self, "aiflag", "jumping", 1);
        }
        
    }
    

    
    if(aniID == openborconstant("ANI_FOLLOW5")){
        if(LeftR || RightR){
            if(!LeftH || !RightH){
                changeentityproperty(self, "velocity", 0, NULL(), NULL());
                changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW8"));
            }
        }
    }
    
}

wolvOnMoveA.c:
C:
void main(){
    void self = getlocalvar("self");
    void ani = getentityproperty(self, "animationid");
    int x = getentityproperty(self, "x");
    int y = getentityproperty(self, "y");
    int z = getentityproperty(self, "z");
    int Vy = getentityproperty(self, "tossv");
    void Plat = checkplatformabove(x, z, y);

    if(ani == openborconstant("ANI_FOLLOW8") && Plat ){
        changeentityproperty(self, "velocity", 0, 0, 0);
        //changeentityproperty(self, "y", y+20);
    }
}

onBlockPScript.c:
C:
void main()
{
    void self = getlocalvar("self"); //Get calling entity.
    //int index = getentityproperty(self, "playerindex");
    //int up = playerkeys(index, 0, "moveup");
    //int right = playerkeys(index, 0, "moveright");
    //int left = playerkeys(index, 0, "moveleft");
    //int down = playerkeys(index, 0, "movedown");
    //int x = getentityproperty(self, "x);
    //int z = getentityproperty(self, "z");
    //int y = getentityproperty(self, "y");
    void platform = getlocalvar("platform"); //Get calling entity.
    //void aniID = getentityproperty(self, "animationid");
    float selfH = getentityproperty(self,"y")+getentityproperty(self,"height"); //get player height
    float platformH = getentityproperty(platform,"y")+getentityproperty(platform,"height"); //get platform height

    float hang = platformH - getentityproperty(self,"aggression");

    //float H = checkplatformbelow(x, z, y);

    if(selfH > platformH &&  getentityproperty(self, "animationid")==openborconstant("ANI_JUMP"))
    {
        changeentityproperty(self, "velocity", 0, 0, 0); //Stop momentum!
        changeentityproperty(self, "antigravity", 1);//stop falling
        changeentityproperty(self, "y",hang); //change altitude to match platform
        changeentityproperty(self, "animation", openborconstant("ANI_freespecial3"));
    }
}

I will ask about climbing on walls later. For now, my issue is the ceiling.
 
You know,maxman, I think this kind of problem is best shown with small demo. Even if all of quoted scripts are working, it's hard to tell the issue without the level.
 
The keyscript from anim follow8 looks like it's working well, but the weird thing is that I cannot press left. The build I'm using is build 7142, according to the log.

Code:
settime 0
# Load images
#bglayer    data/bgs/climbtest/wall.gif
panel    data/bgs/climbtest/wall.gif
direction both
order a

wall 0 216 -5 -5 93 93 10 128
#wall 416 216 0 0 104 104 10 132
wall 396 216 0 0 104 104 10 132

#scrollx 0 1000
#at 0

group 100 100
at 0

#scrollx 0 5000
#at 0

spawn    ene
#@script
void main(){
  settextobj(0, 130 , 140 , 2, -1, "WALL");
}
@end_script
coords    0 216
at    0

#spawn platform1
#coords 0 216 131
#at 0

#group 1 1
#at 0

spawn    plat1
coords    192 216 92
at 0

spawn    plat2
coords    574 216 24
at    0

spawn    plat3
coords    690 216 69
at    0

spawn    plat4
coords    825 216 100
at    0

#spawn platform2
#coords 203 216 131
#at 0

spawn    ene
coords    100 216
at    0

Four platforms and one empty enemy type entity.

Code:
name plat1
type none
shadow 0
antigravity 100
height 93

anim idle

    delay 100
    offset 0 0
    platform 0 0 0 0 111 111 10 93
    frame data/chars/misc/empty.gif

Code:
name plat2
type none
shadow 0
antigravity 100

anim idle
    delay 100
    offset 0 0
    platform 0 0 0 0 100 100 10 29
    frame data/chars/misc/empty.gif

Code:
name plat3
type none
shadow 0
antigravity 100

anim idle

    delay 100
    offset 0 0
    platform 0 0 0 0 114 114 10 29
    frame data/chars/misc/empty.gif

Code:
name plat4
type none
shadow 0
antigravity 100

anim idle

    delay 100
    offset 0 0
    platform 0 0 0 0 127 127 10 34
    frame data/chars/misc/empty.gif

Code:
name    ene
health    110
speed 0
type    enemy
shadow    0
icon    data/chars/misc/empty.gif
nomove 1

anim idle
coords 0 0
delay 0
frame    data/chars/misc/empty.gif

I'll show a video of it of what I mean when I come back.

Here is the problem.


The look of the keyscript looks like it's working but I cannot press or hold left if you watch the video.
 

Attachments

  • bor - 0000.png
    bor - 0000.png
    3.1 KB · Views: 1
Last edited:
Sadly, having else if condition with the Right key results him moving left instead. I cannot make him move right and press left key at all.

C:
    // Move around the ceiling
    if(aniID == openborconstant("ANI_FOLLOW8")){
        if(LeftR || RightR || DownR){
            if(!LeftH || !RightH || !DownH ){
                changeentityproperty(self, "velocity", 0, NULL(), NULL());
                //changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW8"));
            }
        }

        if(Left){
            changeentityproperty(self, "direction", 0);
            changeentityproperty(self, "velocity", -1.5, NULL(), NULL());
            changeplayerproperty(self, "playkeys", 0);
            changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW5"));
            //performattack(self, openborconstant("ANI_FOLLOW5"));
        }
        else if(Right){
            changeentityproperty(self, "direction", 1);
            changeentityproperty(self, "velocity", 1.5, NULL(), NULL());
            changeplayerproperty(self, "playkeys", 0);
            changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW5"));
            //performattack(self, openborconstant("ANI_FOLLOW5"));
        }
        
        if(DownH && Jump){
            //tossentity(self, -1, 0, 0);
            performattack(self, openborconstant("ANI_FREESPECIAL4"));
            changeentityproperty(self, "subject_to_gravity", 1);
            changeentityproperty(self, "aiflag", "jumping", 1);
        }
        
    }

Is there something wrong with the key input? I already have checkplatformabove in check, but I don't know how to detect the platform's ground altitude on air between that and the character's top of his head within Y axis.
 
Why don't you try to make something like this as you could see in second 38
. My solution to make Pimple could climb the fence was to set an entity (two in reality, I'll explain late) at the foot of the fence that hits you without reaction. At it's place, this entity give a weapon (in this case Pimple climb) and you can move as you can see. By the way, when you going down there's another entity that hits you again, returning Pimple to it's normal state (without any weapon). If you look well in the video I share, it's shown the exactly moment when happen because I let visible those entities names as Weapcon and Weapsin... Forgive me if I'm anoying, I'd just like to share my way to find out any solution for those Who don't know to make scripts but keep trying to solve it's troubles someother way. Hope this be helpful in this case or maybe other time. Greetings.
 
  • Like
Reactions: NED
Why don't you try to make something like this as you could see in second 38
. My solution to make Pimple could climb the fence was to set an entity (two in reality, I'll explain late) at the foot of the fence that hits you without reaction. At it's place, this entity give a weapon (in this case Pimple climb) and you can move as you can see. By the way, when you going down there's another entity that hits you again, returning Pimple to it's normal state (without any weapon). If you look well in the video I share, it's shown the exactly moment when happen because I let visible those entities names as Weapcon and Weapsin... Forgive me if I'm anoying, I'd just like to share my way to find out any solution for those Who don't know to make scripts but keep trying to solve it's troubles someother way. Hope this be helpful in this case or maybe other time. Greetings.

You're not annoying anyone @Cachito, so don't worry about that. However, we generally try to discourage "anti-script" alternatives. OpenBOR didn't always have script, and we used techniques like this for a very long time. We called them Hackarounds. The problem is they are not fully stable, and tend to have unwanted side effects.

Example: What happens when you want to climb a ladder AND carry a weapon. Are you going to make weapon models for every possible combination? That's just one of many issues that can come from your method. If something can be done well without script, that's the solution we offer. When we offer a scripted solution instead, it's because we already know about the hackaround version and realized it wasn't the best idea. You aren't making things easier by avoiding script. Quite the opposite. You are giving yourself (and possibly others) more work for less benefit.

@maxman,

The first thing you are doing wrong is using individual key variables. Please have another look at my recent tutorials on keyscripts. You can (and should) use bitwise logic to check your active keys. This will help simplify the code and weed out the bugs. I will try to take a closer look soon.

DC
 
You're not annoying anyone @Cachito, so don't worry about that. However, we generally try to discourage "anti-script" alternatives. OpenBOR didn't always have script, and we used techniques like this for a very long time. We called them Hackarounds. The problem is they are not fully stable, and tend to have unwanted side effects.

Example: What happens when you want to climb a ladder AND carry a weapon. Are you going to make weapon models for every possible combination? That's just one of many issues that can come from your method. If something can be done well without script, that's the solution we offer. When we offer a scripted solution instead, it's because we already know about the hackaround version and realized it wasn't the best idea. You aren't making things easier by avoiding script. Quite the opposite. You are giving yourself (and possibly others) more work for less benefit.

@maxman,

The first thing you are doing wrong is using individual key variables.ease have another look at my recent tutorials on keyscripts. You can (and should) use bitwise logic to check your active keys. This will help simplify the code and weed out the bugs. I will try to take a closer look soon.

DC
OK. I'm just begining and this is my first mod. Don't know if will be another one. Also don't know if gonna learn about scripts and just enjoying making my own game. I'll just step aside and limit myself to share my mod. Greetings and good luck to @maxman on his quest.
 
OK. I'm just begining and this is my first mod. Don't know if will be another one. Also don't know if gonna learn about scripts and just enjoying making my own game. I'll just step aside and limit myself to share my mod. Greetings and good luck to @maxman on his quest.

@Cachito

No need to step aside as you put it. Just let us help you and trust our experience. Next time you're needing to do something complex or you are unsure about a trick, let us know and we might be able to save you a lot of time getting it going. The whole point of this forum is to pass on knowledge to help you create. :)

DC
 
results him moving left instead.

Let me get this right, if you press Left, Wolvie will move left but if you press right, he moves left?

I cannot make him move right and press left key at all.

What do you mean? you want to move right while pressing left key?

I've attempted something similar before with Spiderman and I used functions to allow him to move left or right while sticking on ceiling. It's hard to tell the system in detail but it's similar to Billy's climb ladder from Double Dragon Mini.
 
Last edited:
Let me get this right, if you press Left, Wolvie will move left but if you press right, he moves left?
What do you mean? you want to move right while pressing left key?
No. What I mean is this. When I press right key, he moves only left. But when I press left key, he doesn't move at all.

With else if condition set for Right key, he only moves left. If I revert back to the if condition for the Right key, he moves right side, but I cannot move left side with Left key.
 
Thanks DC (@DCurrent)! The bitwise logic works well as you said! But I'm still having trouble with the overhead hitting the bottom of the platform or the ceiling because he can grip without touching the ceiling OR by overreaching the ceiling which he can't move sometimes. Is it because the character has a height of 50 or something?

Here is my new keyscript.

wolvkey.c:
C:
void main(){
    ceilingGripping();
}

void ceilingGripping(){

    void target;        // Target entity for action.
    int player_index;   // Player index triggering event.
    void animation_ID;
    void direction;
    int x_coordinate;
    int y_coordinate;
    int z_coordinate;
    //int height;
    int frame;
    void PlatformCeiling;
    void ClimbWall;

    // Key status.
    int key_hold;
    int key_press;
    int key_release;
    int key_forward;

    // Get the player index and target entity.
    player_index    = getlocalvar("player");
    target          = getplayerproperty(player_index, "entity");     

    // Get action from target entity.
    animation_ID = getentityproperty(target, "animationid");
    direction = getentityproperty(target, "direction");
    x_coordinate = getentityproperty(target, "x");
    y_coordinate = getentityproperty(target, "y");
    z_coordinate = getentityproperty(target, "z");
    frame = getentityproperty(target, "animpos");

    PlatformCeiling = checkplatformabove(x_coordinate, z_coordinate, 0);
    ClimbWall = checkwall(0, z_coordinate, 0);

    // Get key hold status.
    key_hold    = getplayerproperty(player_index, "keys");
    key_press    = getplayerproperty(player_index, "newkeys");
    key_release    = getplayerproperty(player_index, "releasekeys");

    if(PlatformCeiling && key_hold & openborconstant("FLAG_MOVEUP")){ // CEILING CLIMB/GRIP?

        if(animation_ID == openborconstant("ani_jump")){
            changeentityproperty(target, "subject_to_gravity", 0);
            changeentityproperty(target, "aiflag", "jumping", 0);
            //Length = getentityproperty(PlatformCeiling, "antigrab");
            //Px = getentityproperty(PlatformCeiling, "x");
            //Py = getentityproperty(PlatformCeiling, "a");
            performattack(target, openborconstant("ANI_FOLLOW8"));
        }

    }

  
    if(ClimbWall){ // WALL CLIMB?

        if( (key_hold & openborconstant("FLAG_MOVERIGHT") && direction == openborconstant("DIRECTION_RIGHT")) || (key_hold & openborconstant("FLAG_MOVELEFT") && direction == openborconstant("DIRECTION_LEFT")) ){

            if(animation_ID == openborconstant("ani_jump") || animation_ID == openborconstant("ani_walk") ){
                changeentityproperty(target, "subject_to_gravity", 0);
                changeentityproperty(target, "aiflag", "jumping", 0);
                performattack(target, openborconstant("ANI_FOLLOW4"));
            }

        }

    }
  

  
    if(animation_ID == openborconstant("ani_follow4")){ // STICKING TO WALL?

        if(key_hold & openborconstant("FLAG_MOVEUP")){
            changeentityproperty(target, "velocity", 0, 0, 1);
            performattack(target, openborconstant("ani_follow1"));
        }

        if(key_hold & openborconstant("FLAG_MOVEDOWN")){
            changeentityproperty(target, "velocity", 0, 0, -1);
            performattack(target, openborconstant("ani_follow2"));
        }
    }
  

    if(animation_ID == openborconstant("ani_follow8")){ // STICKING TO CEILING?

        if(key_hold & openborconstant("FLAG_MOVELEFT")){
            changeentityproperty(target, "direction", 0);
            changeentityproperty(target, "velocity", -1, 0, 0);
            performattack(target, openborconstant("ani_follow5"));
        }

        if(key_hold & openborconstant("FLAG_MOVERIGHT")){
            changeentityproperty(target, "direction", 1);
            changeentityproperty(target, "velocity", 1, 0, 0);
            performattack(target, openborconstant("ani_follow5"));      
        }

        if(key_hold & openborconstant("FLAG_MOVELEFT") && direction == openborconstant("DIRECTION_RIGHT")){
            changeentityproperty(target, "direction", 0);
            changeentityproperty(target, "x", x_coordinate-7);
            changeentityproperty(target, "velocity", -1, 0, 0);
            performattack(target, openborconstant("ani_follow5"));
        }

        if(key_hold & openborconstant("FLAG_MOVERIGHT") && direction == openborconstant("DIRECTION_LEFT")){
            changeentityproperty(target, "direction", 1);
            changeentityproperty(target, "x", x_coordinate+7);
            changeentityproperty(target, "velocity", 1, 0, 0);
            performattack(target, openborconstant("ani_follow5"));
        }

        if(key_hold & openborconstant("FLAG_MOVEDOWN") && key_press & openborconstant("FLAG_JUMP")){

            performattack(target, openborconstant("ANI_FREESPECIAL4"));  
            changeentityproperty(target, "subject_to_gravity", 1);
            changeentityproperty(target, "aiflag", "jumping", 1);

        }
    }

    if(animation_ID == openborconstant("ani_follow5")){ // JUMP OFF FROM CEILING?
        changeentityproperty(target, "velocity", 0, 0, 0);
        performattack(target, openborconstant("ANI_FOLLOW8"));
        updateframe(target, 2);
    }

}

If you look at the code of the wall platform, I'm also having trouble climbing up or down when interacting with walls for climbing vertically. Whether I jump or walk to it, I can't have him perform the climb part.

Code:
anim follow1 # Climbing up
    delay    1
    offset 76 106
    loop 1 1
    frame    data/chars/logan/climb/cv1.png
    delay    6
    frame    data/chars/logan/climb/cv1.png
    frame    data/chars/logan/climb/cv2.png
    frame    data/chars/logan/climb/cv3.png
    frame    data/chars/logan/climb/cv4.png
    frame    data/chars/logan/climb/cv5.png
    frame    data/chars/logan/climb/cv6.png

anim follow2 # Climbing down
    delay    1
    offset 76 106
    loop 1 1
    frame    data/chars/logan/climb/cv6.png
    delay    6
    frame    data/chars/logan/climb/cv6.png
    frame    data/chars/logan/climb/cv5.png
    frame    data/chars/logan/climb/cv4.png
    frame    data/chars/logan/climb/cv3.png
    frame    data/chars/logan/climb/cv2.png
    frame    data/chars/logan/climb/cv1.png

There's something I forgot about. If I want to reach the edge of the ceiling or the bottom platform, how can I make him jump off from it after passing by the end of it?
 
Last edited:
Whether I jump or walk to it, I can't have him perform the climb part.

Hmmm.... maybe you should check onblockwscript to see if Wolvie would climb wall if he's blocked by a wall when jumping or walking toward a wall.

If I want to reach the edge of the ceiling or the bottom platform, how can I make him jump off from it after passing by the end of it?

The challenge is to know when you've reached the edge. 2D platforms in my 2D games have antigrab and grabforce defining their length and width respectively. With their offset defined at the center of the platform, I could measure entity's distance from platform's edge. You should do the same :).
 
@Cachito It sounds like a very good idea when it comes to no doing script especially when I use some older versions because there are new script functions that other older versions cannot understand depending on their availability and their existence before other updated builds released.

Hmmm.... maybe you should check onblockwscript to see if Wolvie would climb wall if he's blocked by a wall when jumping or walking toward a wall.
The challenge is to know when you've reached the edge. 2D platforms in my 2D games have antigrab and grabforce defining their length and width respectively. With their offset defined at the center of the platform, I could measure entity's distance from platform's edge. You should do the same :).
Do you have any example for the climb-off drop after surpassing the edge of the platform?

And how about Beast flipping/jumping to the ceiling but goes upside down with his anim idle? I wonder if using normal anim walk on the ceiling is possible.
 
I made a new onblockPscript and added Length as antigrab property here, but I can't seem to have him jump off the ceiling. What did I do wrong?

platform.c:
C:
void main(){
    plataforma();
}

void plataforma(){

    int index = getlocalvar("player");
    int entity = getplayerproperty(index, "entity");
    void aniID = getentityproperty(entity, "animationid");
    void dir = getentityproperty(entity, "direction");
    int x = getentityproperty(entity, "x");
    int z = getentityproperty(entity, "z");
    int y = getentityproperty(entity, "y");

    void Climb;
    void Ceiling;

    void Length;
    void Width;
    int Px; void PlatA; void PlatB; //int Wall;

    int key_hold = getplayerproperty(index, "keys");
    int key_press = getplayerproperty(index, "newkeys");
    int key_release = getplayerproperty(index, "releasekeys");

    Ceiling = checkplatformabove(x, z, y-2);
    //Climb = checkplatformbetween(x, z, y);

    if(Ceiling && key_hold & openborconstant("FLAG_MOVEUP")){
        changeentityproperty(entity, "subject_to_gravity", 0);
        changeentityproperty(entity, "aiflag", "jumping", 0);
        performattack(entity, openborconstant("ANI_FOLLOW8"));
    }

    if(aniID == openborconstant("ANI_FOLLOW8")){

        Length = getentityproperty(Ceiling, "antigrab");
        Px = getentityproperty(Ceiling, "x");

        if(dir == openborconstant("DIRECTION_RIGHT")){
            PlatA = checkplatformabove(x+24, z, y-2);
            PlatB = checkplatformabove(x+24, z, y+2);
        }else{
            PlatA = checkplatformabove(x-24, z, y-2);
            PlatB = checkplatformabove(x-24, z, y+2);
        }

        if(x >= Px + Length/2 - 23 && PlatA == PlatB){
            performattack(entity, openborconstant("ANI_WALKOFF"));
            changeentityproperty(entity, "velocity", 1, 0, 0);
            changeentityproperty(entity, "subject_to_gravity", 1);
            changeentityproperty(entity, "aiflag", "jumping", 1);
        }else if(x <= Px - Length/2 + 23 && PlatA == PlatB){
            performattack(entity, openborconstant("ANI_WALKOFF"));
            changeentityproperty(entity, "velocity", -1, 0, 0);
            changeentityproperty(entity, "subject_to_gravity", 1);
            changeentityproperty(entity, "aiflag", "jumping", 1);
        }

        if(key_hold & openborconstant("FLAG_MOVELEFT")){
            changeentityproperty(entity, "direction", 0);
            changeentityproperty(entity, "velocity", -1, 0, 0);
            performattack(entity, openborconstant("ani_follow5"));
        }

        if(key_hold & openborconstant("FLAG_MOVERIGHT")){
            changeentityproperty(entity, "direction", 1);
            changeentityproperty(entity, "velocity", 1, 0, 0);
            performattack(entity, openborconstant("ani_follow5"));        
        }

        if(key_hold & openborconstant("FLAG_MOVELEFT") && dir == openborconstant("DIRECTION_RIGHT")){
            changeentityproperty(entity, "direction", 0);
            changeentityproperty(entity, "x", x-7);
            changeentityproperty(entity, "velocity", -1, 0, 0);
            performattack(entity, openborconstant("ani_follow5"));
        }

        if(key_hold & openborconstant("FLAG_MOVERIGHT") && dir == openborconstant("DIRECTION_LEFT")){
            changeentityproperty(entity, "direction", 1);
            changeentityproperty(entity, "x", x+7);
            changeentityproperty(entity, "velocity", 1, 0, 0);
            performattack(entity, openborconstant("ani_follow5"));
        }

        if(key_hold & openborconstant("FLAG_MOVEDOWN") && key_press & openborconstant("FLAG_JUMP")){

            performattack(entity, openborconstant("ANI_FREESPECIAL4"));    
            changeentityproperty(entity, "subject_to_gravity", 1);
            changeentityproperty(entity, "aiflag", "jumping", 1);

        }
    }


}

I'll do the climbing on both walls and entity platforms later.
 
Sweet! I think you only showed me the video and explained to me that walls and ceilings are enemy type instead of none type, but there's no need to use script for it. Problem for me is the lack of example(s). However, I'm looking forward to the upload whether there's script or not. Thank you very much.

EDIT:
Sweet! Thanks for the upload! I'm gonna check it out myself.
 
Last edited:
This is way harder than I expected. I'm trying to transfer those scripts with entityvars from an animation script to an onblockA script. It's for reaching the edge of the bottom platform (especially ceiling) so he jumps off of it after passing it by. I found out that onblockascript works when jumping to the platform overhead like the manual says. How can I translate it into a non-animation script?

This one is animation script:
Code:
void crawlHEnd(int dx, int dy, void Key, int Dist)
{// Ends ceiling crawl animation
// dx = distance from ceiling after ending
// dy = distance from ceiling after ending
// Key = Climbing flag, "F" = Forward and "B" = Back
// Dist = Max distance before ending
    void self = getlocalvar("self");
    int x = getentityproperty(self, "x");
    int y = getentityproperty(self, "y");
    int dir = getentityproperty(self,"direction");
    int CType = getentityvar(self, 1);
    int Plat = getentityvar(self, 2);
    int LCent; int LWidth; char Ch1 = "F"; char Ch2 = "B";

    if(CType == "P"){
      LCent = getentityproperty(Plat, "x");
      LWidth = getentityproperty(Plat, "antigrab");
    }

    if(dir==0){ //facing left?
      dx = -dx;
      Ch1 = "B";
      Ch2 = "F";
    }

    if(Key==Ch1 && x + Dist >= LCent + LWidth*0.5){ //Reached front limit
      dasher(0,0,0);

      changeentityproperty(self, "Subject_to_gravity", 1);
      changeentityproperty(self, "position", x + dx, NULL(), y + dy);

      changeentityproperty(self, "aiflag", "attacking", 0); // Disable attacking status
      changeentityproperty(self, "aiflag", "jumping", 1); // Enable jumping status

      changeentityproperty(self, "takeaction", "common_jump");
      changeentityproperty(self, "animation", openborconstant("ANI_JUMP"),2);
    } else if(Key==Ch2 && x - Dist <= LCent - LWidth*0.5){ //Reached back limit
      dasher(0,0,0);

      changeentityproperty(self, "Subject_to_gravity", 1);
      changeentityproperty(self, "position", x - dx, NULL(), y + dy);

      changeentityproperty(self, "aiflag", "attacking", 0); // Disable attacking status
      changeentityproperty(self, "aiflag", "jumping", 1); // Enable jumping status

      changeentityproperty(self, "takeaction", "common_jump");
      changeentityproperty(self, "animation", openborconstant("ANI_JUMP"),2);
    }
}

I'm having trouble with variables of x distance (dx) for velocity or position value. I want the character to move forward while he's under the bottom platform and I'm using onBlockAScript for jumping overhead to the platform this time. It works when he sticks to that.

climbA.c (on block A script):
C:
void main(){
    climbAltitude();
}

void climbAltitude(){
    int index = getlocalvar("player");
    void self = getplayerproperty(index, "entity");
    void aniID = getentityproperty(self, "animationid");
    void platform = getlocalvar("platform");
    int x = getentityproperty(self, "x");
    int z = getentityproperty(self, "z");
    int y = getentityproperty(self, "y");
    int height = getentityproperty(self, "height");
    void dir = getentityproperty(self, "direction");
    int platformH = getentityproperty(platform, "height");
    
    void PlatAbove = checkplatformbelow(x, z, y+95);
    //void Plat = checkplatformbetween(x, z, y, y+height);
    int antiGrab = getentityproperty(PlatAbove, "antigrab");

    int hold = getplayerproperty(index, "keys");
    int press = getplayerproperty(index, "newkeys");
    //int release = getplayerproperty(index, "releasekeys");

    int UpH = playerkeys(index, 0, "moveup");
    int DownH = playerkeys(index, 0, "movedown");
    int RightH = playerkeys(index, 0, "moveright");
    int LeftH = playerkeys(index, 0, "moveleft");
    int Right = playerkeys(index, 1, "moveright");
    int Left = playerkeys(index, 1, "moveleft");
    int Jump = playerkeys(index, 1, "jump");

    int CType = getentityvar(self, 1);
    int Plat = getentityvar(self, 2);

    int LCent; int LWidth; //char Ch1 = "L"; char Ch2 = "R";

    if(CType == platform){
        
    }

    if(dir == 0){
        int dx = -dx;
    }

    if(antiGrab && UpH && aniID == openborconstant("ANI_JUMP")){
        changeentityproperty(self, "subject_to_gravity", 0);
        changeentityproperty(self, "aiflag", "jumping", 0);
        performattack(self, openborconstant("ANI_FOLLOW2"));
    }

    if(antiGrab && aniID == openborconstant("ANI_FOLLOW2")){
        if(DownH && Jump){
            changeentityproperty(self, "subject_to_gravity", 1);
            changeentityproperty(self, "aiflag", "jumping", 1);
            performattack(self, openborconstant("ANI_FOLLOW8"));
        }else if(Left){
            //changeentityproperty(self, "velocity", -1, 0, 0);
            changeentityproperty(self, "direction", 0);
            changeentityproperty(self, "position", x - dx);
            performattack(self, openborconstant("ANI_FOLLOW3"));
        }else if(Right){
            //changeentityproperty(self, "velocity", 1, 0, 0);
            changeentityproperty(self, "position", x + dx);
            changeentityproperty(self, "direction", 1);
            performattack(self, openborconstant("ANI_FOLLOW3"));
        }
    }

}

climbKey (keyscript):
C:
void main(){
    climbKey();
}

void climbKey(){

    //keyDelay();


    void target;        // Target entity for action.
    int player_index;   // Player index triggering event.
    void animation_ID;
    void direction;
    int x_coordinate;
    int y_coordinate;
    int z_coordinate;
    //int height;
    int frame;
    void PlatformCeiling;
    void ClimbWall;

    // Key status.
    int key_hold;
    int key_press;
    int key_release;
    int key_forward;

    // Get the player index and target entity.
    //player_index    = getlocalvar("player");
    //target          = getplayerproperty(player_index, "entity");

    void target = getlocalvar("self");
    int player_index = getentityproperty(target, "playerindex");

    int UpH = playerkeys(player_index, 0, "moveup");
    int DownH = playerkeys(player_index, 0, "movedown");
    int LeftH = playerkeys(player_index, 0, "moveleft");
    int RightH = playerkeys(player_index, 0, "moveright");

    int Up = playerkeys(player_index, 1, "moveup");
    int Down = playerkeys(player_index, 1, "movedown");
    int Left = playerkeys(player_index, 1, "moveleft");
    int Right = playerkeys(player_index, 1, "moveright");

    int UpR = playerkeys(player_index, 2, "moveup");
    int DownR = playerkeys(player_index, 2, "movedown");
    int LeftR = playerkeys(player_index, 2, "moveleft");
    int RightR = playerkeys(player_index, 2, "moveright");

    int Jump = playerkeys(player_index, 1, "jump");

    int Plat = getlocalvar("platform");

    // Get action from target entity.
    animation_ID = getentityproperty(target, "animationid");
    void direction = getentityproperty(target, "direction");
    int x_coordinate = getentityproperty(target, "x");
    int y_coordinate = getentityproperty(target, "y");
    int z_coordinate = getentityproperty(target, "z");
    int frame = getentityproperty(target, "animpos");

    PlatformCeiling = checkplatformbelow(x_coordinate, z_coordinate, 0);
    //ClimbWall = checkwall(0, z_coordinate, 0);

    // Get key hold status.
    key_hold    = getplayerproperty(player_index, "keys");
    key_press    = getplayerproperty(player_index, "newkeys");
    //key_release    = getplayerproperty(player_index, "releasekeys");

    /*if(key_hold & openborconstant("FLAG_MOVEUP") && animation_ID == openborconstant("ani_jump")){ // GRIP TO CEILING

            changeentityproperty(target, "subject_to_gravity", 0);
            changeentityproperty(target, "aiflag", "jumping", 0);
            //Length = getentityproperty(PlatformCeiling, "antigrab");
            //Px = getentityproperty(PlatformCeiling, "x");
            //Py = getentityproperty(PlatformCeiling, "a");
            performattack(target, openborconstant("ANI_FOLLOW2"));

    }*/

    /*if(UpH && animation_ID == openborconstant("ani_jump")){
        changeentityproperty(target, "subject_to_gravity", 0);
        changeentityproperty(target, "aiflag", "jumping", 0);
        //Length = getentityproperty(PlatformCeiling, "antigrab");
        //Px = getentityproperty(PlatformCeiling, "x");
        //Py = getentityproperty(PlatformCeiling, "a");
        performattack(target, openborconstant("ANI_FOLLOW2"));
    }*/

    
    /*if(ClimbWall){ // WALL CLIMB?

        if( (key_hold & openborconstant("FLAG_MOVERIGHT") && direction == openborconstant("DIRECTION_RIGHT")) || (key_hold & openborconstant("FLAG_MOVELEFT") && direction == openborconstant("DIRECTION_LEFT")) ){

            if(animation_ID == openborconstant("ani_jump") || animation_ID == openborconstant("ani_walk") ){
                changeentityproperty(target, "subject_to_gravity", 0);
                changeentityproperty(target, "aiflag", "jumping", 0);
                performattack(target, openborconstant("ANI_FOLLOW4"));
            }

        }

    }*/
    

    
    /*if(animation_ID == openborconstant("ani_follow4")){ // STICKING TO WALL?

        if(key_hold & openborconstant("FLAG_MOVEUP")){
            changeentityproperty(target, "velocity", 0, 0, 1);
            performattack(target, openborconstant("ani_follow5"));
        }

        if(key_hold & openborconstant("FLAG_MOVEDOWN")){
            changeentityproperty(target, "velocity", 0, 0, -1);
            performattack(target, openborconstant("ani_follow6"));
        }
    }*/
    

    if(animation_ID == openborconstant("ani_follow2")){ // STICKING TO CEILING?

        if(key_hold & openborconstant("FLAG_MOVELEFT")){ // Hold left?
            changeentityproperty(target, "direction", 0);
            changeentityproperty(target, "velocity",  -1, 0, 0);
            //changeentityproperty(target, "position", x_coordinate-7);
            performattack(target, openborconstant("ani_follow3"));
        }

        if(key_hold & openborconstant("FLAG_MOVERIGHT")){ // Hold right?
            changeentityproperty(target, "direction", 1);
            changeentityproperty(target, "velocity", 1, 0, 0);
            //changeentityproperty(target, "position", x_coordinate+7);
            performattack(target, openborconstant("ani_follow3"));        
        }

        if(key_hold & openborconstant("FLAG_MOVELEFT") && direction == 1){ // Hold left while facing right?
            changeentityproperty(target, "direction", 0);
            changeentityproperty(target, "position", x_coordinate-7);
            //changeentityproperty(target, "velocity", -1, 0, 0);
            performattack(target, openborconstant("ani_follow3"));
        }

        if(key_hold & openborconstant("FLAG_MOVERIGHT") && direction == 0){ // Hold right while facing left?
            changeentityproperty(target, "direction", 1);
            changeentityproperty(target, "position", x_coordinate+7);
            //changeentityproperty(target, "velocity", 1, 0, 0);
            performattack(target, openborconstant("ani_follow3"));
        }

        if(key_hold & openborconstant("FLAG_MOVEDOWN") && key_press & openborconstant("FLAG_JUMP")){

            performattack(target, openborconstant("ANI_FREESPECIAL4"));    
            changeentityproperty(target, "subject_to_gravity", 1);
            changeentityproperty(target, "aiflag", "jumping", 1);

        }
    }

    /*if(animation_ID == openborconstant("ani_follow2")){
        if(LeftR || RightR){
            if(!LeftH || !RightH){
                changeentityproperty(target, "velocity", 0, 0, 0);
            }
        }if(Left){
            changeentityproperty(target, "direction", 0);
            changeentityproperty(target, "velocity", -1.5, 0, 0);
            changeentityproperty(target, "animation", openborconstant("ANI_FOLLOW3"));
        }
        if(Right){
            changeentityproperty(target, "direction", 1);
            changeentityproperty(target, "velocity", 1.5, 0, 0);
            changeentityproperty(target, "animation", openborconstant("ANI_FOLLOW3"));
        }
    }*/

    if(animation_ID == openborconstant("ani_follow3")){ // CLIMBING ON CEILING
        if(LeftR || RightR){
            if(!LeftH || !RightH){
                changeentityproperty(target, "velocity", 0, 0, 0);
                performattack(target, openborconstant("ANI_FOLLOW2"));
                updateframe(target, 2);
            }
        }
    }

    /*
    if(animation_ID == openborconstant("ANI_FOLLOW8")){
        
    }
    */

}




void flip()
{// Flip to opposite direction
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

    if(dir==0){ // Facing left?
      changeentityproperty(self, "direction", 1);
    } else {
      changeentityproperty(self, "direction", 0);
    }
}


void keyDelay()
{//Activate delay counter when a defined key is held for further use
    void self     = getlocalvar("self");
    void key    = "jump"; //THIS IS THE DESIRED KEY THAT THE SCRIPT WILL WORK ON
    int iPIndex = getentityproperty(self, "playerindex");
    float delay    = 50; //THIS IS THE MAXIMUM DESIRED DELAY TO DEFINE IF A BUTTON IS HELD OR SINGLE PRESSED
    
    if(playerkeys(iPIndex, 0, key)){ //DEFINED KEY IS HELD??
        setglobalvar("keyDelay"+self, openborvariant("elapsed_time")+delay); //START DELAY COUNTER AND SAVE IN A VARIABLE
    }
}
 
I'm using build 4153 with its compiled date from April 22, 2015. It does not recognize the "releasekeys" player property at all. But "keys" and "newkeys" are recognized.


I tried forcing the player to move forward, but the key script doesn't do it with "velocity" and/or "position" entity properties.

climbKey.c:
C:
void main(){
    climbKey();
}

void climbKey(){

    //keyDelay();


    void target;        // Target entity for action.
    int player_index;   // Player index triggering event.
    void animation_ID;
    void direction;
    int x_coordinate;
    int y_coordinate;
    int z_coordinate;
    //int height;
    int frame;
    void PlatformCeiling;
    void ClimbWall;

    // Key status.
    int key_hold;
    int key_press;
    int key_release;
    int key_forward;

    // Get the player index and target entity.
    //player_index    = getlocalvar("player");
    //target          = getplayerproperty(player_index, "entity");

    void target = getlocalvar("self");
    int player_index = getentityproperty(target, "playerindex");

    int UpH = playerkeys(player_index, 0, "moveup");
    int DownH = playerkeys(player_index, 0, "movedown");
    int LeftH = playerkeys(player_index, 0, "moveleft");
    int RightH = playerkeys(player_index, 0, "moveright");

    int Up = playerkeys(player_index, 1, "moveup");
    int Down = playerkeys(player_index, 1, "movedown");
    int Left = playerkeys(player_index, 1, "moveleft");
    int Right = playerkeys(player_index, 1, "moveright");

    int UpR = playerkeys(player_index, 2, "moveup");
    int DownR = playerkeys(player_index, 2, "movedown");
    int LeftR = playerkeys(player_index, 2, "moveleft");
    int RightR = playerkeys(player_index, 2, "moveright");

    int Jump = playerkeys(player_index, 1, "jump");

    int Plat = getlocalvar("platform");

    // Get action from target entity.
    animation_ID = getentityproperty(target, "animationid");
    void direction = getentityproperty(target, "direction");
    int x_coordinate = getentityproperty(target, "x");
    int y_coordinate = getentityproperty(target, "y");
    int z_coordinate = getentityproperty(target, "z");
    int frame = getentityproperty(target, "animpos");

    PlatformCeiling = checkplatformbelow(x_coordinate, z_coordinate, 0);
    //ClimbWall = checkwall(0, z_coordinate, 0);

    // Get key hold status.
    key_hold    = getplayerproperty(player_index, "keys");
    key_press    = getplayerproperty(player_index, "newkeys");
    //key_release    = getplayerproperty(player_index, "releasekeys");

    /*if(key_hold & openborconstant("FLAG_MOVEUP") && animation_ID == openborconstant("ani_jump")){ // GRIP TO CEILING

            changeentityproperty(target, "subject_to_gravity", 0);
            changeentityproperty(target, "aiflag", "jumping", 0);
            //Length = getentityproperty(PlatformCeiling, "antigrab");
            //Px = getentityproperty(PlatformCeiling, "x");
            //Py = getentityproperty(PlatformCeiling, "a");
            performattack(target, openborconstant("ANI_FOLLOW2"));

    }*/

    /*if(UpH && animation_ID == openborconstant("ani_jump")){
        changeentityproperty(target, "subject_to_gravity", 0);
        changeentityproperty(target, "aiflag", "jumping", 0);
        //Length = getentityproperty(PlatformCeiling, "antigrab");
        //Px = getentityproperty(PlatformCeiling, "x");
        //Py = getentityproperty(PlatformCeiling, "a");
        performattack(target, openborconstant("ANI_FOLLOW2"));
    }*/

   
    /*if(ClimbWall){ // WALL CLIMB?

        if( (key_hold & openborconstant("FLAG_MOVERIGHT") && direction == openborconstant("DIRECTION_RIGHT")) || (key_hold & openborconstant("FLAG_MOVELEFT") && direction == openborconstant("DIRECTION_LEFT")) ){

            if(animation_ID == openborconstant("ani_jump") || animation_ID == openborconstant("ani_walk") ){
                changeentityproperty(target, "subject_to_gravity", 0);
                changeentityproperty(target, "aiflag", "jumping", 0);
                performattack(target, openborconstant("ANI_FOLLOW4"));
            }

        }

    }*/
   

   
    /*if(animation_ID == openborconstant("ani_follow4")){ // STICKING TO WALL?

        if(key_hold & openborconstant("FLAG_MOVEUP")){
            changeentityproperty(target, "velocity", 0, 0, 1);
            performattack(target, openborconstant("ani_follow5"));
        }

        if(key_hold & openborconstant("FLAG_MOVEDOWN")){
            changeentityproperty(target, "velocity", 0, 0, -1);
            performattack(target, openborconstant("ani_follow6"));
        }
    }*/
   

    if(animation_ID == openborconstant("ani_follow2")){ // STICKING TO CEILING?

        if(key_hold & openborconstant("FLAG_MOVELEFT")){ // Hold left?
            changeentityproperty(target, "direction", 0);
            changeentityproperty(target, "velocity",  -1, 0, 0);
            //changeentityproperty(target, "position", x_coordinate-7);
            performattack(target, openborconstant("ani_follow3"));
        }

        if(key_hold & openborconstant("FLAG_MOVERIGHT")){ // Hold right?
            changeentityproperty(target, "direction", 1);
            changeentityproperty(target, "velocity", 1, 0, 0);
            //changeentityproperty(target, "position", x_coordinate+7);
            performattack(target, openborconstant("ani_follow3"));       
        }

        if(key_hold & openborconstant("FLAG_MOVELEFT") && direction == 1){ // Hold left while facing right?
            changeentityproperty(target, "direction", 0);
            changeentityproperty(target, "position", x_coordinate-7);
            changeentityproperty(target, "velocity", -1, 0, 0);
            performattack(target, openborconstant("ani_follow3"));
        }

        if(key_hold & openborconstant("FLAG_MOVERIGHT") && direction == 0){ // Hold right while facing left?
            changeentityproperty(target, "direction", 1);
            changeentityproperty(target, "position", x_coordinate+7);
            //changeentityproperty(target, "velocity", 1, 0, 0);
            performattack(target, openborconstant("ani_follow3"));
        }

        if(key_hold & openborconstant("FLAG_MOVEDOWN") && key_press & openborconstant("FLAG_JUMP")){

            performattack(target, openborconstant("ANI_FREESPECIAL4"));   
            changeentityproperty(target, "subject_to_gravity", 1);
            changeentityproperty(target, "aiflag", "jumping", 1);

        }
    }

    /*if(animation_ID == openborconstant("ani_follow2")){
        if(LeftR || RightR){
            if(!LeftH || !RightH){
                changeentityproperty(target, "velocity", 0, 0, 0);
            }
        }if(LeftH){
            changeentityproperty(target, "direction", 0);
            changeentityproperty(target, "velocity", -1.5, 0, 0);
            changeentityproperty(target, "animation", openborconstant("ANI_FOLLOW3"));
        }
        if(RightH){
            changeentityproperty(target, "direction", 1);
            changeentityproperty(target, "velocity", 1.5, 0, 0);
            changeentityproperty(target, "animation", openborconstant("ANI_FOLLOW3"));
        }
    }*/

    if(animation_ID == openborconstant("ani_follow3")){ // CLIMBING ON CEILING
        if(LeftR || RightR){
            if(!LeftH || !RightH){
                changeentityproperty(target, "velocity", 0, 0, 0);
                performattack(target, openborconstant("ANI_FOLLOW2"));
                updateframe(target, 2);
            }
        }
    }

    /*
    if(animation_ID == openborconstant("ANI_FOLLOW8")){
       
    }
    */

}




void flip()
{// Flip to opposite direction
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

    if(dir==0){ // Facing left?
      changeentityproperty(self, "direction", 1);
    } else {
      changeentityproperty(self, "direction", 0);
    }
}


void keyDelay()
{//Activate delay counter when a defined key is held for further use
    void self     = getlocalvar("self");
    void key    = "jump"; //THIS IS THE DESIRED KEY THAT THE SCRIPT WILL WORK ON
    int iPIndex = getentityproperty(self, "playerindex");
    float delay    = 50; //THIS IS THE MAXIMUM DESIRED DELAY TO DEFINE IF A BUTTON IS HELD OR SINGLE PRESSED
   
    if(playerkeys(iPIndex, 0, key)){ //DEFINED KEY IS HELD??
        setglobalvar("keyDelay"+self, openborvariant("elapsed_time")+delay); //START DELAY COUNTER AND SAVE IN A VARIABLE
    }
}

climbA.c:
C:
void main(){
    climbAltitude();
}

void climbAltitude(){
    int index = getlocalvar("player");
    void self = getplayerproperty(index, "entity");
    void aniID = getentityproperty(self, "animationid");
    void platform = getlocalvar("platform");
    int x = getentityproperty(self, "x");
    int z = getentityproperty(self, "z");
    int y = getentityproperty(self, "y");
    int height = getentityproperty(self, "height");
    void dir = getentityproperty(self, "direction");
    int platformH = getentityproperty(platform, "height");
   
    void PlatAbove = checkplatformbelow(x, z, y+95);
    //void Plat = checkplatformbetween(x, z, y, y+height);
    int antiGrab = getentityproperty(PlatAbove, "antigrab");

    int hold = getplayerproperty(index, "keys");
    int press = getplayerproperty(index, "newkeys");
    //int release = getplayerproperty(index, "releasekeys");

    int UpH = playerkeys(index, 0, "moveup");
    int DownH = playerkeys(index, 0, "movedown");
    int RightH = playerkeys(index, 0, "moveright");
    int LeftH = playerkeys(index, 0, "moveleft");
    int Right = playerkeys(index, 1, "moveright");
    int Left = playerkeys(index, 1, "moveleft");
    int Jump = playerkeys(index, 1, "jump");

    int CType = getentityvar(self, 1);
    int Plat = getentityvar(self, 2);

    int LCent; int LWidth; //char Ch1 = "L"; char Ch2 = "R";

    if(CType == platform){
       
    }

    int dx;

    if(dir == 1){
        dx = 1;
    }else{
        dx = -1;
    }

    if(UpH && aniID == openborconstant("ANI_JUMP")){
        changeentityproperty(self, "subject_to_gravity", 0);
        changeentityproperty(self, "aiflag", "jumping", 0);
        performattack(self, openborconstant("ANI_FOLLOW2"));
    }

    if(antiGrab && aniID == openborconstant("ANI_FOLLOW2")){
        if(DownH && Jump){
        //if(hold & openborconstant("FLAG_MOVEDOWN") && press & openborconstant("FLAG_JUMP")){
            changeentityproperty(self, "subject_to_gravity", 1);
            changeentityproperty(self, "aiflag", "jumping", 1);
            performattack(self, openborconstant("ANI_FOLLOW8"));
        }else if(LeftH){
            //changeentityproperty(self, "velocity", -1, 0, 0);
            changeentityproperty(self, "direction", 0);
            changeentityproperty(self, "position", x - dx);
            performattack(self, openborconstant("ANI_FOLLOW3"));
        }else if(RightH){
            //changeentityproperty(self, "velocity", 1, 0, 0);
            changeentityproperty(self, "position", x + dx);
            changeentityproperty(self, "direction", 1);
            performattack(self, openborconstant("ANI_FOLLOW3"));
        }//else if(){
        //}else if(){
        //}
    }

    //if(aniID == openborconstant("ANI_FOLLOW3")){
    //    if(){
    //    }
    //}

    /*
   
    */

}

climbPlat.c:
C:
void main(){
    ceiling();
    //walls();
}

void ceiling(){
    void self = getlocalvar("self");
    void aniID = getentityproperty(self, "animationid");
    int index = getentityproperty(self, "playerindex");
    int x = getentityproperty(self, "x");
    int z = getentityproperty(self, "z");
    int y = getentityproperty(self, "y");
    void Plat = getlocalvar("platform");
    int Koudo = getentityproperty(Plat, "grabforce");

    void Climb;
    void Ceiling;

    void Length; void Width; int Px;
    void PlatA; void PlatB;

    int hold = getplayerproperty(index, "keys");
    int press = getplayerproperty(index, "newkeys");
    int release = getplayerproperty(index, "releasekeys");

    Ceiling = checkplatformbelow(x, z, y-2);

    int Up = playerkeys(index, 0, "moveup");

   
    if(Koudo >= 10){
        changeentityproperty(self, "subject_to_gravity", 0);
        changeentityproperty(self, "aiflag", "jumping", 0);
        changeentityproperty(self, "aiflag", "attacking", 1);

        //setentityvar(self, 1, "P");
        //setentityvar(self, 2, Plat);

        if(aniID == openborconstant("ANI_FOLLOW2")){
            if(hold & openborconstant("FLAG_MOVEDOWN") && press & openborconstant("FLAG_JUMP")){
                changeentityproperty(self, "subject_to_gravity", 1);
                changeentityproperty(self, "aiflag", "jumping", 1);
                changeentityproperty(self, "aiflag", "attacking", 0);               
                performattack(self, openborconstant("ANI_FOLLOW8"));
            }
            //changeentityproperty(self, "position", NULL(), NULL(), NULL());
            //flip();
            //changeentityproperty(self, "velocity", 0, 0, 0);
        }
    }
   

   
    if(Ceiling && hold & openborconstant("FLAG_MOVEUP")){
        changeentityproperty(self, "subject_to_gravity", 0);
        changeentityproperty(self, "aiflag", "jumping", 0);
        performattack(self, openborconstant("ANI_FOLLOW3"));
    }

    if(aniID == openborconstant("ANI_FOLLOW3")){
        Length = getentityproperty(Ceiling, "antigrab");
        Px = getentitiyproperty(Ceiling, "x");

   
    }
   

}



void flip()
{// Flip to opposite direction
    void self = getlocalvar("self");
    int dir = getentityproperty(self,"direction");

    if(dir==0){ // Facing left?
      changeentityproperty(self, "direction", 1);
    } else {
      changeentityproperty(self, "direction", 0);
    }
}

Logan2.txt (weapon model):

Logan.txt (main):

What's really weird is that everytime I hold down and press jump to drop from the ceiling, he swings the sword. I've no idea how that happens.
 
Last edited:
Back
Top Bottom