maxman
Well-known member
I'm trying to make a special command move with diagonals (and attack) after pressing the down button. I know the freespecial command only lets you do D F U and B. but no diagonals such as UF (up-forward), DF (down-forward). For instance, when pressing down, and diagonal up-forward with jump, it can perform a super forward jump as a freespecial animation.
What I'm trying to do is to make a player perform a super forward jump with a diagonal command after the down press. I'm using the entity script which works well for pressing diagonal buttons instead of keyscript.
Both freespecial2 and freespecial3 have the same animations but the commands are different.
superfjump.c:
Despite the functions working well for the diagonals, I feel like pressing those two buttons or making commands out of those two at the same time with this kind, makes it feel like it's stiff. Because I use commands from freespecials. You just have to press up+forward at the same before the jump button. Is there a better or more functional way to do this command?
What I'm trying to do is to make a player perform a super forward jump with a diagonal command after the down press. I'm using the entity script which works well for pressing diagonal buttons instead of keyscript.
Code:
name Jimmy
type player
speed 10
health 100
facing 0
combostyle 1
gfxshadow 1
atchain 1 2 4 3
running 19 4 2 1 1
turndelay 50
jumpheight 4.25
palette data/chars/jimmy/map01.png
alternatepal data/chars/jimmy/idle00.png
com d u j freespecial8
com d u freespecial2
com d f freespecial3
animationscript data/scripts/script.c
script data/scripts/superfjump.c
Both freespecial2 and freespecial3 have the same animations but the commands are different.
Code:
anim freespecial2
bbox 124 106 72 99
offset 162 202
delay 7
frame data/chars/jimmy/idle00.png
anim freespecial3
bbox 124 106 72 99
offset 162 202
delay 7
frame data/chars/jimmy/idle00.png
superfjump.c:
Code:
void main(){
SuperJump();
}
void SuperJump(){
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
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"
void iAttack4 = playerkeys(iPlIndex, 1, "attack4"); // New key of "Attack 4"
void iLeftR = playerkeys(iPlIndex, 2, "moveleft"); // Release status of "Left"
void iRightR = playerkeys(iPlIndex, 2, "moveright"); // Release status of "Right"
void iDownR = playerkeys(iPlIndex, 2, "movedown"); //Release status of "Down"
void iAttackR = playerkeys(iPlIndex, 2, "attack"); //Release status of "Attack"
void iUpH = playerkeys(iPlIndex, 0, "moveup");
void iDownH = playerkeys(iPlIndex, 0, "movedown");
void iLeftH = playerkeys(iPlIndex, 0, "moveleft");
void iRightH = playerkeys(iPlIndex, 0, "moveright");
//Super forward jump
if(vAniID == openborconstant("ANI_FREESPECIAL2")){
if(iRightH){
changeentityproperty(vSelf, "direction", 1);
//changeentityproperty(vSelf, "animation", openborconstant("ANI_FREESPECIAL6"));
//tossentity(vSelf, 5, 3, 0);
if(iJump){
changeentityproperty(vSelf, "animation", openborconstant("ANI_FREESPECIAL6"));
tossentity(vSelf, 5, 3, 0);
}
}else if(iLeftH){
changeentityproperty(vSelf, "direction", 0);
//changeentityproperty(vSelf, "animation", openborconstant("ANI_FREESPECIAL6"));
//tossentity(vSelf, 5, -3, 0);
if(iJump){
changeentityproperty(vSelf, "animation", openborconstant("ANI_FREESPECIAL6"));
tossentity(vSelf, 5, -3, 0);
}
}
}
if(vAniID == openborconstant("ANI_FREESPECIAL3")){
if(iUpH && iDir == 1){
if(iJump){
changeentityproperty(vSelf, "animation", openborconstant("ANI_FREESPECIAL6"));
tossentity(vSelf, 5, 3, 0);
}
}else if(iUpH && iDir == 0){
if(iJump){
changeentityproperty(vSelf, "animation", openborconstant("ANI_FREESPECIAL6"));
tossentity(vSelf, 5, -3, 0);
}
}
}
}
Despite the functions working well for the diagonals, I feel like pressing those two buttons or making commands out of those two at the same time with this kind, makes it feel like it's stiff. Because I use commands from freespecials. You just have to press up+forward at the same before the jump button. Is there a better or more functional way to do this command?
Last edited: