Fly mode

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:

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:
keyscript data/chars/Ironman/ironkey.c
in Ironman.txt

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 ;) , and nope, it's not in player's )
 
thanks man, it will help a lot,
and  now i understood how strikes should be
 
this effect of the wind pushing back is one of the things i was looking for
 
ah, is something close to what I did on my game, but I fixed something: I set a mp consumption, to avoid cheapness. At the video, you can see that you can fly with Iron Man and keep spamming the attack, since the chars won't jump to get him.

This mode ends when jump button is pressed again or when attack is pressed to perform JUMPATTACK or when enemy hits him.

If the attack makes him goes down, how you can fire the beam?
 
If the attack makes him goes down, how you can fire the beam?

Ironman in this demo doesn't move down when he shoots beam downwards.

Okay, this is not easter and I don't celebrate it either :) so I just tell where the easter egg is. It's in Whirlwind's RISE animation. He'll push players and enemies away from him when he played that animation.
 
thanks blood, added it and now fly mode works exactly like i want, and this keymove will be usefull at other moves too, and at sky stages,
i didnt checked whirlwind, will take a look tonite.
 
i noticed that the keymove and keyflip are different from the ones that i use on my project, those are updated versions from the crime busters?
i noticed the fly code work with the version my mod uses, but i want to know what the new paramenter on keyflip does, and the new parameter on keymove worth the update or not?

void keyflip()  ( old one from crime busters)
void keyflip(int Inv)  (new one)


void keymove(float V)  (crime busters)
void keymove(float Vx, float Vz)  (newone)

i understood that in the new keymove code the Vz control the Z axis values different from the old one that used the same V value/2
but in the keyflip i dont understood why the need of that new var

should i update or not? my script libs
 
but in the keyflip i dont understood why the need of that new var

should i update or not? my script libs

That keyflip parameter is for inverted flipping. Normally pressing left will turn character to face left, but if you set @cmd keyflip 1, pressing left will turn to face right.
I only use this in Kula's dodgerise animation so she slides backward.

Though that's the only time I ever use @cmd keyflip 1. So it's up to you to update or not :).
 
Yep, blower works like this: it blows enemies, players and npcs who are standing in front of it. Blown range is 1 to 250 pixels.
Why 1? that's to prevent Whirlwind or any entity which spawns blower to be blown away.

Whirlwind blows to left and right direction BTW. He spawns 2 blowers, one facing left and the other faces right.
 
I put the fly mode in my mod.
All works ok but i cant make any attack.
I reply in my character the jumpattack2 like the Ironman and the same follow1.
The jumpattack2 works in ground, but in the fly mode not working.
The same problem with attack key.
The hero can fly, but without any attack.
After to fix this, its possible choose the attacks to the hero can perform in fly mode?
 
Not by default, but you should script it into the blocking animation (or Upper animation to make them dodge jump attacks). In any case, the Dodge animation itself is just awful due to hard coded movement through the whole thing and forcing identical frames for up vs down. It's only in there for backward compatibility. To make a decent looking dodge, you should use Attackup and Attackdown.

DC
 
I put the fly mode in my mod.
All works ok but i cant make any attack.

You mean, you can't attack while flying?
I set flying mode in this matter so modders don't need to add extra attacks and can use existing jumpattacks

After to fix this, its possible choose the attacks to the hero can perform in fly mode?

Yes, flying mode uses FOLLOW1 animation, you can set cancel command there to allow certain attacks to be performed only from flying mode

is there is an animation called "dodgerise"

No. I usually named it like that to ability to dodge while rising

does anyone have an example of this script and setup for an attackup dodge ?

Attackup dodge?
 
Yes Bloodbane, i can't attack while flying.
The only solution i find was put in Follow1 a
@cmd keyint "ANI_JUMPSPECIAL" 0 "S" 0 0
@cmd keyint "ANI_FREESPECIAL17" 0 "A" 0 0

This way works for me, i dont understand wath the problem anyway.

Thanks.
 
I don't understand what could be wrong. I just tried it with newer build and fly mode works fine.

You used exact copy of ironkey.c as keyscript right?
 
Yes!
I copy the ironkey.c to my character folder and update the the keyint in script txt.

No idea where is the error.
 
Back
Top Bottom