News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Problem with Super Armor

Started by TrinitroRoy, April 18, 2014, 09:34:06 AM

Previous topic - Next topic

TrinitroRoy

Hello again,
I decided to give Marisa some Super Armor during one of her LVL3 Spells for quite some time, but I have a big problem.
Marisa doesn't register any hits AT ALL. I also don't like it that I can push Marisa around just because of blue collision.
BTW, here is the -2 code for the Super Armor:

;==============
;Super Armor
;==============

[State -2]
Type = Helper
Triggerall = NumHelper(11777) = 0 ;No duplicates of the helper
Triggerall = NumHelper(11778) = 0
Trigger1 = stateno = 4201 ;Only during this state, you can change the conditions, whenever you need to
OwnPal = 1
PosType = P1
Pos = 0, 0
ID = 11777
StateNo = 11777
PauseMoveTime = 999999
SuperMoveTime = 999999
Name = "SuperArmor"

[State -2]
Type = NotHitBy
Trigger1 = NumHelper(11777) > 0 ;If the superarmor helper is active, the character cannot be hit by anything.
Trigger2 = NumHelper(11778) > 0
value = SCA

[State -2]
Type = NotHitBy
Trigger1 = NumHelper(11777) > 0
Trigger2 = NumHelper(11778) > 0
value2 = SCA ;This is for safety, as another Nothitby might override the first one, so better be safe and apply it to both slots.

[State -2]
type = LifeAdd
trigger1 = NumHelper(11777)
trigger1 = Helper(11777),gethitvar(hitcount) = 1 ;Cannot be on the same line as the 1st trigger1 for some odd reason...
value = -Helper(11777),GetHitVar(Damage) ;This gives damage that the helper bodyguard takes to YOU
kill = 1 ;This controls whether you can be killed when above helper is active

And here is the Super Armor itself:

;-----------------------
; Super Armor Helper Part 1 (created by Seravy, edited by Trinitronity)
[StateDef 11777]
Type = U
MoveType = I
Physics = N
ctrl=0

[State 11777]
Type=StateTypeSet ;You want to mimic the statetype of the player, to let the correct types of attacks hit only
Trigger1=root,statetype=A
Statetype=A

[State 11777]
Type=StateTypeSet
Trigger1=root,statetype=C
Statetype=C

[State 11777]
Type=StateTypeSet
Trigger1=root,statetype=S
Statetype=S

[State 11777]
Type=StateTypeSet
Trigger1=root,statetype=L
Statetype=L

[State 6965]
Type=ChangeAnim ;Helper copies the animation of the player.
Trigger1=anim!=Root,anim
value=Root,anim
ignorehitpause=1

[State 6965]
Type=Assertspecial ;But is invisible
Trigger1=1
flag=invisible
flag2=noshadow
ignorehitpause=1

[State 6965, HitBy]
Type = Hitby
trigger1 = 1
value = SCA, AA, AP, AT

[State 6965, HitOverride]
Type = HitOverride
Trigger1 = 1
Attr = SCA, AA, AP , AT
StateNo = 11778
Time = 1
ForceAir = 0
ignorehitpause=1

[State 6965, BindToRoot]
Type = BindToRoot
Trigger1 = 1
Time = 1
Facing = 1
Pos = 0, 0
ignorehitpause=1

[State 6966, ParentVarAdd]
Type = Hitfallset
Trigger1 = 1
value=0

[State 6965, DestroySelf]
Type = DestroySelf
Trigger1 = stateno != 4201
ignorehitpause = 1

;-----------------------
; Super Armor Helper Part 2
[StateDef 11778]
Type = U
MoveType = H
Physics = N
ctrl=0

[State 11777]
Type=StateTypeSet ;You want to mimic the statetype of the player, to let the correct types of attacks hit only
Trigger1=root,statetype=A
Statetype=A

[State 11777]
Type=StateTypeSet
Trigger1=root,statetype=C
Statetype=C

[State 11777]
Type=StateTypeSet
Trigger1=root,statetype=S
Statetype=S

[State 11777]
Type=StateTypeSet
Trigger1=root,statetype=L
Statetype=L

[State 6965]
Type=ChangeAnim ;Helper copies the animation of the player.
Trigger1=anim!=Root,anim
value=Root,anim
ignorehitpause=1

[State 6965]
Type=Assertspecial ;But is invisible
Trigger1=1
flag=invisible
flag2=noshadow
ignorehitpause=1

[State 6965, NotHitBy]
Type = NotHitby
trigger1 = 1
value = SCA

[State 6965, NotHitBy]
Type = NotHitby
trigger1 = 1
value2 = SCA

[State 6965, HitOverride]
Type = HitOverride
Trigger1 = 1
Attr = SCA, AA, AP , AT
StateNo = 11778
Time = 1
ForceAir = 0
ignorehitpause=1

[State 6965, BindToRoot]
Type = BindToRoot
Trigger1 = 1
Time = 1
Facing = 1
Pos = 0, 0
ignorehitpause=1

[State 6965, DestroySelf]
Type = DestroySelf
Trigger1 = stateno != 4201
ignorehitpause = 1

[State 6965, ChangeState]
Type = ChangeState
Trigger1 = 1
value = 11777

Could someone please help me there? Thanks in advance!
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

Rajaa Retired

The helper is constantly being created and destroyed because you're not using redirection triggers in this code:

[State 6965, DestroySelf]
Type = DestroySelf
Trigger1 = stateno != 4201
ignorehitpause = 1

TrinitroRoy

Ugh, I can't believe I did such a stupid writing mistake. Now it thankfully registers hits, but the opponent can still push Marisa...
Still thanks, though.
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

Rajaa Retired

You can use the playerpush state controller if you want to toggle pushability. =p

http://elecbyte.com/mugendocs-11b1/sctrls.html#playerpush

TrinitroRoy

===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns