YesNoOk
avatar

Help with RemoveExplod in state -2 (Read 1825 times)

Started by Momotaro, October 25, 2020, 11:54:13 am
Share this topic:
Help with RemoveExplod in state -2
#1  October 25, 2020, 11:54:13 am
  • *****
  • A.K.A. NED
  • I like to draw fighting game characters...
Back to coding.
I try to fix some slash explod from a special attack.

Let me explain:

1000 = special move
1030 = ex special move

1002 = special move landing
1003 = ex special move landing

without -2 code, the explod stay if the move is interrupted.

With the code I tried in -2, the effect blinks in a weird way.
Seems like the coding hesitate to display it or not.

I think my code structure have a problem, can you guys help me fix it ?
Thanks

Code:
[State -2, Remove Dash blade Explod1]
type = RemoveExplod
trigger1 = NumExplod(1040) && StateNo != 1000 || StateNo != 1030
ID = 1040

[State -2, Remove Dash blade Explod2]
type = RemoveExplod
trigger1 = NumExplod(1041) && StateNo != 1002 || StateNo != 1003
ID = 1041
Last Edit: November 06, 2020, 10:15:32 pm by Nedflandeurse
Re: Help with RemoveExplod in state -2
#2  October 25, 2020, 12:36:35 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
NOT statements require an AND instead of an OR:

trigger1 = NumExplod(1040) && StateNo != 1000 && StateNo != 1030
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: Help with RemoveExplod in state -2
#3  October 25, 2020, 05:23:52 pm
  • *****
  • A.K.A. NED
  • I like to draw fighting game characters...
NOT statements require an AND instead of an OR:

trigger1 = NumExplod(1040) && StateNo != 1000 && StateNo != 1030

Oh, I see. Thanks for pointing it out!
I'm updating it!

EDIT : I tried and for some reason
For the ex move part 2 of move, 1041 explod don't show at all.

Code:
[State -2, Remove Dash blade Explod1]
type = RemoveExplod
trigger1 = NumExplod(1040) && StateNo != 1000 && StateNo != 1030
ID = 1040

[State -2, Remove Dash blade Explod2]
type = RemoveExplod
trigger1 = NumExplod(1041) && StateNo != 1002 && StateNo != 1003
ID = 1041

as a reference
from special move 1002 - this one appears
Code:
[State 1002, 1];slash effect end part
type = explod
trigger1 = !Time
anim = 1041
id = 1041
sprpriority = 3
ownpal = 1
bindtime = -1
scale = const(size.xscale),const(size.yscale)
pausemovetime=123456
supermovetime=123456
ignorehitpause=1

from EX version of special move 1003 - this one doesn't appear
Code:
[State 1003, 1],slash effect end part
type = explod
trigger1 = !Time
anim = 1041
id = 1041
sprpriority = 3
ownpal = 1
bindtime = -1
scale = const(size.xscale),const(size.yscale)
pausemovetime=123456
supermovetime=123456
ignorehitpause=1
Last Edit: October 25, 2020, 05:37:44 pm by Nedflandeurse
Re: Help with RemoveExplod in state -2
#4  October 25, 2020, 10:29:06 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Good plan to specify both postype and pos. I know if you set a bindtime of 0 postype becomes left which can cause issues.

Everything in that code is the same otherwise. Copy paste the working one in. If that doesn't work your state itself has another problem.

Or your removeexplod is triggering.

Out of interest. Why not use removeongethit? That makes explods vanish if your player is hit


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: Help with RemoveExplod in state -2
#5  October 30, 2020, 09:12:29 pm
  • *****
  • A.K.A. NED
  • I like to draw fighting game characters...
Good plan to specify both postype and pos. I know if you set a bindtime of 0 postype becomes left which can cause issues.

Everything in that code is the same otherwise. Copy paste the working one in. If that doesn't work your state itself has another problem.

Or your removeexplod is triggering.

Out of interest. Why not use removeongethit? That makes explods vanish if your player is hit

Thanks a lot!

Sorry for waitng before replying, English + advanced coding makes me delaying it for later, because I need concentration to understand everything once for all.

About "removeongethit" It could be helpful, but perhaps it's not enough, since the move can be interrrupted by some other move, not just interrupted by gethit state. (?)

For it and all other choices, the yall depend on the "template"/base I use for my character. Benimaru by Jmorphman.

The codes are the same, so I think it would not change anytrhing to copy paste the "working one"
I'm pretty sure the problem is on the move state itself.

Should I post it here as well?

EDIT : I post it here.
Beware, my coding structure is very messy, because I use existing states ad add stuff in them

As a reminder :
1000 = special move
1030 = ex special move

1002 = special move landing
1003 = ex special move landing

SPECIAL ONES
Code:
;========================<DASH BLADE>=============================
[StateDef 1000]
type = S
physics = N
moveType = A
anim = 1000
ctrl = 0
velSet = 0,0
sprPriority = 1
powerAdd = 72 * !var(20)
faceP2 = 1

[State 1000, Button Detect]
type = VarSet
trigger1 = !Time && !AILevel
;ifElse((command = "z" || command = "rlsz"), 2, ifElse((command = "y" || command = "rlsy"), 1, 0))
var(10) = ifElse((NumExplod(90000220) || NumExplod(90000225)), 2, ifElse((NumExplod(90000210) || NumExplod(90000215)), 1, 0))

[State 1000, Button Detect (AI)]
type = VarSet
trigger1 = !Time && AILevel
var(10) = ifElse((P2MoveType = H || Random < 500), 2, ifElse(Random < 500, 1, 0))

[State 1000, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = ifElse(var(10) = 0, 1000, ifElse(var(10) = 1, 1010, 1020))

;[State 1000, ChangeAnimElem]
;type = ChangeAnim
;trigger1 = NumHelper(1005)
;trigger1 = var(10) >= 10
;trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(7) < 0
;value = ifElse(var(10) = 10, 1000, ifElse(var(10) = 11, 1010, 1020))
;elem = 7
;persistent = 0

[State 1000, 1];slash effect
type = explod
trigger1 = animelemtime(5) = 0
trigger1 = !movecontact || HitPauseTime != 0
anim = 1040
id = 1040
sprpriority = 3
ownpal = 1
bindtime = -1
scale = const(size.xscale),const(size.yscale)
pausemovetime=123456
supermovetime=123456
ignorehitpause=1

[State 181, ˆÚ“®]
type = posadd
trigger1 = animelem = 2
Trigger1 = FrontEdgeBodyDist >= -2 ;‰æ–Ê’[UŒ‚”»’èÁŽ¸‘΍ô
x = 16*const(size.xscale)

[State 181, ˆÚ“®]
type = posadd
trigger1 = animelem = 5
Trigger1 = FrontEdgeBodyDist >= -2 ;‰æ–Ê’[UŒ‚”»’èÁŽ¸‘΍ô
x = 16*const(size.xscale)

[State 3000, 1]
type = statetypeset
trigger1 = AnimElem = 5
statetype = A

[State 3000, ˆÚ“®]
type = velset
trigger1 = AnimElem = 5
Trigger1 = FrontEdgeBodyDist >= -2 ;‰æ–Ê’[UŒ‚”»’èÁŽ¸‘΍ô
;x = 9
;light 9(au début)
;strong 12.5(au début)
x = ifElse(var(10) = 2, 13.6, ifElse(var(10) = 1, 11.2, 9));;;;;explic : 2 = strong, 1 = medium, rien = light

[State 3000, ˆÚ“®]
type = velset
trigger1 = AnimElem = 5
y = -1

[State 3000, ˆÚ“®]
type = veladd
trigger1 = animelem = 5,>0
y = ifElse(var(10) = 2, 0.15, ifElse(var(10) = 1, 0.17, 0.2));;;;;explic : 2 = strong, 1 = medium, rien = light
;y = 0.2
;light 0.2
;strong 0.15 (oui, c'est zarbi...?)

[State 3000, ˆÚ“®]
type = veladd
trigger1 = animelem = 6,>0
Trigger1 = FrontEdgeBodyDist >= -2 ;‰æ–Ê’[UŒ‚”»’èÁŽ¸‘΍ô
x = -0.5

[State 3000, 1];voice
type = PlaySnd
trigger1 = AnimElem = 2
value = 1000, 0
channel = 0

[State 3000, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 1000, 2

[State 230, 1]
type = explod
trigger1 = animelem = 4
anim = 11002
sprpriority = 3
pos = -30,0
ownpal = 1
ignorehitpause = 1

[State 1000, Dust Helper]
type = Helper
trigger1 = AnimElem = 4
helperType = Normal
stateNo = 8100
ID = 8100
name = "Slash Dust";j'ai décidé
posType = P1
ownPal = 1

[State 210, 2]
type = HitDef
trigger1 = !var(16) && (var(15) < 1 || var(20))
;trigger1 = animelem = 5,>=0
;trigger1 = !movecontact&&!movereversed
;trigger1 = var(32) < 6 ;’ÇŒ‚§ŒÀ
attr = S, SA
animtype  = Medium ;mid
getPower = ifElse(!var(13), 144, 72) * !var(20), 36 * !var(20)
givePower = 36, 36
damage = ceil(ifElse(fvar(11) * ifElse(var(10) = 2, 98, ifElse(var(10), 91, 84)) < 7, 4, fvar(11) * ifElse(var(10) = 2, 98, ifElse(var(10), 91, 84)))), 7
guardflag = M
hitflag = MAF
pauseTime = ifElse(var(20), 11, 11), ifElse(var(20), 11, 11)
sparkXY = -20 + 0 * (var(35) := 66), var(36) := -75;;;;;;;;;;;;;;sparkxy = -20,-65
hitSound = -1 + 0 * (var(31) := 5)
guardSound = -1 + 0 * (var(32) := 0)
sparkNo = -1 + 0 * (var(33) := 8013)
guard.sparkNo = -1 + 0 * (var(34) := 8001)
ground.type = low
ground.slidetime = 24
ground.hittime  = 24
guard.hittime = 18
ground.velocity = -2,-8
guard.velocity = -7
ground.cornerpush.veloff = -6
guard.cornerpush.veloff = -6
air.cornerpush.veloff = -6
airguard.cornerpush.veloff = -6
air.velocity = -2,-9.6
yaccel = 0.45
air.hittime = 120
fall = 1
fall.recovertime = 99999
palFX.time = 12 * var(9)
palFX.add = 255, 255, 255
palFX.sinAdd = -255, -255, -255, 48
envshake.time = 14;6
envshake.freq = 120;80
envshake.ampl = 4;3


[State 1220, 3];;;on hit
type = ChangeState
trigger1 = movecontact || movereversed
value = 1005

;[State 1000, ChangeState]
;type = ChangeState
;trigger1 = !AnimTime
;value = 0
;ctrl = 1

[State 1000, 3]
type = ChangeState
trigger1 = animtime = 0
value = 1002

;---------------------------------------------------------------------------
;dash blade LAND
[Statedef 1002]
type    = S
movetype= I
physics = N
juggle  = 0
velset = 0,0
poweradd= 0
anim = 1002
ctrl = 0
sprpriority = 2

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !Time
id = 1040

[State 1002, 1];slash effect end part
type = explod
trigger1 = !Time
anim = 1041
id = 1041
sprpriority = 3
ownpal = 1
bindtime = -1
scale = const(size.xscale),const(size.yscale)
pausemovetime=123456
supermovetime=123456
ignorehitpause=1

[State 1002, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 8102
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 1002, Landing Sound]
type = PlaySnd
trigger1 = !Time
value = 52,0

[State 1002, ˆÚ“®];???????????
type = posadd
trigger1 = time = 0
x = 16*const(size.xscale)

[State 1002, ˆÚ“®]
type = velset
trigger1 = time = 0
x = 4
y = 0

[State 1002, ˆÚ“®]
type = velmul
trigger1 = 1
x = 0.3

[State 1002, ˆÚ“®]
type = posset
trigger1 = time = 0
y = 0

[State 1002, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

EX SPECIAL ONES
Code:
;========================<EX DASH BLADE>=============================
[StateDef 1030]
type = S
physics = N
moveType = A
anim = 1030
ctrl = 0
velSet = 0,0
sprPriority = 1
powerAdd = -500
faceP2 = 1

[State 1030, Button Detect]
type = VarSet
trigger1 = !Time
var(10) = 3

[State 1030, Custom Combo Juggle Points Reset]
type = VarSet
trigger1 = !Time && var(20)
var(15) = 0
ignoreHitPause = 1

[State 1030, Custom Combo Reset]
type = PalFX
trigger1 = !Time
trigger1 = var(20) := -1
time = 1

[State 1030, EX Flash]
type = VarSet
trigger1 = !Time
var(25) = 99999;28

[State 1030, EX FX]
type = Explod
trigger1 = !Time
anim = 8210
sprPriority = 3
posType = P1
pos = -11, -68;;;;;-31, -68
scale = 0.5, 0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 1030, EX Startup Sound]
type = PlaySnd
trigger1 = !Time
value = 0,1000
channel = 1

;[State 1030, ChangeAnimElem]
;type = ChangeAnim
;trigger1 = NumHelper(1035)
;trigger1 = var(10) >= 10
;trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(7) < 0
;value = 1000
;elem = 7
;persistent = 0

[State 1030, EX Flash off]
type = VarSet
trigger1 = AnimElem = 8;7
var(25) = 0



[State 1000, 1];slash effect
type = explod
trigger1 = animelemtime(5) = 0
trigger1 = !movecontact || HitPauseTime != 0
anim = 1040
id = 1040
sprpriority = 3
ownpal = 1
bindtime = -1
scale = const(size.xscale),const(size.yscale)
pausemovetime=123456
supermovetime=123456
ignorehitpause=1

[State 181, ˆÚ“®]
type = posadd
trigger1 = animelem = 2
Trigger1 = FrontEdgeBodyDist >= -2 ;‰æ–Ê’[UŒ‚”»’èÁŽ¸‘΍ô
x = 16*const(size.xscale)

[State 181, ˆÚ“®]
type = posadd
trigger1 = animelem = 5
Trigger1 = FrontEdgeBodyDist >= -2 ;‰æ–Ê’[UŒ‚”»’èÁŽ¸‘΍ô
x = 16*const(size.xscale)

[State 3000, 1]
type = statetypeset
trigger1 = AnimElem = 5
statetype = A

[State 3000, ˆÚ“®]
type = velset
trigger1 = AnimElem = 5
Trigger1 = FrontEdgeBodyDist >= -2 ;‰æ–Ê’[UŒ‚”»’èÁŽ¸‘΍ô
x = 10

[State 3000, ˆÚ“®]
type = velset
trigger1 = AnimElem = 5
y = -0.7 ;-2

[State 3000, 1]
type = veladd
trigger1 = animelem=5,>0
y = 0.2 ;0.35

[State 3000, 1]
type = veladd
trigger1 = animelem=6,>0
Trigger1 = FrontEdgeBodyDist >= -2 ;‰æ–Ê’[UŒ‚”»’èÁŽ¸‘΍ô
x = -0.5

[State 3000, 1];voice
type = PlaySnd
trigger1 = AnimElem = 2
value = 1000, 1
channel = 0

[State 3000, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 1000, 2



[State 230, 1]
type = explod
trigger1 = animelem = 4
anim = 11002
sprpriority = 3
pos = -30,0
ownpal = 1
ignorehitpause = 1

[State 1000, Dust Helper]
type = Helper
trigger1 = AnimElem = 4
helperType = Normal
stateNo = 8100
ID = 8100
name = "Slash Dust";j'ai décidé
posType = P1
ownPal = 1

[State 210, 2]
type = HitDef
trigger1 = !var(16) && (var(15) < 1 || var(20))
attr = S, SA
animtype  = Medium ;mid
getpower = 0
givepower = 36,36
damage = ceil(ifElse(fvar(11) * 112 < 7, 4, fvar(11) * 112)), 7
guardflag = M
hitflag = MAF
guard.pauseTime = ifElse(var(20), 6, 12), ifElse(var(20), 6, 12)
sparkXY = -20 + 0 * (var(35) := 66), var(36) := -75;;;;;;;;;;;;;;sparkxy = -20,-65
hitSound = -1 + 0 * (var(31) := 5)
guardSound = -1 + 0 * (var(32) := 0)
sparkNo = -1 + 0 * (var(33) := 8013)
guard.sparkNo = -1 + 0 * (var(34) := 8001)
ground.type = low
ground.slidetime = 24
ground.hittime  = 24
guard.hittime = 18
ground.velocity = -2,-8
guard.velocity = -7
ground.cornerpush.veloff = -6
guard.cornerpush.veloff = -6
air.cornerpush.veloff = -6
airguard.cornerpush.veloff = -6
air.velocity = -2,-9.6
yaccel = 0.45
air.hittime = 120
fall = 1
fall.recovertime = 99999
palFX.time = 12 * var(9)
palFX.add = 255, 255, 255
palFX.sinAdd = -255, -255, -255, 48
envshake.time = 14;6
envshake.freq = 120;80
envshake.ampl = 4;3


[State 1220, 3];;;on hit
type = ChangeState
trigger1 = movecontact || movereversed
value = 1005


;[State 1030, End]
;type = ChangeState
;trigger1 = !AnimTime
;value = 0
;ctrl = 1

[State 1000, 3]
type = ChangeState
trigger1 = animtime = 0
value = 1003




;---------------------------------------------------------------------------
; EX dash blade LAND
[Statedef 1003]
type    = S
movetype= I
physics = N
juggle  = 0
velset = 0,0
poweradd= 0
anim = 1003
ctrl = 0
sprpriority = 2

;[State 200, ƒK[ƒhƒ‚[ƒVƒ‡ƒ“”FŽ¯‹——£]
;type = attackdist
;trigger1 = fvar(24) = 1
;trigger1 = 1
;value = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !Time
id = 1040

[State 1003, EX Flash]
type = VarSet
trigger1 = !Time
var(25) = 200

[State 1003, EX Flash off]
type = VarSet
trigger1 = AnimElem = 5
var(25) = 0

[State 1002, 1],slash effect end part
type = explod
trigger1 = !Time
anim = 1041
id = 1041
sprpriority = 3
ownpal = 1
bindtime = -1
scale = const(size.xscale),const(size.yscale)
pausemovetime=123456
supermovetime=123456
ignorehitpause=1

[State 1002, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 8102
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 1002, Landing Sound]
type = PlaySnd
trigger1 = !Time
value = 52,0

[State 181, ˆÚ“®]
type = posadd
trigger1 = time = 0
x = 16*const(size.xscale)

[State 3000, ˆÚ“®]
type = velset
trigger1 = time = 0
x = 4
y = 0

[State 3000, ˆÚ“®]
type = velmul
trigger1 = 1
x = 0.3;0.8

[State 3000, ˆÚ“®]
type = posset
trigger1 = time = 0
y = 0

[State 1003, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
Last Edit: October 30, 2020, 09:18:50 pm by Nedflandeurse
Re: Help with RemoveExplod in state -2
#6  November 05, 2020, 06:27:12 pm
  • *****
  • A.K.A. NED
  • I like to draw fighting game characters...
I bump it to get some more help.
Any idea what's wrong in my states ?

Thanks
Re: Help with RemoveExplod in state -2
#7  November 05, 2020, 07:41:39 pm
  • avatar
  • **
    • USA
Test it with the triggers split up.  That trigger looks suspiciously unspecific.  Also, should probably ignorehitpause, just in case.

Code:
[State -2, Remove Dash blade Explod1]
type = RemoveExplod
triggerall = NumExplod(1040)
trigger1 = StateNo != 1000
trigger2 = StateNo != 1030
ID = 1040
ignorehitpause = 1
     
[State -2, Remove Dash blade Explod2]
type = RemoveExplod
triggerall = NumExplod(1041)
trigger1 = StateNo != 1002
trigger2 = StateNo != 1003
ID = 1041
ignorehitpause = 1
Re: Help with RemoveExplod in state -2
#8  November 06, 2020, 10:15:19 pm
  • *****
  • A.K.A. NED
  • I like to draw fighting game characters...
Test it with the triggers split up.  That trigger looks suspiciously unspecific.  Also, should probably ignorehitpause, just in case.

Code:
[State -2, Remove Dash blade Explod1]
type = RemoveExplod
triggerall = NumExplod(1040)
trigger1 = StateNo != 1000
trigger2 = StateNo != 1030
ID = 1040
ignorehitpause = 1
     
[State -2, Remove Dash blade Explod2]
type = RemoveExplod
triggerall = NumExplod(1041)
trigger1 = StateNo != 1002
trigger2 = StateNo != 1003
ID = 1041
ignorehitpause = 1

Thnaks a lot for helping.
But I tried this code and the explod blinks and nearly doesn't appear really.

But it reminded me I had to check the actual EX move code.

After checking again the move itself ingame.
I noticed that 2nd part of explod doesn't show intitially even without the -2 codes that removes it.

So just like @Cyanide suggested, I copy pasted the explod code from the working state even if it looked the same.

And most of all, I put it as early as possible in the move state, just like in the non-EX version.
And... It works. I'm not sure to understand why.

But it works perfectly now.

So thanks to all of you for helping me understanding more how to code this kind of feature.