Hi @DD TokkiView attachment 3438
I'm considering wall jumping for the enemy's movement.
When you jump normally, it doesn't bounce and comes right down.
I would like to create a scene where I bounce off the wall in the opposite direction when I make a special jump (freespecial).
onblockw.c event file, put this code inside and call the onblockwscript event on every character that can jump walls.onblockwscript data/scripts/onblockw/default.c
onblocks.c file too, which refers to the screen edge).void main()
{//Make characters jump in walls
void self = getlocalvar("self");
void ani = getentityproperty(self, "animationID");
int iPIndex = getentityproperty(self, "playerindex");
float pause = 30;
if(ani == openborconstant("ANI_JUMP")){
float xVel = 2;
float yVel = 1;
if(playerkeys(iPIndex, 0, "moveleft")){
changeentityproperty(self, "direction", 0);
xVel = -xVel;
}
else
if(playerkeys(iPIndex, 0, "moveright")){
changeentityproperty(self, "direction", 1);
}
else
{
xVel = 0;
}
if(playerkeys(iPIndex, 1, "jump")){
changeentityproperty(self, "animation", openborconstant("ANI_WALKOFF"));
changeentityproperty(self, "aiflag", "frozen", 1);
changeentityproperty(self, "freezetime", openborvariant("elapsed_time")+pause);
tossentity(self, yVel, xVel, 0);
}
}
}
thank youHi @DD Tokki
Here's an example of the script I'm using on SORX to allow Blaze/Sammy/Shiva to jump walls. You need to create aonblockw.cevent file, put this code inside and call the onblockwscript event on every character that can jump walls.
C:onblockwscript data/scripts/onblockw/default.c
This event happens every time a character is blocked by walls (the same goes foronblocks.cfile too, which refers to the screen edge).
C:void main() {//Make characters jump in walls void self = getlocalvar("self"); void ani = getentityproperty(self, "animationID"); int iPIndex = getentityproperty(self, "playerindex"); float pause = 30; if(ani == openborconstant("ANI_JUMP")){ float xVel = 2; float yVel = 1; if(playerkeys(iPIndex, 0, "moveleft")){ changeentityproperty(self, "direction", 0); xVel = -xVel; } else if(playerkeys(iPIndex, 0, "moveright")){ changeentityproperty(self, "direction", 1); } else { xVel = 0; } if(playerkeys(iPIndex, 1, "jump")){ changeentityproperty(self, "animation", openborconstant("ANI_WALKOFF")); changeentityproperty(self, "aiflag", "frozen", 1); changeentityproperty(self, "freezetime", openborvariant("elapsed_time")+pause); tossentity(self, yVel, xVel, 0); } } }
You can freely edit the properties to act like wall bouncing using the previous script, but SORX has wall bouncing script too, like this:thank you
But it seems different from what I want.
Blaze feels like double-jumping off a wall, but I
I want the feeling of a ball bouncing off a wall like in a script like wallbons.c.
void main()
{//Simulate hitwall effect when thrown or being hit by certain attacks (ALL THROWS/SLAMS AND BOWLING SKILLS, BARBON/ADAM)
void self = getlocalvar("self");
void anim = getentityproperty(self, "animationID");
int dead = getentityproperty(self, "dead");
int limit = 20;
float height = getentityproperty(self, "y");
float xDir = getentityproperty(self, "xdir");
float mult = 1.1;
if(!dead){
if( anim == openborconstant("ANI_FALL") ||
anim == openborconstant("ANI_BURN") ||
anim == openborconstant("ANI_SHOCK") ||
anim == openborconstant("ANI_FALL8") ||
anim == openborconstant("ANI_FALL9") ){
if(height >= limit){
spawn01("Flash", 0, 50, 1);
spawn01("QuakeLow", 0, 0, 0);
sound("sor3_hit6.wav");
tossentity(self, NULL(), -xDir/mult, 0);
}
}
}
}
Sorry, just set it wrong.Those videos are set "Private". Put to "Unlisted".
Is this script also applied as onblockwscript ? I'm asking because the game doesn't run.You can freely edit the properties to act like wall bouncing using the previous script, but SORX has wall bouncing script too, like this:
C:void main() {//Simulate hitwall effect when thrown or being hit by certain attacks (ALL THROWS/SLAMS AND BOWLING SKILLS, BARBON/ADAM) void self = getlocalvar("self"); void anim = getentityproperty(self, "animationID"); int dead = getentityproperty(self, "dead"); int limit = 20; float height = getentityproperty(self, "y"); float xDir = getentityproperty(self, "xdir"); float mult = 1.1; if(!dead){ if( anim == openborconstant("ANI_FALL") || anim == openborconstant("ANI_BURN") || anim == openborconstant("ANI_SHOCK") || anim == openborconstant("ANI_FALL8") || anim == openborconstant("ANI_FALL9") ){ if(height >= limit){ spawn01("Flash", 0, 50, 1); spawn01("QuakeLow", 0, 0, 0); sound("sor3_hit6.wav"); tossentity(self, NULL(), -xDir/mult, 0); } } } }
That's right. It is the action of bouncing against the wall.do you want this effect
void main()
{//screen edge and wall, bounce
void self = getlocalvar("self");
void Dir = getentityproperty(self, "direction");
void vAniID = getentityproperty(self,"animationID");
int iPIndex = getentityproperty(self,"playerindex");
void iJump = playerkeys(iPIndex, 1, "jump");
int y = getentityproperty(self, "a");
int b = getentityproperty(self, "base");
if(vAniID == openborconstant("ANI_JUMP")){
if(iJump && y > b+1 && Dir == 1){
changeentityproperty(self, "direction", 0);
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW15"));
}else if(iJump && y > b+1 && Dir == 0){
changeentityproperty(self, "direction", 1);
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW15"));
}
}
}
anim follow15
loop 0
delay 25
offset 72 131
bbox 64 102 16 15
jumpframe 1 3 2.5 0
landframe 5
@cmd toss0001 140 //Dwell Wall Time Script
frame data/chars/mboss05/0ru1.gif
delay 20
bbox 64 102 16 15
sound data/sounds/jump.wav
frame data/chars/mboss05/0ru1.gif
delay 6
frame data/chars/mboss05/0a501.gif
frame data/chars/mboss05/0a502.gif
delay 999
frame data/chars/mboss05/0a503.gif
delay 1
frame data/chars/mboss05/0a503.gif
void toss0001(int iSTime)
{
/*
toss0001
Damon Vaughn Caskey
12/24/2009
Adds tosstime to caller.
iTime: Time to add.
*/
void vSelf = getlocalvar("self");
int iTime = openborvariant("elapsed_time");
changeentityproperty(vSelf, "tosstime", iTime + iSTime);
}
You need to remove the lines you will not use, mainly the sound and spawn01 functions, because I pasted directly from SORX.Is this script also applied as onblockwscript ? I'm asking because the game doesn't run.
thank you This seems to be applied to the fall animation, but can I change it to jump or freespecial only?You need to remove the lines you will not use, mainly the sound and spawn01 functions, because I pasted directly from SORX.
Yes, you can use the script in any animation. But after looking at Pudu's example, I think the first method works better and you can remove the double jump effect by doing adjustments on the velocities applied or removing the freeze effect.thank you This seems to be applied to the fall animation, but can I change it to jump or freespecial only?
Yes, you can use the script in any animation. But after looking at Pudu's example, I think the first method works better and you can remove the double jump effect by doing adjustments on the velocities applied or removing the freeze effect.

You can delete the iJump related code so that the sprite will bounce automatically if it hits a wall or the edge of the screen after jumpingView attachment 3443
Now I know what kind of function pudu's script is.
Here, if the wall jump of bounce script is combined with hitwall.c property, it seems to be the function I want.
This is a useful feature for players.
Since it is applied to Enemy, I would like button input on the wall to be automatic.
void main()
{//screen edge and wall, bounce
void self = getlocalvar("self");
void Dir = getentityproperty(self, "direction");
void vAniID = getentityproperty(self,"animationID");
//int iPIndex = getentityproperty(self,"playerindex");
//void iJump = playerkeys(iPIndex, 1, "jump");
int y = getentityproperty(self, "a");
int b = getentityproperty(self, "base");
if(vAniID == openborconstant("ANI_JUMP")){
if(y > b+1 && Dir == 1){
changeentityproperty(self, "direction", 0);
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW15"));
}else if(y > b+1 && Dir == 0){
changeentityproperty(self, "direction", 1);
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW15"));
}
}
}