Bloodbane
Well-known member
Since many people asks for this, I decided to start new thread for this.
I'm using old demo of Marvel First Alliance to show this mode and I applied this to Ironman who has ability to fly.
You can get this updated demo here:
http://www.mediafire.com/download/efcwz8honzu7x1g/FlyMode.rar
This is video showing how fly mode works:
http://youtu.be/yHBpbb8K6Ns
When you play this demo (as Ironman of course), jumps then press jump button to access fly mode. Ironman will play FOLLOW1 animation continuously. This mode ends when jump button is pressed again or when attack is pressed to perform JUMPATTACK or when enemy hits him.
Ironman's fly mode uses this keyscript:
it is defined like this:
This keyscript is long but in general it is divided into 2 main parts: variable declaration and key events actions
For float mode switch above, when Jump button is pressed, animation is checked.
If Ironman is in JUMP animation, it means he's entering fly mode so animation is changed to FOLLOW1, his movement is stopped and floating effect is set to last for 48 centiseconds.
If Ironman is in FOLLOW1, it means he's ending fly mode and revert to JUMP animation so animation is changed to JUMP animation, to 7th frame and floating effect is removed
This is Ironman's FOLLOW1:
He's using flying sprites here. floater function at 2nd frame is to recharge his float effect preventing him from falling. keymove is to allow him to move around with press of direction keys and keyflip is to flip his facing direction.
zvitor, if you're watching this video, do you see Hydra Gunners which come, shoot then leave? that's what I meant with strikers.
(there's hidden easter egg somewhere in the update demo, see if anyone can find it
, and nope, it's not in player's )
I'm using old demo of Marvel First Alliance to show this mode and I applied this to Ironman who has ability to fly.
You can get this updated demo here:
http://www.mediafire.com/download/efcwz8honzu7x1g/FlyMode.rar
This is video showing how fly mode works:
http://youtu.be/yHBpbb8K6Ns
When you play this demo (as Ironman of course), jumps then press jump button to access fly mode. Ironman will play FOLLOW1 animation continuously. This mode ends when jump button is pressed again or when attack is pressed to perform JUMPATTACK or when enemy hits him.
Ironman's fly mode uses this keyscript:
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 iSpeed = getentityproperty(vSelf, "speed");
int eTime = openborvariant("elapsed_time");
float xdir;
float zdir;
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 status of "Attack 2"
void iAttack3 = playerkeys(iPlIndex, 1, "attack3"); // New key status of "Attack 3"
void iAttack4 = playerkeys(iPlIndex, 1, "attack4"); // New key status of "Attack 4"
void iUpR = playerkeys(iPlIndex, 2, "moveup"); // Release status of "Up"
void iDownR = playerkeys(iPlIndex, 2, "movedown"); // Release status of "Down"
void iLeftR = playerkeys(iPlIndex, 2, "moveleft"); // Release status of "Left"
void iRightR = playerkeys(iPlIndex, 2, "moveright"); // Release status of "Right"
void iAttackR = playerkeys(iPlIndex, 2, "attack"); //Release status of "Attack"
void iDownH = playerkeys(iPlIndex, 0, "movedown");
void iUpH = playerkeys(iPlIndex, 0, "moveup");
void iLeftH = playerkeys(iPlIndex, 0, "moveleft");
void iRightH = playerkeys(iPlIndex, 0, "moveright");
//Flip while ducking
if(vAniID == openborconstant("ANI_DUCK") ){ //Ducking?
if(iLeft){ //Left pressed?
changeentityproperty(vSelf, "direction", 0);
} else if(iRight){ //Right pressed?
changeentityproperty(vSelf, "direction", 1);
}
}
//Float mode switch
if(iJump){
if(vAniID == openborconstant("ANI_JUMP")){
changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW1"),2);
changeentityproperty(vSelf, "tosstime", eTime + 96);
changeentityproperty(vSelf, "velocity", 0, 0, 0);
} else if(vAniID == openborconstant("ANI_FOLLOW1")){
changeentityproperty(vSelf, "animation", openborconstant("ANI_JUMP"),2);
changeentityproperty(vSelf, "tosstime", eTime);
updateframe(vSelf, 6);
}
}
}
it is defined like this:
in Ironman.txtkeyscript data/chars/Ironman/ironkey.c
This keyscript is long but in general it is divided into 2 main parts: variable declaration and key events actions
For float mode switch above, when Jump button is pressed, animation is checked.
If Ironman is in JUMP animation, it means he's entering fly mode so animation is changed to FOLLOW1, his movement is stopped and floating effect is set to last for 48 centiseconds.
If Ironman is in FOLLOW1, it means he's ending fly mode and revert to JUMP animation so animation is changed to JUMP animation, to 7th frame and floating effect is removed
This is Ironman's FOLLOW1:
anim follow1
loop 1
delay 1
offset 66 135
bbox 44 44 30 74
frame data/chars/Ironman/j0.gif
delay 8
@cmd keyflip 0
@cmd keymove 1.2 0.6
@cmd floater 48
frame data/chars/Ironman/j0.gif
frame data/chars/Ironman/j1.gif
frame data/chars/Ironman/j0.gif
@cmd keyflip 0
@cmd keymove 1.2 0.6
frame data/chars/Ironman/j1.gif
frame data/chars/Ironman/j0.gif
@cmd keyflip 0
@cmd keymove 1.2 0.6
frame data/chars/Ironman/j1.gif
He's using flying sprites here. floater function at 2nd frame is to recharge his float effect preventing him from falling. keymove is to allow him to move around with press of direction keys and keyflip is to flip his facing direction.
zvitor, if you're watching this video, do you see Hydra Gunners which come, shoot then leave? that's what I meant with strikers.
(there's hidden easter egg somewhere in the update demo, see if anyone can find it