YesNoOk
avatar

[Coding] How to make multi-hitting Helper-Type Projectile work with Hitoverride? (Read 2712 times)

Started by Redash, May 13, 2018, 12:01:54 pm
Share this topic:
[Coding] How to make multi-hitting Helper-Type Projectile work with Hitoverride?
#1  May 13, 2018, 12:01:54 pm
  • avatar
  • **
    • Singapore
Hi all,

I am coding for event where a MULTI-HITTING helper-type projectile interacts with an enemy projectile.

PROBLEM: Multi-hit HELPER_Projectile "Goes thru enemy projectiles" and does not disappear or reduce hits...
GOAL: Multi-hit HELPER_Projectile to interact properly with enemy projectiles.

My code as below:

Code:
[Statedef 2200, Char_Stance]
type = S
movetype = A
physics = S
juggle = 0
poweradd = 0
ctrl = 0
velset = 0,0
anim = 2200
sprpriority = 0
facep2 = 1

[State 2200, HELPER_Projectile]
type = Helper
trigger1 = (AnimElemTime(11) = 0)
name = "HELPER_Projectile" ; multihitting
id = 2200
stateno = 2203
pos = 60,-55
postype = p1
facing = 1
keyctrl = 1
ownpal = 1
supermovetime = 0
pausemovetime = 0
;size.xscale =
;size.yscale =
;size.ground.back =
;size.ground.front =
;size.air.back =
;size.air.front =
;size.height =
;size.proj.doscale =
;size.head.pos = ,
;size.mid.pos = ,
;size.shadowoffset =
ignorehitpause = 0
persistent = 1

[State 2200, END_Char_Stance]
type = ChangeState
trigger1 = (AnimTime = 0)
value = 0
ctrl = 1
;anim =
;ignorehitpause =
;persistent =

;========================================================================

[Statedef 2203, HELPER_Projectile_Part1]
type = A
movetype = A
physics = N
juggle = 0
poweradd = 0
ctrl = 0
velset = 1,0
anim = 2210 ; HELPER_Projectile initiating anim
sprpriority = 2 ; front of Character
;facep2 = 0

[State 2203, AssertSpecial]
type = AssertSpecial
trigger1 = (Time >= 0)
flag = NoShadow
;ignorehitpause =
persistent = 1

[State 2203, Var(25)Set] ;<= for tracking number of HITS total by this HELPER_Projectile
type = VarSet
trigger1 = (AnimElemTime(1) = 0)
v = 25
value = 0
;ignorehitpause =
;persistent =

[State 2203, END_HELPER_Projectile_Part1]
type = ChangeState
trigger1 = (AnimTime = 0)
value = 2204
ctrl = 1

; ------------------------------------------------------------------------------------------
[Statedef 2204, HELPER_Projectile_Part2]
type = A
movetype = A
physics = N
juggle = 0
poweradd = 0
ctrl = 0
velset = 2,0
anim = 2211 ; HELPER_Projectile
sprpriority = 2 ; front of Character
;facep2 = 0

[State 2204, AssertSpecial]
type = AssertSpecial
trigger1 = (Time >= 0)
flag = NoShadow
;ignorehitpause =
persistent = 1

[State 2204, END1_HELPER_Projectile_Part2]
type = HitOverride
trigger1 = (Root,NumHelper(2200) != 0)
attr = SCA,NP,SP,HP
slot = 0
stateno = Cond(var(25) < 10, 2204, 2205)  ; <= NOTE: To MugenGuild Experts, I do not know what else to code
time = -1
forceair = 0
ignorehitpause = 1
persistent = 1

[State 2204, Var(25)Add] ; tracking total hits
type = VarAdd
trigger1 = (MoveContact = 1)
v = 25
value = 1
ignorehitpause = 1
persistent = 1

[State 2204, HitDef]
type = HitDef
trigger1 = (AnimElemTime(1) >= 0) && (var(25) <= 10) && (Time % 6 = 0) ; 90 ticks total in hit stun
attr = A,SP
hitflag = MAFP
guardflag = MA
;affectteam = E
animtype = Heavy
air.animtype = Back
fall.animtype = Back
priority = 4,Hit
damage = 1,3
pausetime = 0,10
guard.pausetime = 0,10
sparkno = s2005
;guard.sparkno =
;sparkxy = (Enemy,Pos X),(Enemy,Pos Y)
hitsound = S1,0
guardsound = S2,0
ground.type = High
air.type = Low
ground.slidetime = 20
guard.slidetime = 10
ground.hittime = 20
guard.hittime = 10
air.hittime = 20
guard.ctrltime = 10
guard.dist = 100
yaccel = 0.5
ground.velocity = -5,0
guard.velocity = -5
air.velocity = -5,2
airguard.velocity = -5,2
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
airguard.ctrltime = 10
;air.juggle = 0
;mindist = 0,0
;maxdist = 0,0
;snap = 0,0
;p1facing =
;p1getp2facing = 0
;p2facing =
;p1stateno =
;p2stateno =
;p2getp1state = 1
;forcestand = 0
fall = 0
;fall.xvelocity =
;fall.yvelocity = -4.5
fall.recover = 1
fall.recovertime = 30
;fall.damage = 0
air.fall = 1
;down.velocity =
;down.hittime =
;down.bounce = 0
;id =
;chainID = -1
;nochainID =
hitonce = 0 ; to attack enemy projectile + hit enemy character(s)
;kill = 1
;guard.kill = 1
;fall.kill = 1
;numhits = 1
getpower = 0,0
givepower = 0,0
;palfx.time = 0
;palfx.mul =
;palfx.add =
envshake.time = 0
;envshake.freq =
;envshake.ampl =
;envshake.phase =
fall.envshake.time = 0
;fall.envshake.freq =
;fall.envshake.ampl =
;fall.envshake.phase =
ignorehitpause = 0
persistent = 1 ; for 1 hit only

[State 2204, END2_HELPER_Projectile_Part2]
type = ChangeState
trigger1 = (var(25) = 10)
value = 2205
ctrl = 1
;anim =
;ignorehitpause =
;persistent =

[State 2204, END3_HELPER_Projectile_Part2]
type = DestroySelf
trigger1 = (FrontEdgeDist <= -50) || (BackEdgeDist <= -50)
ignorehitpause = 1
;persistent =

; ------------------------------------------------------------------------------------------
[Statedef 2205, HELPER_Projectile_Part3]
type = A
movetype = A
physics = N
juggle = 0
poweradd = 0
velset = 1,0
anim = 2212 ; Range_Style_5x_Special_Effect
ctrl = 0
sprpriority = 2 ; front of Character
;facep2 = 0

[State 2205, AssertSpecial]
type = AssertSpecial
trigger1 = (Time >= 0)
flag = NoShadow
;ignorehitpause =
persistent = 1

[State 2205, END_HELPER_Projectile_Part3]
type = DestroySelf
trigger1 = (AnimTime = 0)

Pls help.
Last Edit: May 26, 2018, 09:34:03 am by Redash
Re: [Coding] How to make multi-hitting Helper-Type Projectile work with Hitoverride?
#2  May 17, 2018, 02:28:59 pm
  • avatar
  • **
    • Singapore
Hi is it possible to implement?

IF not, are there other alternatives?
Re: [Coding] How to make multi-hitting Helper-Type Projectile work with Hitoverride?
#3  May 20, 2018, 05:16:05 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Movecontact won't work as a var increaser. If you hit a helper or projectile it won't trigger. You need to use hitoverride to cycle the state each time the projectile is hit by something.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: [Coding] How to make multi-hitting Helper-Type Projectile work with Hitoverride?
#4  May 21, 2018, 07:39:23 am
  • avatar
  • **
    • Singapore
Thanks Cyanide. that MoveContact SCTR is intent for Enemy Character hits and the SCTR is meant for helper/projectiles hits.

Then are there any syntax function that allows tracking of both kind at once? I replaced (MoveContact =1) to (Time = 0) for VarAdd but still fails...
Any reference of other chars most appreciated.
Re: [Coding] How to make multi-hitting Helper-Type Projectile work with Hitoverride?
#5  May 21, 2018, 10:13:57 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Time = 0 should have allowed it to increment each time the state restarts. Turn on debug and make sure that you are actually restarting the state and that statetime returns to 0.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: [Coding] How to make multi-hitting Helper-Type Projectile work with Hitoverride?
#6  May 26, 2018, 09:34:56 am
  • avatar
  • **
    • Singapore
Thanks Cyanide. Adding other new conditions and var tracking solved it.