Jump from walls / edges

NED

Well-known member
Basically, I'm trying to understand how to do triangle jump (Chun Li wall jump move) But with an automatic move done like triangle jump kick...

I would like it to be possible on screen edge, walls and vertical surface of obstacles and platforms.

I've seen in the BK chinese mod I won't name here...

Is there a way to use this feature?
Thanks
 
But for some reason when I do a jump attack during this jump velocity stops and fall down.
i think he is not using animation forwardjump or attack jumpforward / but anim jump instead or jumpattack and controling the jump with player keys (jumpmove {fx} {fz}).
also jump attack could have a landframe or player will play anim walkoff then jumpland when it lands on the ground.
 
Yes, all my jump attacks have a land frame.

For explaing it more.

I'm using jump, jump forward, and run jump anims in my system.
But for the moment I added only the script for regular vertical jump.

And I'm testing only with this particular. (The idea is to adapt script to all types of jumps when it is fully working with vertical jump)

Also, I'm using an older build. it can be the reason why the script don't works.

I can remember BB suggesting to move a script from player file to exteral file (or inverse) in order to make it working in my openbor build.
EDIT
I tested with a newer build and it's even worst. Player don't recover control after falling from the jump.

Anyway, as a reminder I'll post most of the code + script here.
I'm certainly doing something wrong.

This is the edited script file declaration in player's header
Code:
keyscript data/scripts/edgejumr.c

The script itself
Code:
void main()
{
    int iPlIndex = getlocalvar("player"); //Get calling player
    void vSelf = getplayerproperty(iPlIndex , "entity"); //Get calling entity
    void vAniID = getentityproperty(vSelf,"animationID"); //Get current animation ID
    void vAniPos = getentityproperty(vSelf, "animpos"); //Get current animation frame
    int iDir = getentityproperty(vSelf, "direction");  //Get current facing direction
    int x = getentityproperty(vSelf, "x");
    int y = getentityproperty(vSelf, "a");
    int z = getentityproperty(vSelf, "z");
    int XPos = openborvariant("xpos"); //Get screen edge's position
    int Screen = openborvariant("hResolution"); // Get screen width
   
    void iUp = playerkeys(iPlIndex, 1, "moveup"); // New key status of "Up"
    void iDown = playerkeys(iPlIndex, 1, "movedown"); // New key status of "Down"
    void iLeft = playerkeys(iPlIndex, 1, "moveleft"); // New key status of "Left"
    void iRight = playerkeys(iPlIndex, 1, "moveright"); // New key status of "Right"
    void iJump = playerkeys(iPlIndex, 1, "jump"); //New key status of "Jump"
    void iSpecial = playerkeys(iPlIndex, 1, "Special"); //New key status of "Special"
    void iAttack = playerkeys(iPlIndex, 1, "attack"); //New key status of "Attack"
    void iAttack2 = playerkeys(iPlIndex, 1, "attack2"); // New key of "Attack 2"
    void iAttack3 = playerkeys(iPlIndex, 1, "attack3"); // New key of "Attack 3"

    if(vAniID == openborconstant("ANI_JUMP")){

      if(iJump && iDir == 1 && y <= checkwall(x+15,z)){
        changeentityproperty(vSelf, "direction", 0);
        changeentityproperty(vSelf, "velocity", 0, 0, 0);
        floated(16);// duree du step
        changeentityproperty(vSelf, "noaicontrol",1);
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW50")); // Wall Bounce

      } else if(iJump && iDir == 0 && y <= checkwall(x-15,z)){
        changeentityproperty(vSelf, "direction", 1);
        changeentityproperty(vSelf, "velocity", 0, 0, 0);
        floated(16);// duree du step
        changeentityproperty(vSelf, "noaicontrol",1);
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW50")); // Wall Bounce
      }

        else if(iJump && iDir == 0 && x <= XPos+10){
        changeentityproperty(vSelf, "direction", 1);
        changeentityproperty(vSelf, "velocity", 0, 0, 0);
        floated(16);// duree du step
        changeentityproperty(vSelf, "noaicontrol",1);
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW50")); // Edge Bounce
      }

        else if(iJump && iDir == 1 && x >= XPos+Screen-10){
        changeentityproperty(vSelf, "direction", 0);
        changeentityproperty(vSelf, "velocity", 0, 0, 0);
        floated(16);// duree du step
        changeentityproperty(vSelf, "noaicontrol",1);
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW50")); // Edge Bounce
      }
    }

}

void floated( int Time )
{// Floats in Time centiseconds
    void self = getlocalvar("self");
    int eTime = openborvariant("elapsed_time");

    changeentityproperty(self, "tosstime", eTime + 2*Time);
}

This is the cling to wall (wall jump edge jump) in player file.
Code:
anim   follow50# Wall and edge jump (cling to wall) appui au mur
#@script
#    if(frame==1){
#      void self = getlocalvar("self");
#      changeentityproperty(self, "noaicontrol",0);
#    }
#@end_script

@script
    if(frame==1){
      void self = getlocalvar("self");
        changeentityproperty(self, "animation", openborconstant("ANI_JUMP"));
          tossentity(self, 3.4, -1.5, 0); // Wall Bounce
      changeentityproperty(self, "noaicontrol",0);
    }
@end_script


#      @script
#    void self = getlocalvar("self");
#    if( frame == 2){
#        changeentityproperty(self, "animation", openborconstant("ANI_JUMP"));
#      changeentityproperty(self, "noaicontrol",0);
#      }
#   @end_script




	delay   16#40####duree du step (voir script)
#	jumpframe 1 3.5 1 0
	offset	96 177
	bbox   0 0 0 0
	frame	data/chars/rachel/j01.gif

	delay   5#30
	bbox	76 65 40 78
	frame	data/chars/rachel/j02.gif
	frame	data/chars/rachel/j02.gif

My 3 regular jump anims
Code:
anim	jump
cancel 0 6 0 A freespecial36# jump light attack
cancel 0 6 0 D A freespecial39# jump light attack
cancel 0 6 0 A2 freespecial14# jump hard kick
cancel 0 6 0 B A freespecial16# jump back kick
cancel 0 6 0 D A2 freespecial22# jump body drop
cancel 0 6 0 A4 freespecial55# air grab attempt
#cancel 1 6 0 A2 freespecial17# RUN jump drop kick
#	subentity	dus#t
#	spawnframe	0 0
	loop	0
	offset	96 177
	bbox	75 95 45 89
	delay	5
#	sound	data/sounds/jump.wav
	frame	data/chars/rachel/j02.gif
	bbox	76 65 40 78
	delay	10
	frame	data/chars/rachel/j02.gif
	delay	5
	frame	data/chars/rachel/j03.gif
	delay	15
	frame	data/chars/rachel/j04.gif
	delay	5
	frame	data/chars/rachel/j05.gif
	delay	40
	frame	data/chars/rachel/j06.gif

anim	forwardjump#idem que jump normal pour cancels
cancel 0 6 0 A freespecial28# light attack
cancel 0 6 0 D A freespecial29# jump forward kakato (car ne sort pas, bug)777777777
cancel 0 6 0 A2 freespecial19# jump hard kick
cancel 0 6 0 B A freespecial20# jump back kick
cancel 0 6 0 D A2 freespecial23# jump body drop
cancel 0 6 0 A4 freespecial56# air grab attempt
#cancel 1 6 0 A2 freespecial17# RUN jump drop kick
#	subentity	dus#t
#	spawnframe	0 0
	loop	0
	offset	96 177
	bbox	75 95 45 89
	delay	5
#	sound	data/sounds/jump.wav
	frame	data/chars/rachel/j02.gif
	bbox	76 65 40 78
	delay	10
	frame	data/chars/rachel/j02.gif
	delay	5
	frame	data/chars/rachel/j03.gif
	delay	15
	frame	data/chars/rachel/j04.gif
	delay	5
	frame	data/chars/rachel/j05.gif
	delay	40
	frame	data/chars/rachel/j06.gif

anim	runjump#idem que jump normal pour cancels
#cancel 1 6 0 A2 freespecial14# jump hard kick
cancel 0 6 0 B A freespecial21# jump back kick
cancel 0 6 0 A2 freespecial17# RUN jump drop kick
cancel 0 6 0 D A2 freespecial24# jump body drop
cancel 0 6 0 A4 freespecial57# air grab attempt
	subentity	dus#t
	spawnframe	0 0
	loop	0
	offset	96 177
	bbox	75 95 45 89
	delay	5
#	sound	data/sounds/jump.wav
	frame	data/chars/rachel/j02.gif
	bbox	76 65 40 78
	delay	10
	frame	data/chars/rachel/j02.gif
	delay	5
	frame	data/chars/rachel/j03.gif
	delay	15
	frame	data/chars/rachel/j04.gif
	delay	5
	frame	data/chars/rachel/j05.gif
	delay	40
	frame	data/chars/rachel/j06.gif

After reflexion, I'm thinking, perfaps the easier way is to create a clone of jump anim with all the cancel on it??
The only problem is I prefer to use hardcoded jump to avoid having clones and clones of alternate jumps for later features.

Anyway, if you spot something that can make the script unstable, please, point it out.
 
Since there is no way to fix it.
I'll cancel regular jump feature.
I'll overwrite with some FAKE jump cancel using a follow anim.

This way is even better, because it can allow custom moves from this cancel.

Anyway if someone see an error that could cause my problem in previous post, I'm still hoping for a possible fix.
 
Again, I stopped coding anything for few days and I'm already "rusty" :(

I changed my mind as I said in previous post.
Since I use an old build for various reasons, I cannot require advanced script to work correctly.

So I'll go back to something more simple.
Can I have a little help to make wall/edge jump this way :

1 detect wall or jump.
2 cling to wall
3 go to a a custom follow anim

* both cling and follow anim can be only one anim

Thanks a lot.

BB's previous code can certainly be edited simplified to allow a cancel to regular jump, but I don't undersand it anymore. Sorry for my lack of logic understanding.
 
OK, I tried with other newer builds and the problem is still the same.

Do you have a suggestion for a simple script variation to send player to custom follow anim right after cling?
 
It doesn't work with other builds?  :o

Strange, have you tried this small mod:

https://www.mediafire.com/?1zz1xma8nrmnv1y

it has wall bounce script similar to this IIRC

Do you have a suggestion for a simple script variation to send player to custom follow anim right after cling?

Of course, you either use:

Code:
        performattack(self, openborconstant("ANI_FOLLOW2"));

OR

Code:
       changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));

what do you need this for?
 
To me, using follow is a lazy way, because I can't understand what's wrong with Openbor to gather/keep jump velocity values.
I need this to simulate a real jump.

I think, my game don't allow keeping jump velocities values in memory or something.
With the previous script
http://www.chronocrash.com/forum/index.php?topic=1528.msg37626#msg37626

Wall jump don't work well.
When facing left, Rachel cling to wall then fall directly vertically during second jump motion.
e6pf6K7.jpg


When facing right, Rachel cling and do the wall jump with correct velocity.
BUT, it you cancel with a jumping attack, her velocity is stopped (no problem on this one)
oO6ZkaU.jpg

(The problem is in both wall and edge jump)

This older script works perfectly. (wall/edge jump without cling)
http://www.chronocrash.com/forum/index.php?topic=1528.msg37024#msg37024

But, it could be nice to have a proprer cling anim.

Anyway, I'll give a try to DD demo. Thanks BB :)
 
This is the last version of wall jump (with edge jump too)
Is there something wrong on it?
Code:
void main()
{
    int iPlIndex = getlocalvar("player"); //Get calling player
    void vSelf = getplayerproperty(iPlIndex , "entity"); //Get calling entity
    void vAniID = getentityproperty(vSelf,"animationID"); //Get current animation ID
    void vAniPos = getentityproperty(vSelf, "animpos"); //Get current animation frame
    int iDir = getentityproperty(vSelf, "direction");  //Get current facing direction
    int x = getentityproperty(vSelf, "x");
    int y = getentityproperty(vSelf, "a");
    int z = getentityproperty(vSelf, "z");
    int XPos = openborvariant("xpos"); //Get screen edge's position
    int Screen = openborvariant("hResolution"); // Get screen width
   
    void iUp = playerkeys(iPlIndex, 1, "moveup"); // New key status of "Up"
    void iDown = playerkeys(iPlIndex, 1, "movedown"); // New key status of "Down"
    void iLeft = playerkeys(iPlIndex, 1, "moveleft"); // New key status of "Left"
    void iRight = playerkeys(iPlIndex, 1, "moveright"); // New key status of "Right"
    void iJump = playerkeys(iPlIndex, 1, "jump"); //New key status of "Jump"
    void iSpecial = playerkeys(iPlIndex, 1, "Special"); //New key status of "Special"
    void iAttack = playerkeys(iPlIndex, 1, "attack"); //New key status of "Attack"
    void iAttack2 = playerkeys(iPlIndex, 1, "attack2"); // New key of "Attack 2"
    void iAttack3 = playerkeys(iPlIndex, 1, "attack3"); // New key of "Attack 3"

    if(vAniID == openborconstant("ANI_JUMP")){

      if(iJump && iDir == 1 && y <= checkwall(x+15,z)){
        changeentityproperty(vSelf, "direction", 0);
        changeentityproperty(vSelf, "velocity", 0, 0, 0);
        floated(16);// duree du step
        changeentityproperty(vSelf, "noaicontrol",1);
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW50")); // Wall Bounce

      } else if(iJump && iDir == 0 && y <= checkwall(x-15,z)){
        changeentityproperty(vSelf, "direction", 1);
        changeentityproperty(vSelf, "velocity", 0, 0, 0);
        floated(16);// duree du step
        changeentityproperty(vSelf, "noaicontrol",1);
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW50")); // Wall Bounce
      }

        else if(iJump && iDir == 0 && x <= XPos+10){
        changeentityproperty(vSelf, "direction", 1);
        changeentityproperty(vSelf, "velocity", 0, 0, 0);
        floated(16);// duree du step
        changeentityproperty(vSelf, "noaicontrol",1);
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW50")); // Edge Bounce
      }

        else if(iJump && iDir == 1 && x >= XPos+Screen-10){
        changeentityproperty(vSelf, "direction", 0);
        changeentityproperty(vSelf, "velocity", 0, 0, 0);
        floated(16);// duree du step
        changeentityproperty(vSelf, "noaicontrol",1);
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW50")); // Edge Bounce
      }
    }

}

void floated( int Time )
{// Floats in Time centiseconds
    void self = getlocalvar("self");
    int eTime = openborvariant("elapsed_time");

    changeentityproperty(self, "tosstime", eTime + 2*Time);
}
If I try the move by being facing LEFT, the x velocity is ignored.
I can't understand why, but player stay kind of bind to left wall when trying it.

Thanks


EDIT---------------------

The error is not in the function itself.
It's in the follow anim function.

I don't use this one because it don't work at all.
Code:
@script
    if(frame==1){
      void self = getlocalvar("self");
      changeentityproperty(self, "noaicontrol",0);
    }
@end_script

I use this one instead.
But it allow only velocity to RIGHT wall
Code:
@script
    if(frame==1){
      void self = getlocalvar("self");
        changeentityproperty(self, "animation", openborconstant("ANI_JUMP"));
          tossentity(self, 3.4, -1.5, 0); // Wall Bounce
      changeentityproperty(self, "noaicontrol",0);
    }
@end_script

I'm pretty sure I can fix it by making 2 follow anims (left and right version) for each type of jump (normal jump, forward jump, run jump)
Even for a non coder like me, I really feel like it's a waste code lines.
But if there is no way to fix it i'll do it.
-6 new follow anims per entity.
-6 variations of the script to allow L and R jump for normal, forward and run jumps :(
 
Hmmm... I really don't understand why keyscript could change jump status like that

Anyways, the problem about your script in wall cling animation is that, it doesn't check facing direction first and thus tossentity function tosses entity to certain direction only
Here's the fixed one:

Code:
@script
    if(frame==1){
      void self = getlocalvar("self");
      int dir = getentityproperty(self,"direction");

      if(dir==0){ // Facing left?
        tossentity(self, 3.4, 1.5, 0); // Wall Bounce
      } else { // Facing right
        tossentity(self, 3.4, -1.5, 0); // Wall Bounce
      }

      changeentityproperty(self, "noaicontrol",0);
      changeentityproperty(self, "animation", openborconstant("ANI_JUMP"), 2);
    }
@end_script
 
I cannot understand either why keyscript don't work.
Perhaps a conflict with something else?

Anyway, I tested your new script.
I had to reverse tossentity "x" value to make it OK
"-1.5 to 1.5" and "1.5 to -1.5"

Now it works perfectly!
Thanks a lot BB :D

I'll adapt it to make it working for forward jump anim and run jump anim. :)
 
Back
Top Bottom