Super Armor

Super Armor Tutorial


This one is really simple and requires the disabling of guarding and being thrown. Here's the main states you'll need right below.

;------------------------------------------------------------------------------

; Super Armor

[Statedef 860] ;For this armor we'll be using the stateno's 860-862.

type = S

movetype= I

physics = S

velset = 0,0

;Notice there's no anim here for this state. You'll find out why below.

 

[State 0, LifeAdd] ;This is something I discovered recently. Without this, any opponent with a faulty damage dampener will cause your character to actually restore health and it cannot be undone until the match is over or restarted. Another error I noticed is that without this, the Super Armor will be destroyed before it was intended to be destroyed by your own triggers. Imagine it taking on another version of you along with it's own hp bar equal to the amount of your hp bar. Now let's say you have a regen/cure effect going on. Your characters hp will be restored, but the Super Armor's hp will not be. That's where the error lies. Of course if either of those errors sound interesting to you, then go right ahead and remove this from all 3 states.

type = LifeAdd

trigger1 = 1

value = 999999999

 

[State 800, AssertSpecial] ;This is to absolutely prevent the Super Armor to appear as another character. You wouldn't want your character to have a fully colored clone doing the exact same thing as you only 1 tick slower than you...unless that IS what you want. Then go ahead and remove this, too if you'd like.

type = AssertSpecial

trigger1 = 1

flag = Invisible

flag2 = NoShadow

ignorehitpause = 1

 

[State 800, Turn] ;This is so the Super Armor turns when your opponent is behind you/when you turn.

type = Turn

trigger1 = p2dist X < 0

ignorehitpause = 1

 

[State 800, ChangeAnim] ;This is where the Super Armor gets it's animation. That's why there was no need for an anim earlier. With this, your Super Armor will have the exact same CLSN as you for accuracy when getting hit. If we just used a single CLSN animation for the Super Armor for a standing character, and then say we crouched, that Super Armor's CLSN would be too big for your crouch animation and things that would normaly only hit a standing opponent would hit you even when crouching.

type = ChangeAnim

trigger1 = SelfAnimExist(Root,Anim) ;It reads your characters animation (if it exists).

elem = Root,AnimElemNo(0) ;Then it set's it to your characters elem immediately.

value = Root,Anim ;After setting it to the anim.

 

[State 800, StateTypeSet] ;This is so your Super Armor has more accuracy and prevents your opponents attacks from doing things they shouldn't do. Say they had a move that only hit crouching opponents and this Super Armor was for some reason set to only be crouching, but your character was standing! It would hit you despite not crouching! So the next 3 pieces of coding are for that reason. They read what your statetype is. Standing, crouching, aerial or lying down.

type = StateTypeSet

trigger1 = Root,StateType = S

statetype = S

ignorehitpause = 1

 

[State 800, StateTypeSet]

type = StateTypeSet

trigger1 = Root,StateType = C

statetype = C

ignorehitpause = 1

 

[State 800, StateTypeSet]

type = StateTypeSet

trigger1 = Root,StateType = A

statetype = A

ignorehitpause = 1

 

[State 800, StateTypeSet]

type = StateTypeSet

trigger1 = Root,StateType = L

statetype = L

ignorehitpause = 1

 

[State 800, NotHitBy] ;This is incase you manage to get into a guarding state. You're made unhittable because guarding is not part of this Super Armor and it glitches the Super Armor. If you're guarding somehow while the Super Armor is active, an unblockable attack will hit you as if your Super Armor didn't exist. If that sounds okay to you, then go ahead and remove this!

type = NotHitBy

trigger1 = Root,StateNo = [120,159]

value = SCA

time = 1

ignorehitpause = 1

 

[State 800, BindToParent] ; This is so the Super Armor is attached to you at all times obviously.

type = BindToParent

trigger1 = 1

pos = 0,0

ignorehitpause = 1

 

[State 800, ParentVarSet] ;This var is special. You'll see what it does in the next state. This particular one though is a reset. It resets it back to 0.

type = ParentVarSet

trigger1 = time = 0

v = 2

value = 0

ignorehitpause = 1

 

[State 800, Super Armor Is Hit] ;This is to prevent the Super Armor from turning into a gethit state or from being removed. Whenever it gets hit, it immediately goes into state 861 where the damage taken is calculated.

type = HitOverride

trigger1 = 1

attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

stateno = 861

time = -1

 

[State 800, Super Armor Is Destroyed] ;This is so the Super Armor is destroyed when you die or if you have too many activated. Only 1 is necessary.

type = ChangeState

trigger1 = Parent,Life = 0

trigger2 = Parent,NumHelper(860) > 1

value = 862

ignorehitpause = 1

;------------------------------------------------------------------------------

; Super Armor Hit

[Statedef 861] ;This is the state the Super Armor goes into whenever it gets hit. Or should I say when you get hit. Either way.

type = S

movetype= H

physics = S

ctrl = 0

velset = 0,0

 

[State 0, LifeAdd]

type = LifeAdd

trigger1 = 1

value = 999999999

 

[State 801, AssertSpecial]

type = AssertSpecial

trigger1 = 1

flag = Invisible

flag2 = NoShadow

ignorehitpause = 1

 

[State 801, Turn]

type = Turn

trigger1 = p2dist X < 0

ignorehitpause = 1

 

[State 800, ChangeAnim]

type = ChangeAnim

trigger1 = SelfAnimExist(Root,Anim)

elem = Root,AnimElemNo(0)

value = Root,Anim

 

[State 801, StateTypeSet]

type = StateTypeSet

trigger1 = Root,StateType = S

statetype = S

ignorehitpause = 1

 

[State 801, StateTypeSet]

type = StateTypeSet

trigger1 = Root,StateType = C

statetype = C

ignorehitpause = 1

 

[State 801, StateTypeSet]

type = StateTypeSet

trigger1 = Root,StateType = A

statetype = A

ignorehitpause = 1

 

[State 801, StateTypeSet]

type = StateTypeSet

trigger1 = Root,StateType = L

statetype = L

ignorehitpause = 1

 

[State 801, NotHitBy]

type = NotHitBy

trigger1 = Root,StateNo = [120,159]

value = SCA

time = 1

ignorehitpause = 1

 

[State 801, BindToParent]

type = BindToParent

trigger1 = 1

pos = 0,0

ignorehitpause = 1

 

[State 801, ParentVarSet] ;This var essentially reads the amount of damage taken divided by the amount of hits taken.

type = ParentVarSet

trigger1 = time = 0

v = 2

value = Floor(GetHitVar(Damage) / GetHitVar(HitCount))

 

[State 801, Super Armor Is Destroyed] ;Again. If you're dead, it dies too. It goes to state 862 where it gets destroyed for good.

type = ChangeState

trigger1 = Parent,Life = 0

value = 862

ignorehitpause = 1

 

[State 801, Super Armor Still Exists] ;If you're not dead then it goes back to state 860.

type = ChangeState

trigger1 = Time = 1

value = 860

;------------------------------------------------------------------------------

; Super Armor Destroyed

[Statedef 862] ;This is just the state for the the Super Armor is destroyed. It's coded to maintain its animations, CLSN's and whatnot so as to not glitch when it's being destroyed, but there's nothing special here. If you'd like, add some effects here to make it apparent that it's being destroyed in-game.

type = S

movetype= I

physics = N

ctrl = 0

velset = 0,0

 

[State 0, LifeAdd]

type = LifeAdd

trigger1 = 1

value = 999999999

 

[State 802, AssertSpecial]

type = AssertSpecial

trigger1 = 1

flag = Invisible

flag2 = NoShadow

ignorehitpause = 1

 

[State 802, Turn]

type = Turn

trigger1 = p2dist X < 0

ignorehitpause = 1

 

[State 800, ChangeAnim]

type = ChangeAnim

trigger1 = SelfAnimExist(Root,Anim)

elem = Root,AnimElemNo(0)

value = Root,Anim

 

[State 802, StateTypeSet]

type = StateTypeSet

trigger1 = Root,StateType = S

statetype = S

ignorehitpause = 1

 

[State 802, StateTypeSet]

type = StateTypeSet

trigger1 = Root,StateType = C

statetype = C

ignorehitpause = 1

 

[State 802, StateTypeSet]

type = StateTypeSet

trigger1 = Root,StateType = A

statetype = A

ignorehitpause = 1

 

[State 802, StateTypeSet]

type = StateTypeSet

trigger1 = Root,StateType = L

statetype = L

ignorehitpause = 1

 

[State 802, NotHitBy]

type = NotHitBy

trigger1 = Root,StateNo = [120,159]

value = SCA

time = 1

ignorehitpause = 1

 

[State 802, BindToParent]

type = BindToParent

trigger1 = 1

pos = 0,0

ignorehitpause = 1

 

[state 802, Super Armor Is Destroyed]

type = DestroySelf

trigger1 = Time = 1

ignorehitpause = 1

Now here's the coding for disabling your guarding.

[State -2, AssertSpecial] ;As you can see this goes into your -2 statedef and is only triggered when the Super Armor is active AND you're alive.

type = AssertSpecial

trigger1 = Alive && NumHelper(860)

flag = nostandguard

flag2 = nocrouchguard

flag3 = noairguard

 

Now as I'm sure you noticed, the var that was set earlier was a PARENT var. Meaning it's workings are done elsewhere. And that's the coding right below which belongs in your -3 statedef.

 

;---------------------------------------------------------------------------

; Super Armor

[State -3, NotHitBy] ;You know what this is. The one from earlier was so your Super Armor couldn't get hit. This one is so YOU can't get hit. When guarding.

type = NotHitBy

trigger1 = numhelper(860)

trigger1 = StateNo != [120,159]

value = SCA

time = 1

 

[State -3, LifeAdd] ;There is where your damage gets calculated and then added to your hp. As you can see, it's triggered whenever the var exists and then your life is subtracted by the amount of that var.

type = LifeAdd

trigger1 = Alive = 1

trigger1 = numhelper(860)

trigger1 = Var(2)

time = 1

value = -Var(2)

 

[State -3, LifeAdd] ;This is the second part of the damage calculating process. It's only activated when the var DOESN'T exist. This is to remove the damage/hitcount once your taking of damage is over.

type = LifeAdd

trigger1 = Alive = 1

trigger1 = MoveType = H

trigger1 = StateNo != [120,159]

trigger1 = numhelper(860) && !Var(2)

value = -Floor(GetHitVar(Damage) / GetHitVar(HitCount))

 

[State -3, SelfState] ;This is to ensure your Super Armor isn't cheated through. If it exists and you go into a hitstate, it whips you back to your standing state, but what if that managed to happen while you were in the air?

type = SelfState

trigger1 = Alive = 1

trigger1 = MoveType = H

trigger1 = StateNo != [120,159]

trigger1 = StateType != A

trigger1 = numhelper(860)

value = 0

ctrl = 1

 

[State -3, SelfState] ;Boom. If it happens while you're in the air it whips you into a falling from a jump state.

type = SelfState

trigger1 = Alive = 1

trigger1 = MoveType = H

trigger1 = StateNo != [120,159]

trigger1 = StateType = A

trigger1 = numhelper(860)

value = 50

ctrl = 1

And that's pretty much it. Put these states in their proper place and you'll have an awesome working Super Armor. You'll need to use a helper to choose when it spawns. The piece of coding I always use without all of that useless cluttering coding is below, but other than that, I hope this was helpful and enjoy!

[State 0, Super Armor Helper] ;If you decide to put this in your -2 statedef (for a permanent Super Armor I assume), then persistent = 0 will NOT work and you'll need to provide some triggers to prevent multiple spawnings. The triggers now should suffice, but it never hurts to be on the cautious side to prevent glitches in your character.

type = Helper

trigger1 = NumHelper(860) = 0

trigger1 = Alive

stateno = 860

id = 860

name = "Armor"

keyctrl = 0

ownpal = 1

persistent = 0

Tuesday
23/April/2024
04:05
Search
Site friends