YesNoOk
avatar

Super Armor using Hitoverride (Read 2680 times)

Started by Zer0degreez, August 15, 2018, 02:52:01 pm
Share this topic:
Super Armor using Hitoverride
#1  August 15, 2018, 02:52:01 pm
  • ***
    • xxlunytun3sxx@aim.com
I'm sorry that you guy have to see this question asked numerous times but I'm better when people just show me once and I'll get it. How exactly would I code super Armor using hitoverride and not cause the move to repeat itself? I'm trying to make one of the characters moves have super armor and I've tried myself but I don't know how exactly to go about it.
http://www.twitch.tv/zer0degr33z

I sometimes stream MUGEN. Join me!
Re: Super Armor using Hitoverride
#2  August 15, 2018, 04:02:32 pm
  • ******
    • www.justnopoint.com/
Re: Super Armor using Hitoverride
#3  August 15, 2018, 09:57:26 pm
  • ***
    • xxlunytun3sxx@aim.com
so I borrowed a code from someone else after looking at Buu and I have activated the super armor so I thought I was done but I've come across another problem.  I applied the super armor to state 1530 and in 1530 it has a change anim that changes it to anim 1531 (this is the whiff or when p2 blocks) but when p2 tries to hit them after blocking, p1 is completely invincible to his attacks.  Is there anyway to fix this? Sorry for putting solved.

Here is the whole 1530 code

Code:

[Statedef 1530]
type    = S
movetype= A                     
physics = N 
anim = 1530                   
juggle = 0                   
ctrl = 0                                               
poweradd = -500                   
sprpriority = -1
facep2 = 1

   
[State -1, Attack_Taker]
type = Helper ;<-----acts as the bodyguard of YOU. The actual armor.....a helper.
triggerall = !NumHelper(9393) ;&& var(30)=1  ;<----Mode variable goes here. If Armor is active all the time or if you do not have a mode var, keep this portion of this trigger nulled.
trigger1 = MoveType != H
stateno = 9393 ;<----stateno of helper definitions
id = 9393


[State -2, ]
type = assertspecial
trigger1 = 1 ;<----Mode variable goes here. If Armor is active all the time or if you do not have a mode var, keep this trigger as is.
flag = noairguard
flag2 = nostandguard
flag3 = nocrouchguard

[State -1, Player_NotHit_During_Armor]
type = HitBy
trigger1 = NumHelper(9393) || NumHelper(9394) ;<---Player (YOU) are only hitby the below parameters when these helpers (the actual armor) is active.
;trigger2 = var(30)=1 ;<----Mode variable goes here. If Armor is active all the time or if you do not have a mode var, keep this trigger as nulled.
value = SCA,AT

[State -1, SprPriority_During_Armor_When_Idle]
type = SprPriority
trigger1 = movetype=I ;<----YOUR sprite priority is the below parameter if your movetype is idle
;trigger2 = var(30)=1 ;<----Mode variable goes here. If Armor is active all the time or if you do not have a mode var, keep this trigger as nulled.
value = -1

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



           

[State -2, Varset]
type = Varset
trigger1 = time = 0
var(38) = 0

[State -2, VarSet]
type = VarSet
trigger1 = time = 0
var(10) = 3

[State -2, VarSet]
type = VarSet
trigger1 = time = 0
var(14) = 0

[State -2, VarSet]
type = VarSet
trigger1 = time = 0
fvar(32) = 0

[State -2, VarAdd]
type = VarAdd
trigger1 = anim = 1530
trigger1 = time > 1
trigger1 = command = "holda" || command = "holdb" || command = "holdc"
fvar(32) = 2

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = !(gametime % 2)
time = 1
color = 0
mul = 256, 224, 0
add = 128, 128, 128
ignorehitpause = 1

[State 0, ExFX]
type = explod
trigger1 = !time
anim = 8210
sprpriority = 3
postype = p1
pos = 20, -85
scale = 0.5, 0.5
pausemovetime = -1
supermovetime = -1
ownpal = 1

[State 1050, ‰¹‚ð–‚炷]
type = PlaySnd
trigger1 = time = 1
value = 2000, 0

[State 1000, NotHitBy]
type = NotHitBy
trigger1 = prevstateno = 40 && var(3) = 1
trigger1 = Time = 0
value = SC, AT
time = 2

[State -2, Position]
type = PosSet
trigger1 = Time = 0
y = 0

[State -2, ChangeAnim]
type = ChangeAnim
triggerall = anim = 1530
trigger1 = var(50) = 0
trigger1 = command != "holda" && command != "holdb" && command != "holdc"
trigger1 = time > 0
trigger2 = var(50) = 1
trigger2 = p2BodyDist X =[-20,20]
trigger2 = time > 0
trigger3 = AnimTime = 0
value = 1531
persistent = 0

[State 1100, HitDef]
type = HitDef
triggerall = !var(24) && !var(5)
triggerall = var(23) != 1530
trigger1 = anim = 1531
trigger1 = p2BodyDist X = [ceil(-20*const(size.xscale)),ceil(23*const(size.xscale))]
trigger1 = (AnimElemtime(3) >= 0) && (AnimElemtime(6) < 0)
attr = S, SA
getpower = 0,0
givepower = 0,0
animtype  = back
air.animtype  = back
damage = ceil((140+fvar(32))*fvar(0)*fvar(23)*fvar(28)*fvar(31)*fvar(33)),ceil(21*fvar(23)*fvar(31))
priority = 5,Hit
hitflag = MAF
guardflag = M
pausetime = 0,18
guard.pausetime = 0,18
sparkno = -1 + 0 * (var(43) := 8013)
guard.sparkno = -1 + 0 * (var(42) := 8001)
sparkxy = -15 + 0 * (var(46) := 155), var(47) := -100
hitsound = S2,6
guardsound = S3,1
ground.type = high
ground.slidetime = 16
ground.hittime = 16
guard.hittime = 14
guard.slidetime = 14
guard.ctrltime = 14
ground.velocity = 0,-14.0*const(size.yscale)
guard.velocity = -8.8*const(size.xscale)
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.type = Low
air.hittime = 16
air.velocity = -1.0*const(size.xscale),-9.0*const(size.yscale) 
fall = 1
fall.recover = 0
fall.envshake.time = 20
fall.envshake.freq = 80
fall.envshake.ampl = -4
air.fall = 1
air.recover = 0
yaccel = .70*const(size.yscale)
envshake.time = 5
envshake.freq = 60
envshake.ampl = 4
forcestand = 1
P2facing = 1
id = 1530
sprpriority = -1 

[State -2, VarSet]
type = VarSet
trigger1 = time = 0
var(23) = 0

[State -2, VarSet]
type = VarSet
trigger1 = time = 0
var(56) = 0

[State 350, 3]
type = posadd
triggerall = anim = 1530
trigger1 = animelemtime(2) = 0
trigger2 = animelemtime(3) = 0
trigger3 = animelemtime(4) = 0
trigger4 = animelemtime(5) = 0
trigger5 = animelemtime(6) = 0
trigger6 = animelemtime(7) = 0
trigger7 = animelemtime(8) = 0
trigger8 = animelemtime(9) = 0
trigger9 = animelemtime(10) = 0
x = 8*const(size.xscale)

[State 350, 3]
type = posadd
triggerall = anim = 1531
trigger1 = animelemtime(1) = 0
trigger2 = animelemtime(2) = 0
trigger3 = animelemtime(3) = 0
trigger4 = animelemtime(4) = 0
x = 8*const(size.xscale)

[State 350, 3]
type = velset
trigger1 = anim = 1530
trigger1 = time = 0
x = 4.4*const(size.xscale)

[State 350, 3]
type = velset
trigger1 = anim = 1531
trigger1 = animelemtime(10) = 0
x = 0

[State 350, 3]
type = velmul
trigger1 = anim = 1531
trigger1 = animelemtime(8) >= 0
x = .90

[State 350, ‰¹‚ð–‚炷]
type = PlaySnd
trigger1 = anim = 1531
trigger1 = AnimElem = 1
value = 0, 3
channel = 0

[State 350, ‰¹‚ð–‚炷]
type = PlaySnd
triggerall = anim = 1530
trigger1 = AnimElem = 3
trigger2 = AnimElem = 7
trigger3 = AnimElem = 12
value = 5100, 0

[State 350, ‰¹‚ð–‚炷]
type = PlaySnd
triggerall = anim = 1531
trigger1 = AnimElem = 4
value = 5100, 0

[State 1000, 3]
type = EnvShake
triggerall = anim = 1530
trigger1 = animelemtime(3) = 0
trigger2 = animelemtime(7) = 0
trigger3 = animelemtime(12) = 0
time = 3
freq = 120
ampl = 3

[State 1000, 3]
type = EnvShake
triggerall = anim = 1531
trigger1 = animelemtime(4) = 0
time = 3
freq = 120
ampl = 3

[State 350, ‰¹‚ð–‚炷]
type = PlaySnd
trigger1 = anim = 1531
trigger1 = AnimElem = 3
value = 1, 2

[State 810, Explod]
type = Explod
trigger1 = anim = 1530
trigger1 = time%2 = 0
trigger1 = animelemtime(1) > 0
trigger2 = anim = 1530
trigger2 = time%2 = 0
trigger2 = animelemtime(3) < 0
anim = 6250
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
bindtime = 1
ownpal = 1
sprpriority = 3
scale = const(size.xscale),const(size.yscale)

[State 810, Explod]
type = Explod
triggerall = anim = 1531
trigger1 = time%2 = 0
trigger1 = animelemtime(5) >= 0
trigger1 = animelemtime(10) < 0
anim = 6250
postype = p1
pos = 0, ceil(-5*const(size.yscale))
velocity = 0, 0
accel = 0, 0
bindtime = 1
ownpal = 1
sprpriority = 3
scale = const(size.xscale),const(size.yscale)

[State 200, Ctrlset]
type = Ctrlset
trigger1 = anim = 1531
trigger1 = AnimelemTime(14) = 1
value = 1

[State 920]
type = StateTypeSet
trigger1 = anim = 1531
trigger1 = AnimelemTime(7) = 0
movetype = I

[State 350, 12]
type = ChangeState
trigger1 = anim = 1531
trigger1 = AnimTime = 0
value = 0
ctrl = 1

and here is the super armor code itself.

Code:
[State 9393, ]
type = BindToRoot ;<---binds this helper to the player. YES Cyanide, you can bind helpers to players if the x and y parameters are omitted. As far as this code goes anyway. Don't believe? Null this, turn on debug mode/clsn mode, and see...
trigger1 = 1
ignorehitpause = 1

[State 9393, ChangeAnim] ;<---copycat's YOU, the player's, animation. Root = YOU, Parent = Helper that spawns another helper.
type = ChangeAnim
trigger1 = selfanimexist(root,anim)
elem = root,animelemno(0)
value = root,anim
[State 9393, ]
type = HitBy ;<----This helper can only be hit by the below parameters
trigger1 = 1
value = SCA,AA,AP

[State 9393, ]
type = AssertSpecial
trigger1 = 1
flag = invisible
flag2 = noshadow ;<----shadows don't appear when something is invisble but i put this trigger here anyway.

[State 9393, ]
type = HitOverride ;<----Changes Helper state 9393 to 9394 if hit by the below parameters. When this occurs, this state (9393) will not exist anymore.
trigger1 = 1
attr = SCA,AA,AP
stateno = 9394
time = -1
slot = 0

[State 9393, ]
type =DestroySelf
trigger1 = root,movetype = I ;<----Mode variable goes here. If Armor is active all the time or if you do not have a mode var, keep this sctrl nulled.

;Excel Armor End ;<----Effects go here
[Statedef 9394]
type = U
movetype = H ;<---getting hit status
physics = N
ctrl = 0

[State 9394, ]
type = BindToRoot
trigger1 = 1
ignorehitpause = 1

[State 9394, ChangeAnim]
type = ChangeAnim
trigger1 = selfanimexist(root,anim)
elem = root,animelemno(0)
value = root,anim

[State 9394, ]
type = NotHitBy
trigger1 = 1
value = SCA

[State 9394, ]
type = AssertSpecial
trigger1 = 1
flag = invisible
flag2 = noshadow

[State 9394, ]
type = ChangeState ;Solidifies single hit attacks from doing multiple hits
trigger1 = 1 
value = 9393

[State 9394, ]
type = DestroySelf
trigger1 = root,movetype = I ;<---gets rid of this helper state after enemy attack lands with some space in between to prevent a single hit from happening more than once. Should be fine as is. Thanx to Cyanide for this portion.
;trigger2 = (root,var(30)!=1) ;<----Mode variable goes here. If Armor is active all the time or if you do not have a mode var, keep this trigger nulled.










http://www.twitch.tv/zer0degr33z

I sometimes stream MUGEN. Join me!