YesNoOk
avatar

Counter attack, but attacks the helper (Read 466 times)

Started by WastedCoder, June 21, 2021, 11:50:15 AM
Share this topic:
Counter attack, but attacks the helper
#1  June 21, 2021, 11:50:15 AM
  • *
  • Code for coding
  • Are you coding?
    • UK


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.
Code:
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
Coding... over and over again...
Can't stop coding
Re: Counter attack, but attacks the helper
#2  June 21, 2021, 12:20:56 PM
  • ****
  • Objection! Sustained!
    • Russia
    • mitia.pogorelov1@yandex.ru
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).
Re: Counter attack, but attacks the helper
#3  June 21, 2021, 12:40:29 PM
  • *
  • Code for coding
  • Are you coding?
    • UK
Thank you! I was thinking about such a thing but had no Idea how to do it, now I'm gonna try.
Coding... over and over again...
Can't stop coding
Re: Counter attack, but attacks the helper
#4  June 21, 2021, 01:10:29 PM
  • *
  • Code for coding
  • Are you coding?
    • UK
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.
Coding... over and over again...
Can't stop coding
Re: Counter attack, but attacks the helper
#5  June 21, 2021, 01:59:05 PM
  • ****
  • Objection! Sustained!
    • Russia
    • mitia.pogorelov1@yandex.ru
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.
Re: Counter attack, but attacks the helper
#6  June 21, 2021, 06:33:20 PM
  • *
  • Code for coding
  • Are you coding?
    • UK
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 toggle visibilty

Specials
Spoiler, click to toggle visibilty


And my last unfinished try to make Ryuk attack state
Spoiler, click to toggle visibilty

I need to make Ryuk return to his original position after that, but this problem is to be faced later...
Coding... over and over again...
Can't stop coding
Re: Counter attack, but attacks the helper
#7  June 21, 2021, 09:51:03 PM
  • *
  • Code for coding
  • Are you coding?
    • UK
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 toggle visibilty
Coding... over and over again...
Can't stop coding
Re: Counter attack, but attacks the helper
#8  June 22, 2021, 02:19:59 PM
  • *
  • Code for coding
  • Are you coding?
    • UK
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.


Coding... over and over again...
Can't stop coding