News:

MFG's Character of the Month: September 2026 Voting

Main Menu

Counter attack, but attacks the helper

Started by WastedCoder, June 21, 2021, 11:50:15 AM

Previous topic - Next topic

WastedCoder



So basically, I have the first state made, but then I want, when Light is attacked, Ryuck to attack P2 instead of Light just teleporting behind. I can't understand how to make it. Because reversedaldef turns Light into Ryuk and teleports him behind p2. I am super new at coding. These are the states of the move I borrowed from the other char. All I need is to make Light stay where he is and Ryuk to trigger and play the animation I made in FF3.
Counter
[Statedef 11130]
type    = S
movetype= I
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 11130
poweradd = -250
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,43
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,43
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,43
volume = 999

[State 3000, SuperPause]
type = SuperPause
trigger1 = time = 0
time = 30
movetime = 30
anim = -1
sound = -1
pos = 32,-80
darken = 0
unhittable = 1

[State 3000, VarSet]
type = Varset
trigger1 = time = 0
v = 12
value = -100

[State 3000, VarSet]
type = Varset
trigger1 = time = 30
v = 12
value = 0

[State 3000, VarAdd]
type = VarAdd
trigger1 = time >= 20 && Var(12) < 0
v = 12
value = 6

[State 3000, BGColorFX]
type = BGPalFX
trigger1 = Time > 0
time = 1
add = Var(12),Var(12),Var(12)

[State 3000, Super Charge]
type = Explod
trigger1 = Time = 0
anim = 7400
ID = 7400
pos = 1*Helper(999999),Fvar(16),-25*Helper(999999),Fvar(16)
sprpriority = 2
supermove = 1
removetime = -2
bindtime = -1
ownpal = 1
scale = .2*Helper(999999),Fvar(16),.2*Helper(999999),Fvar(16)
removeongethit = 1
ontop = 1
supermovetime = 999
ignorehitpause  = 1

[State 3000, PlaySnd - Super Charge]
type = PlaySnd
trigger1 = Time = 0
value = S950,1
volume = 50

[State 0, ReversalDef]
type = ReversalDef
trigger1 = time = [30,50]
reversal.attr = SCA,NA,SA,NP,SP,NT,ST
pausetime = 0,30
sparkno = -1
hitsound = -1
p1stateno = 11131

[State 200, End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;-------------------------------------------------------------------------------
; Counter - Fin
[Statedef 11131]
type    = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
poweradd = -500
anim = 11131
sprpriority = -1


[State 0, Viento]
type = Explod
trigger1 = animelem = 2
anim = 7022
ID = 1051
pos = 10*Helper(999999),Fvar(16),10
postype = p1
scale = .7*Helper(999999),Fvar(16),.7*Helper(999999),Fvar(16)
sprpriority = 2
ontop = 1
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "Corte P2"
ID = 990
stateno = 990
pos = 0,-25
postype = p2
ownpal = 1
ignorehitpause = 1
size.xscale = .2
size.yscale = .2

[State 1050,Afterimage]
type = AfterImage
trigger1 = time = 1
time = 45
trans = add
length = 5
timegap = 1
framegap = 1
palbright = 10 , 10 , 10
palcontrast = 100, 100, 100
paladd = 0,0,0
palmul = .90, .90, .90
[State 0, Soru]
type = Explod
trigger1 = time = 2
anim = 580
ID = 101
pos = 0,-20*Helper(999999),Fvar(16)
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
scale = .3*Helper(999999),Fvar(16),.3*Helper(999999),Fvar(16)
sprpriority = -1
ontop = 0
ownpal = 1
removeongethit = 1
ignorehitpause = 1
Trans = sub

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 10
value = S0,8
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 10
value = S0,8
volume = 999

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S40,2
volume = 50

[State 0, PlayerPush]
type = PlayerPush
trigger1 = time < 10
value = 0

[State 0, VelSet]
type = VelSet
trigger1 = time = 2
x = 20

[State 0, VelSet]
type = VelSet
trigger1 = p2bodydist x < -30*Helper(999999),Fvar(16)
x = 0

[State 0, Turn]
type = Turn
trigger1 = time = 10

[State 0, Corte FX]
type = Explod
trigger1 = time = 17
anim = 7204
ID = 7200
pos = 0*Helper(999999),Fvar(16),-25*Helper(999999),Fvar(16)
postype = p1
facing = 1
vfacing = -1
bindtime = -1
scale = .6*Helper(999999),Fvar(16),.3*Helper(999999),Fvar(16)
sprpriority = 2
ontop = 1
ownpal = 1
removeongethit = 1
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 15
value = S5,16
volume = 50

[State 0, EnvShake]
type = EnvShake
trigger1 = moveguarded
trigger1 = time%15=10
time = 5
freq = 90
ampl = -6
phase = 20
ignorehitpause = 1
[State 670, Bind 1]
type = TargetBind
trigger1 = movecontact =1
pos = 34,-5


[State 200, 1]
type = HitDef
triggerall = !movecontact
trigger1 = 1
attr = S, SA
animtype  = Heavy
damage    = 100,40
Hitflag = MAFDE
guardflag = MA
pausetime = 0,12
sparkno = -1
guard.sparkno = s7000
sparkxy = -8,-25
hitsound   = S1,22
guardsound = S4,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4,-6
air.velocity = -4,-6
Fall = 1
EnvShake.time = 10
EnvShake.ampl = -4
EnvShake.freq = 75
EnvShake.phase = 99
Getpower = 0,0
[State 0, Blood Spark]
type = Explod
trigger1 = movehit = 1 && numexplod(7005) = 0
anim = 7005
ID = 7005
pos = 0,-30*Helper(999999),Fvar(16)
postype = p2
facing = -1
scale = 1*Helper(999999),Fvar(16),1*Helper(999999),Fvar(16)
sprpriority = 2
ontop = 1
ownpal = 1
ignorehitpause = 1


[State 0, Spark Corte Random]
type = Helper
triggerall = numhelper(800) = 0
trigger1 = movehit = 1
helpertype = normal
name = "Spark Corte Random"
ID = 800
stateno = 800
pos = 0,-30
postype = p2
facing = -1
ownpal = 1
size.xscale = .5*Helper(999999),Fvar(16)
size.yscale = .5*Helper(999999),Fvar(16)
supermovetime = 999
ignorehitpause  = 1

[State 0, AllPalFX]
type = BGPalFX
trigger1 = time%3=0
time = 2
add = -50,-50,-50
mul = 256,256,256
color=128

[State 200, End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

Trololo

Simple, really. You'll need to:
-Make a ReversalDef that turns Light into "Gotcha!" state.
-Make an attack state for Ryuk, and make him react to Light's "Gotcha!" state (root, stateno).

WastedCoder

Thank you! I was thinking about such a thing but had no Idea how to do it, now I'm gonna try.

WastedCoder

Nah, I don't seem to understand how to do it. I'm reading it over and over again, I mean, The MUGEN Docs Master Thread, where everything is explained, but have no clue, what to use and how. I have no clue when do I use 'parent, helper, root' and all other things, like, it goes after "trigger" or what?... It would be nice If someone could, please, explain it to me with some more details.

:D Plus, I need some time to make an attack state for Ryuk, 'cause I'm not completely sure how to make it either. I made animations and now need to make it rush into the player2, enemy, basically, and then return to his normal position.

Trololo

Well, with how to make him RETURN back I can't help you. You could look at some version of CvS Nakoruru for that.
Now, "root" and "parent" are sub-triggers, that are used as parts of triggers FOR HELPERS to refer to something it WAS BORN FROM (Parent, it could not only be the player, but some different helper) or to the ROOT player. To understand this thing better you need to practice with it.
Is you want Helper to be triggered by something from its parent helper or the player itself, you use these sub-triggers correspondingly: "root, stateno" literally means, that the trigger for a thing in helper is root player's state. Meaning, Ryuk will use his attack when Light enters listed state.

WastedCoder

Okay, this is it for today. I spent the whole day trying to figure out, but for now I'm leaving it like this. I deleted attack state for Ryuk, since it needs a huge rework and I don't like what I've done there. Here is the code for Light that activates counter and then after he's hit sends him to the state 11131, which should activate Ryuk's attack state, but in-game debug says it "has no parent/root" depending on what I'm messing with(it doesn't see Light as a parent?) also I haven't figured out how to make the main Ryuk disappear while Ryuk-helper attacks the target. Any help would be highly appreciated.
CMD
Spoiler (click to show)
Counter
[State -1,Ryuk Counter]
type = ChangeState
Triggerall = power >= 1000
value = 11130
;triggerall = numhelper(4000) = 0
;triggerall = numhelper(4010) = 0
;triggerall = numhelper(4011) = 0
;triggerall = numhelper(4015) = 0
;triggerall = numhelper(4020) = 0
triggerall = command = "SPECIAL 8"
Triggerall = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200 && movecontact
trigger3 = stateno = 210 && movecontact
trigger4 = stateno = 300 && movecontact
trigger5 = stateno = 310 && movecontact
trigger6 = numhelper(700) = 0

Specials
Spoiler (click to show)
Counter
[Statedef 11130]
type    = S
movetype= I
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 11130
poweradd = -250
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,43
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,43
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,43
volume = 999

[State 3000, SuperPause]
type = SuperPause
trigger1 = time = 0
time = 30
movetime = 30
anim = -1
sound = -1
pos = 32,-80
darken = 0
unhittable = 1

[State 3000, VarSet]
type = Varset
trigger1 = time = 0
v = 12
value = -100

[State 3000, VarSet]
type = Varset
trigger1 = time = 30
v = 12
value = 0

[State 3000, VarAdd]
type = VarAdd
trigger1 = time >= 20 && Var(12) < 0
v = 12
value = 6

[State 3000, BGColorFX]
type = BGPalFX
trigger1 = Time > 0
time = 1
add = Var(12),Var(12),Var(12)

[State 3000, Super Charge]
type = Explod
trigger1 = Time = 0
anim = 7400
ID = 7400
pos = 1*Helper(999999),Fvar(16),-25*Helper(999999),Fvar(16)
sprpriority = 2
supermove = 1
removetime = -2
bindtime = -1
ownpal = 1
scale = .2*Helper(999999),Fvar(16),.2*Helper(999999),Fvar(16)
removeongethit = 1
ontop = 1
supermovetime = 999
ignorehitpause  = 1

[State 3000, PlaySnd - Super Charge]
type = PlaySnd
trigger1 = Time = 0
value = S950,1
volume = 50

[State 0, ReversalDef]
type = ReversalDef
trigger1 = time = [30,50]
reversal.attr = SCA,NA,SA,NP,SP,NT,ST
pausetime = 0,30
sparkno = -1
hitsound = -1
p1stateno = 11131

;[State 0, Ryuk]
;type = Helper
;trigger1 = parent, stateno = 11131
;helpertype = normal
;name = "Ryuk"
;ID = 11132
;stateno = 11132
;pos = -30*Helper(999999),Fvar(16),-30*Helper(999999),Fvar(16)
;postype = p1
;ownpal = 1
;size.xscale = 1*Helper(999999),Fvar(16)
;size.yscale = 1*Helper(999999),Fvar(16)

[State 200, End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-------------------------------------------------------
;Light laugh -
[Statedef 11131]
type = S
movetype = I
physics = S
anim = 11131
velset = 0,0
ctrl = 0
poweradd = 0
juggle = 0
facep2 = 1
sprpriority = 2
;movehitpersist = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,43
volume = 999

[State 200, End]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1


And my last unfinished try to make Ryuk attack state
Spoiler (click to show)
; Counter - ryuk attack OLD CODE
;[Statedef 11132]
;type    = A
;movetype= A
;physics = N  ;S
;juggle  = 5
;velset = 0,0
;ctrl = 0
;poweradd = -500
;anim = 11132
;sprpriority = 3

;[State 0, Ryuk]
;type = Helper
;triggerall = numhelper(1601) = 0
;trigger1 = time = 0
;helpertype = normal
;name = "Ryuk"
;ID = 11132
;stateno = 11132
;pos = -30,-30
;postype = p1
;facing = 1
;keyctrl = 0
;ownpal = 1
;supermovetime = 999
;ignorehitpause  = 1



;[State 11132, 1]
;type = ChangeState
;trigger1 = RootDist X <= -30
;value = 9501

;[State 11132, 2]
;type = VelSet
;trigger1 = RootDist X <= -30
;x = 0
;y = 0

;[State 0, PlaySnd]
;type = PlaySnd
;trigger1 = time = 0
;value = S0,43
;volume = 999;

;[State VelAdd]
;type = veladd
;trigger1 = time = 60
;x = 1

;[State 0,AfterImage]
;type = AfterImage
;trigger1 = (!Time)
;time = -1
;framegap = 1
;length = 30
;paladd = 0, 0, 0
;palmul = .90, .90, .90
;palcontrast = 100, 100, 100
;trans = add

;[State 200, 1]
;type = HitDef
;triggerall = !movecontact
;trigger1 = 1
;attr = A, SA
;animtype  = Heavy
;damage    = 100,40
;Hitflag = MAF
;guardflag =
;pausetime = 0,12
;sparkno = -1
;guard.sparkno = s7000
;sparkxy = -8,-25
;hitsound   = S1,22
;guardsound = S4,1
;ground.type = High
;ground.slidetime = 12
;ground.hittime  = 15
;ground.velocity = -4,-6
;air.velocity = -4,-6
;Fall = 1
;EnvShake.time = 10
;EnvShake.ampl = -4
;EnvShake.freq = 75
;EnvShake.phase = 99
;Getpower = 0,0

;[State 200, End]
;type = Destroyself
;trigger1 = AnimTime = 0
;trigger2 = root,stateno != 210

I need to make Ryuk return to his original position after that, but this problem is to be faced later...

WastedCoder

I haven't given up and remade it. Now it works, at least somehow. I decided to choose the other way, so before I continue working on it, if you know how to improve it, so it doesn't look like it looks now, feel free to reply,


Spoiler (click to show)
[Statedef 11130]
type    = S
movetype= I
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 11130
poweradd = -250
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,43
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,43
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,43
volume = 999

[State 3000, SuperPause]
type = SuperPause
trigger1 = time = 0
time = 30
movetime = 30
anim = -1
sound = -1
pos = 32,-80
darken = 0
unhittable = 1

[State 3000, VarSet]
type = Varset
trigger1 = time = 0
v = 12
value = -100

[State 3000, VarSet]
type = Varset
trigger1 = time = 30
v = 12
value = 0

[State 3000, VarAdd]
type = VarAdd
trigger1 = time >= 20 && Var(12) < 0
v = 12
value = 6

[State 3000, BGColorFX]
type = BGPalFX
trigger1 = Time > 0
time = 1
add = Var(12),Var(12),Var(12)

[State 3000, Super Charge]
type = Explod
trigger1 = Time = 0
anim = 7400
ID = 7400
pos = 1*Helper(999999),Fvar(16),-25*Helper(999999),Fvar(16)
sprpriority = 2
supermove = 1
removetime = -2
bindtime = -1
ownpal = 1
scale = .2*Helper(999999),Fvar(16),.2*Helper(999999),Fvar(16)
removeongethit = 1
ontop = 1
supermovetime = 999
ignorehitpause  = 1

[State 3000, PlaySnd - Super Charge]
type = PlaySnd
trigger1 = Time = 0
value = S950,1
volume = 50

[State 0, ReversalDef]
type = ReversalDef
trigger1 = time = [30,50]
reversal.attr = SCA,NA,SA,NP,SP,NT,ST
pausetime = 0,30
sparkno = -1
hitsound = -1
p1stateno = 11131

[State 200, End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;-------------------------------
;Light laugh - counter end
[Statedef 11131]
type = S
movetype = I
physics = S
anim = 11131
velset = 0,0
ctrl = 0
poweradd = 0
juggle = 0
facep2 = 1
sprpriority = 2
;movehitpersist = 1

;[State 0, PlaySnd]
;type = PlaySnd
;trigger1 =
;value = S0,0
;volumescale = 0
;channel = -1
;lowpriority = -1
;freqmul = 1.0
;loop = 0
;pan = 0
;abspan =
;ignorehitpause =
;persistent =


[State 0, Ryuk]
type = Helper
trigger1 = time = 10
helpertype = normal
name = "Ryuk"
ID = 11132
stateno = 11132
pos = -30*Helper(999999),Fvar(16),-30*Helper(999999),Fvar(16) ;ifelse(p2bodydist x<10,-5,20)*Fvar(16),0*Fvar(16)
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 999 ;ifelse(numhelper(1310)=1,999,20)
ignorehitpause  = 1
size.xscale = 1*Helper(999999),Fvar(16)
size.yscale = 1*Helper(999999),Fvar(16)

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = time > 50 && time%42 = 0
trigger1 = numhelper(11132) = 1
value = 4000
elem = 1

[State 0, CtrlSet]
type = CtrlSet
triggerall = time > 50
trigger1 = numhelper(11132) < 1
value = 1

[State 200, End]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1
;-------------------------------------------------------------------------
;Ryuk attack - start
[Statedef 11132]
type    = A
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 11132
sprpriority = 4

[State 0, SuperPause]
type = SuperPause
trigger1 = time = 0
time = 40
anim = -1
sound = S10,0
pos = 0,0
movetime = 0
darken = 1
p2defmul = 1
poweradd = 0
unhittable = 1
;ignorehitpause =
;persistent =


[State 0, Turn]
type = Turn
trigger1 = facing != root,facing

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

;[State 0, PlaySnd]
;type = PlaySnd
;trigger1 = time = 0
;value = S0,206
;volumescale = 175
;channel = 3

;[State 0, PlaySnd]
;type = PlaySnd
;trigger1 = time = 0
;value = S1,18
;volumescale = 150

;[State 0, Trans]
;type = Trans
;trigger1 = time < 35
;trans = addalpha
;alpha = 0+time*50,256-time*50

[State 0, VelAdd]
type = VelAdd
trigger1 = time = 10
x = 10
y = 1     
;ignorehitpaaauase =
;persistent =


[State 200, 1]
type = HitDef
triggerall = !movecontact
trigger1 = 1
attr = S, NA
animtype  = Light
damage    = 160,80
guardflag = MA
pausetime = 0,15
guard.pausetime = 0,30
sparkno = -1
guard.sparkno = s7000
sparkxy = -8,-25
hitsound   = -1
guardsound = S4,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4,-5
air.velocity = -4,-5
guard.velocity = -2.5
Fall = 1
fall.recover = 0
sprpriority = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S3,2
volumescale = 175

;[State 0, EnvShake]
;type = EnvShake
;trigger1 = animelem = 3
;time = 45
;ampl = -4

;[State 0, P2]
;type = Helper
;trigger1 = animelem = 3
;helpertype = normal
;name = "Spark"
;ID = 7010
;stateno = 7010
;pos = 18*root,fvar(16),0*root,fvar(16)
;postype = p1
;facing = 1
;ownpal = 1
;size.xscale = .75*root,fvar(16)
;size.yscale = .75*root,fvar(16)
;ignorehitpause = 0
;supermovetime = 999

[State 0, End]
type = Changestate
trigger1 = animtime = 0
;trigger2 = root, stateno != 11132
;trigger3 = root, movetype = H
value = 11133

;---------------------------------------------------------------------------
;Ryuk attack - end
[Statedef 11133]
type    = A
movetype= I
physics = S
juggle  = 1
velset = rootdist x / 30,0
ctrl = 0
anim = 11133
sprpriority = 4

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 0, Trans]
type = Trans
trigger1 = time > 0
trans = addalpha
alpha = 256-time*25,0+time*25

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S1,18
volumescale = 150

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 10

WastedCoder

So, I think, I've made it. Maybe in a lil' bit different way, but it works at least. Maybe could've been done better, but this is my first time, so, for now, I'm leaving it like this. Maybe I'll rework it.