YesNoOk
avatar

Super Armor Strong Punch (Read 1243 times)

Started by Carmell, May 18, 2019, 04:43:36 pm
Share this topic:
Super Armor Strong Punch
#1  May 18, 2019, 04:43:36 pm
  • ***
    • USA
Hello. Ive been working on a character for awhile now and Ive been trying to figure everything out without asking for help but I cant figure out Super Armor even after looking at the guides.

For right now I just want it coded onto to a short wind up strong punch.


 I erased my failed attempt at the code.

Here is what the code is


[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
ctrl = 0
velset = 0,0
anim = 210
sprpriority = -1

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time = 0
trigger1 = var(10) = 0
value = 60

[State 210, Width]
type = Width
trigger1 = (AnimElemTime (2) >= 0) && (AnimElemTime (7) < 0)
value = 15,0

[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 4

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
damage    = 60
guardflag = MA
pausetime = 12,12
sparkno = S1000+random%5 
sparkxy = 0, -100
hitsound   = S0, 1
guardsound = 6,0
ground.type = High
ground.slidetime = 5
ground.hittime  = 10
ground.velocity = -20
air.velocity = -2.5,-4

[State 210, 3]
type = ChangeAnim
trigger1 = AnimElemTime(5) > 0 && AnimElemTime(6) <= 0
trigger1 = movecontact
ignorehitpause = 1
persistent = 0
value = 210
elem = 6

[State 210, 4]
type = SprPriority
trigger1 = AnimElem = 5
value = 2

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 210, 6]
type = VelSet
trigger1 = AnimElem = 7
x = 20




All I want is for the super armor to kick in the same time the velocity changes and end when the strong punch state ends. No special effects beyond that. Thanks for any assistance. Hopefully the lightbulb will go off after I see how you modded it because I would probably like to use this effect again on a different character.


Re: Super Armor Strong Punch
#2  May 18, 2019, 10:11:14 pm
  • avatar
  • **
heres some rough thing i thought up, you need a helper, add this to statdef 210

Code:
[State 210, HelperArmor]
type = Helper
triggerall = !ishelper
trigger1 = numhelper(6000) = 0
triggerall = stateno = 210
triggerall = animelem = 7
id = 6000
name = "Armor"
stateno = 6000
helpertype = player
pos = 0,0
postype = P1
ownpal = 1
ignorehitpause = 1
SuperMoveTime = 99999999
PauseMoveTime = 99999999

Now adding the helper state into a new statedef 6000

Code:
[Statedef 6000]
type        = U
movetype    = I
physics     = N
ctrl        = 1
anim        = -1
velset      = 0,0
sprpriority = 1

[State 6000, 0]
type = ChangeState
trigger1 = !ishelper
value = 0
ctrl = 1

[state a]
type = BindToRoot
trigger1 = 1
time = -1
facing = 1
pos = 0, 0
ignorehitpause=1


[State a]
type = AssertSpecial
trigger1 = 1
flag = Invisible
flag2 = noshadow
ignorehitpause = 1

[state -2]
type=hitoverride
trigger1=ishelper
time=-1
attr=sca,aa,at,ap
slot=0
stateno= 6000
ignorehitpause=1

[state 6000]
type=changeanim
trigger1=ishelper(6000)
trigger1=anim!=root,anim
value=root,anim
ignorehitpause=1

[state a]
type = PlayerPush
trigger1 = 1
value = 1
ignorehitpause=1

[State 1]
type = Turn
trigger1 = Facing != parent,Facing
ignorehitpause = 1

[State 1]
type = DestroySelf
triggerall = root,stateno != 210
trigger2 = roundstate = 2
trigger1 = !root,alive
ignorehitpause = 1
Re: Super Armor Strong Punch
#3  May 19, 2019, 01:15:41 am
  • ***
    • USA
Hmmm something's wrong. Im pretty sure I pasted it right where you wanted me to, but Im not sure I see any effect.

The one thing I can think of is I pasted statedef 6000 into the regular.cns and not the helper.cns, but I thought the helper.cns wasnt actually required and could be named blahblah.cns unless Im mistaken.
Re: Super Armor Strong Punch
#4  May 19, 2019, 01:26:57 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 A permanent Helper or hitoverrides in conjunction of a variable works. I usually use a hitoverrides with variables for super armor simply because my characters are already getting helper intensive with every update to the system mechanics I make, and special cases where a character uses a fair amount of helpers for their moveset like Haruhi does. The best part is that if you only want hyper armor (aka: unbreakable super armor), you don't even need a variable for it.

 Anyway, here is a sample of how my super armor works that should actually be easy to follow.

- In every statedef where you want super armor in, do not use the statedef's anim parameter since it'll reset every time the hitoverride sends you back to this state, instead use the changeanim sctrl with the trigger "trigger1 = prevstateno != 5000 && Anim != (statedef's animation)" to set the state's animation.

- Use a varadd so that it counts up by one every time you enter that state in which will keep track how many times the hitoverride is allowed to send you back here. You only need one var and it can be used for any statedef that is meant to have super armor. If you want to reset the var whenever your super armor expires or you simply leave the state, varset the value to 0 in statedef -2 with triggers including "(prevstateno != 5000 || prevstateno != 5020)", "stateno = 0" and additional triggers where prevstateno = states that are supposed to have super armor. If the state is meant to have hyper armor, skip the varadd altogether.

- Set a hitoverride sctrl in every statedef that is meant to have super armor and have a trigger that applies super armor var with something like "var(?) < #," the # representing how many hits you want super armor to absorb before breaking. If it is hyper armor, skip the trigger step altogether.

- If you want to take damage while super armor is active, use lifeadd with a negative gethitvar(damage) value and you can even divide it so that armor makes you take less damage, floor(-gethitvar(damage)*0.5) will make you take only half the damage from any attack that is armored through. The lifeadd must have a trigger "prevstateno = 5000" for it to work only if the hitoverride is initiated.

- For other stuff like palfx, playsnd, explods, etc that occur whenever super armor absorbs hits, put them in states that have super armor and use "prevstateno = 5000" as a trigger for all of them.

 ... And that's how I do super armor.
 


if you're wondering why I use prevstateno = 5000, it's because your character will actually be in that state for an instant before the hitoverride can actually kick in (or state 5020 if the hitoverride is set to "forceair") according to a long time coder that I happen to be friends with.
Re: Super Armor Strong Punch
#5  May 19, 2019, 01:31:03 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I don't think you need that. I've never once had that issue but i do always specify a passthrough state so hitstun exists.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Super Armor Strong Punch
#6  May 19, 2019, 02:32:56 am
  • ***
    • USA
Okay, I feel pretty stupid because most of this is still going over my head, but I think I can learn if very SLOWLY.



A permanent Helper or hitoverrides in conjunction of a variable works. I usually use a hitoverrides with variables for super armor simply because my characters are already getting helper intensive with every update to the system mechanics I make, and special cases where a character uses a fair amount of helpers for their moveset like Haruhi does. The best part is that if you only want hyper armor (aka: unbreakable super armor), you don't even need a variable for it.

Yeah. My character has quite a few already. The less coding the better because I barely know anything Im doing.

Quote

- In every statedef where you want super armor in, do not use the statedef's anim parameter since it'll reset every time the hitoverride sends you back to this state, instead use the changeanim sctrl with the trigger "trigger1 = prevstateno != 5000 && Anim != (statedef's animation)" to set the state's animation.

so right here youre not talking about triggering the armor at all but warning me of a coding paradox that will be caused by it?

So basically you want me to cut the Anim = 210 out of this segment?

[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
ctrl = 0
velset = 0,0
anim = 210
sprpriority = -1

and remod it to this?

[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
ctrl = 0
velset = 0,0
sprpriority = -1
trigger1 = prevstateno != 5000
Anim != 210


...and since most of your terminology is going over my head at the moment. I guess I'll ask if statedef 5000 is a state that Im supposed to create?

Also while reading your post I realized I guess what I really wanted all along was Hyper Armor. I just didnt know the word for it.

In theory I want the character to tank all the damage unless it KOs him after the armor kicks in.
Re: Super Armor Strong Punch
#7  May 19, 2019, 02:43:51 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 Actually, it would look more like this...

 This here...

Quote
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
ctrl = 0
velset = 0,0
anim = 210
sprpriority = -1

 Would instead look like this

Quote
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
ctrl = 0
velset = 0,0
sprpriority = -1

[State 210, Changeanim]
Type = ChangeAnim
trigger1 = prevstateno != 5000 && Anim != 210
Value = 210
persistent = 0
ignorehitpause = 1

 It's to prevent the animation from resetting whenever the super/hyper armor kicks in.

 Also, since you simply want hyper armor, just skip all the parts that involve vars (the varadd in the hyper armor state and the varset in statedef -2 can be disregarded completely in the steps I've given) and leave out the var based trigger for the hitoverride state controller.

 You don't need to make a statedef 5000 since MUGEN already includes it, although most people make their own custom commons, which if that was what you were doing, you should have finished that way before getting to attacks in the first place. I simply use "prevstateno = 5000" since that's exactly the state where a character goes for an instant before hitoverride kicks in. I've tested it even inside helpers and so did my coding friend and it works.