Keyscript for A2 (for kick attacks)

CRxTRDude

Member
Hey again, trying to experiment on things that aren't of interest to people. Right now, I'm ticked that some people say that I don't do any games of my own in this engine, so here I am now struggling to make a mod. For starters, I'll try and make something from other sprites. What I planned is using Cammy as the main character of the game (specifically the Cammy from SFA3).

I'm now in the point that Cammy is almost complete and I would like to make use of another button (attack 2) so that I can execute kicks, the attack1 button being for punches. I know the other way to do combos for buttons other than attack1 is by keyscript, is there a tutorial or something of basis for this method? If there is another way aside from scripting, that could be helpful too.
 
Are you trying to make it so she doesn't drop like the bass in one of those god awful skrillex songs?
IOW, using a freespecial in mid air causes the entity to lose ALL forward momentum, and immediately drop to the ground according to it's rate of antigravity. I think it has to do with Freespecials being coded in as grounded actions by default, or something to that effect anyway.
Bloodbane gave me a keyscript to counter that. Make a new .txt file, Call it
Whatever you like honestly.C <-- Make sure you have your computer set to allow viewing file extentions. Then paste the following green stuff into it:

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

    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 iJumpR = playerkeys(iPlIndex, 2, "jump"); //      Release status of "Jump"
    void iSpecialR = playerkeys(iPlIndex, 2, "Special"); // Release status of "Special"
    void iAttackR = playerkeys(iPlIndex, 2, "attack"); //  Release status of "Attack"
    void iAttack2R = playerkeys(iPlIndex, 2, "attack2"); // Release status of "Attack 2"
    void iAttack3R = playerkeys(iPlIndex, 2, "attack3"); // Release status of "Attack 3"
    void iAttack4R = playerkeys(iPlIndex, 2, "attack4"); // Release status of "Attack 4"

    void iUpH = playerkeys(iPlIndex, 0, "moveup"); //      Held status of "Up"
    void iDownH = playerkeys(iPlIndex, 0, "movedown"); //  Held status of "Down"
    void iLeftH = playerkeys(iPlIndex, 0, "moveleft"); //  Held status of "Left"
    void iRightH = playerkeys(iPlIndex, 0, "moveright"); // Held status of "Right"
    void iJumpH = playerkeys(iPlIndex, 0, "jump"); //      Held status of "Jump"
    void iSpecialH = playerkeys(iPlIndex, 0, "Special"); // Held status of "Special"
    void iAttackH = playerkeys(iPlIndex, 0, "attack"); //  Held status of "Attack"
    void iAttack2H = playerkeys(iPlIndex, 0, "attack2"); // Held status of "Attack 2"
    void iAttack3H = playerkeys(iPlIndex, 0, "attack3"); // Held status of "Attack 3"
    void iAttack4H = playerkeys(iPlIndex, 0, "attack4"); // Held status of "Attack 4"

//kEEP FORWARD MOMENTUM WITH AIRBORNE FREESPECIAL
    if(vAniID == openborconstant("ANI_JUMP") || vAniID == openborconstant("ANI_FORWARDJUMP") || vAniID == openborconstant("ANI_RUNJUMP") ){ //Jumping?
      if (iAttack2){ //Attack2 pressed?
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FREESPECIAL
X"));
      }
    }

}


Once that's done, change that red X to whichever Freespecial you want her to perform in the air. IE:  ANI_FREESPECIAL1, ANI_FREESPECIAL2, ANI_FREESPECIAL3, etc. Then save it as Whatever you like honestly.C
once that's done, open your player character's .txt file (In this case, Cammy.) Add the line:
keyscript        DATA/CHARS/CAMMY/Whatever you like honestly.C
Or wherever it was you stored that .C file. Save it. you should be good to go from there. Beyond this I really can't be of too much help. I'm not a programmer at all. If you want her A2 kicks to function just like a normal attack (like a second jumpattack 2 and 3 set), you're going to need something else.
 
I might check that out as well, I'm also investigating Maggas' World Heroes game as nsw25 suggested too. I might not do it that quick though, I'm doing work for today and I'll be doing that when I'm done, so expect a less speedier reply.
 
I've got how the thing works for the kick attacks by using the 'cancel' command. I'm going to use the script for the jump kicks though, they will come in handy. Thanks guys! I'll be posting my progress too, but for now, I got some Cammy to work on first.
 
I got Cammy's moveset going now, but now I got some problems: I'm now going over Cammy's Spin Drive Crusher using com command like this: (the special is named freespecial12, I also modified maxfreespecial to be increased as well)

Code:
com D F A2 freespecial12

but when I executed it, Cammy just stood there and I can't press any more buttons.

Placed the freespecial as special and it works like it should be (although it needs more work so that she would be lifted or something).

Another thing is that once Cammy's finished her special, she just goes back to the beginning offset. What did I do wrong?
 
How? If this is it:

Code:
anim	freespecial12
	delay	6
	offset	40 180
	bbox	27 75 28 106
	frame	Data/Chars/cammy/freespecial12/freespecial12001.gif
	bbox	0 0 0 0
	frame	Data/Chars/cammy/freespecial12/freespecial12002.gif
	attack	145 135 82 21 6 6 1 0 0 0
	delay	4
	frame	Data/Chars/cammy/freespecial12/freespecial12003.gif
	attack	162 134 82 21 6 6 1 0 0 0
	frame	Data/Chars/cammy/freespecial12/freespecial12004.gif
	attack	177 126 81 21 6 6 1 0 0 0
	frame	Data/Chars/cammy/freespecial12/freespecial12005.gif
	attack	201 130 82 21 6 6 1 0 0 0
	frame	Data/Chars/cammy/freespecial12/freespecial12006.gif
	attack	212 129 82 21 6 6 1 0 0 0
	frame	Data/Chars/cammy/freespecial12/freespecial12007.gif
	attack	213 126 82 21 6 6 1 0 0 0
	frame	Data/Chars/cammy/freespecial12/freespecial12008.gif
	delay	6
	attack	0 0 0 0 0 0 0 0 0 0
	frame	Data/Chars/cammy/freespecial12/freespecial12009.gif
	frame	Data/Chars/cammy/freespecial12/freespecial12010.gif
	frame	Data/Chars/cammy/freespecial12/freespecial12011.gif
	frame	Data/Chars/cammy/freespecial12/freespecial12012.gif
	frame	Data/Chars/cammy/freespecial12/freespecial12013.gif
	frame	Data/Chars/cammy/freespecial12/freespecial12014.gif
	frame	Data/Chars/cammy/freespecial12/freespecial12015.gif
	delay	4
	attack	198 49 49 51 7 8 1 0 0 0
	frame	Data/Chars/cammy/freespecial12/freespecial12016.gif
	attack	207 34 49 51 7 8 1 0 0 0
	frame	Data/Chars/cammy/freespecial12/freespecial12017.gif
	attack	216 19 49 51 7 8 1 0 0 0
	frame	Data/Chars/cammy/freespecial12/freespecial12018.gif
	attack	226 4 49 51 7 8 1 0 0 0
	frame	Data/Chars/cammy/freespecial12/freespecial12019.gif
	delay	5
	attack	0 0 0 0 0 0 0 0 0 0
	frame	Data/Chars/cammy/freespecial12/freespecial12020.gif
	frame	Data/Chars/cammy/freespecial12/freespecial12021.gif
	delay	6
	frame	Data/Chars/cammy/freespecial12/freespecial12022.gif
	frame	Data/Chars/cammy/freespecial12/freespecial12023.gif
	offset	184 180
	frame	Data/Chars/cammy/freespecial12/freespecial12024.gif

Frame 1 - 9 is her spinal arrow part, 10 - 19 is her cannon spike part and the rest is end.

EDIT: What I meant by
(although it needs more work so that she would be lifted or something)
is if you played as Cammy, when you use Spin Drive Crasher, the enemy (or enemies) would be lifted as well.
 
you mean Spin Driver Smasher?
Super Freeze - Cammy's Spin Drive Smasher

If you mean the moment where she is spinning on the air, you can make it way easier if you just align her higher on the axis. Its what I did here:
X7WGTZH.png

Or you can move her a bit in the A (now Y) axis with "seta" (but it buggs with platforms) or use BB's "move" script (search for his simple scripts here)
 
I just said it, it's the spin drive smasher.

I think you misunderstood, but if you see the move, the spin drive smasher is composed of a spinal arrow then launches to a cannon spike, thats why I said them as parts, since that's what they are.

I'm trying to use the com command so that I can emulate the attack's command which is Forward, diagonal right, forward and then kick (the SFIV method), but again the problem is there.

...
If you mean the moment where she is spinning on the air, you can make it way easier if you just align her higher on the axis. Its what I did here:
...
Or you can move her a bit in the A (now Y) axis with "seta" (but it buggs with platforms) or use BB's "move" script (search for his simple scripts here)

I'll keep that in mind when doing this, but what do you mean higher, do you have a sample frame from that sprite and the offset you use? I might re-revise the move by separating the spinal arrow part and cannon spike part into separate freespecials to make them flexible.

I somehow got the cancel command going, by setting the hits to zero. I'll try to do that.

Any opinion would be great.
 
When making moves like this adjusting Y axis with move or set is a bad idea. Faking it with offsets is also a poor choice. Think about what happens if you "fly" over a pit? You guessed it - stop instantly in midair and drop like a rock - looks pretty stupid. Now you might think antigravity is the way to go, and that can work, but because it's a permanent setting you have to monitor it, deal with interruptions, conflicts etc. and write a LOT of code for little benefit.

The good news: We devs thought of this some time ago and gave you a tailor made tool: Tosstime.

Tosstime is an entity property that tells the engine when gravity should be applied as opposed to antigravity which tells the engine how much gravity to apply. It's perfect for when you need a temporary reprieve from the engine's gravity. The formula is pretty simple:

If tosstime <= elapsed time, gravity applies.

So by setting tosstime to X + elapsed time, the entity is unaffected by gravity for X time. The beauty is, it's self resetting. Once set, you can forget it unless you specifically want to set it again or turn it off. Then you are free to send her flying with jumpframe or velocity commands. Just think of it the same way you would freezetime. So if Cammy is flying along the ground and gets hit out of it, no problem. She falls normally and no extra scripts needed. She flies over a pit? Well, she either makes it it over or runs out of momentum and falls in - she won't just stop dead and drop.

Give it a try, and O Ill, I'd suggest you look at it for Wolverine. It's really simple and will make the move behave like it should - specially around/over platforms and pits.

DC
 
Think about what happens if you "fly" over a pit? You guessed it - stop instantly in midair and drop like a rock

Actually, no. When Wolverine is over a pit or a hole or executes this move over from a platform edge, he is affected by the gravity normally. This is because I use NULL where I don't want to touch the velocities:

Code:
@cmd velo001 4.5 NULL() NULL()

If I set to 0 those NULL values, then he acts like you said.

But you are right in one situation: where you want the character to move on the air ignoring the gravity (kinda like Wolverine's Drill Claw if you execute it while on the air:
Mugen - Wolverine Drill Claw

Then you should use tosstime. Btw, I think I will use it, thanks.
 
So DC, if done in pseudo code:

say that Cammy's animation is on the first frame of spinal arrow:

tosstime = the time of cammy's entire SDS

is that right? If so I can apply this as:

$ tosstime = {cammy's time}

Sorry, in things like these I like to do logic first before the code parts.

Damon Caskey said:
Then you are free to send her flying with jumpframe or velocity commands.

When you said this, I got to think about the modular approach to SDS, since I can re-recycle the spinal arrow animation (using a variable to cammy that sets if the command used is for SDS) then shifts a variant of the cannon spike animation with higher hit point.

BTW, how to simulate the QCF in com or keyscript?
 
But why you would use QCF in keyscript? You should use that command to trigger the freespecial.
About the modular approach, yes you can use a variable to tell how much spins she will have and makes the spinal arrow as a different animation.
 
I removed my previous comment, because apparently, I misspelled maxfreespecials. Anyway, I meant how do I make diagonals for com?

I did
Code:
com  D D F F A2 freespecial8
and didn't work.
 
ani009 and ani020? Okay, will consider those things. Thanks Maggas, I'll also search for the new versions. I've seen those scripts in DC's blog, but they're dated 2009 and 2011 respectively.

Actually, my maxfreespecials are set to 15, so it's more than what I'm using but I'll consider that.
 
Back
Top Bottom