YesNoOk
avatar

Reversaldef against own helpers..? (Read 430 times)

Started by FobiaZz, June 15, 2019, 07:15:46 pm
Share this topic:
Reversaldef against own helpers..?
#1  June 15, 2019, 07:15:46 pm
  • **
  • Some People Are Born To Be Extraordinary
    • Italy
    • fab.marchetti86@gmail.com
Hi everyone! I've put a special move in my character to redirect a projectile-type helper against his original owner. When redirected, the helper goes to state 1092 and then immediately returns to enemy's original state (1161) with modifications in direction and in the hitdef triggered by previous state 1092 (it's a full game).

Code:
; Energy bolt (helper)
[Statedef 1161]
type = A
movetype = A
physics = N
juggle = 2
velset = 6,0
ctrl = 0
anim = 10091
sprpriority = 2

[State 1161]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1161]
type = Turn
trigger1 = prevstateno = 1092
trigger1 = time = 0

[State 1161]
type = VelSet
trigger1 = prevstateno = 1092
trigger1 = time > 0
x = 12

[State 1161]
type = HitDef
triggerall = prevstateno != 1092
trigger1 = !movecontact
attr = S, SP
animtype = Light
damage = 90, 9
guardflag = MA
pausetime = 0,2
sparkno = s10092
guard.sparkno = s10092
hitsound = s8, 92
guardsound = s8, 92
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -4,0
air.velocity = -3,-3
airguard.velocity = -2,-2
palfx.time = 24
palfx.mul = 256,256,256
palfx.add = 40,-70,-200
palfx.sinadd = 40,30,0,10
palfx.invertall = 1
palfx.color = 0

[State 1161]
type = HitDef
triggerall = prevstateno = 1092
trigger1 = !movecontact
affectteam = F
attr = S, SP
animtype = Light
damage = 90, 9
guardflag = MA
pausetime = 0,2
sparkno = s10092
guard.sparkno = s10092
hitsound = s8, 92
guardsound = s8, 92
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -4,0
air.velocity = -3,-3
airguard.velocity = -2,-2
palfx.time = 24
palfx.mul = 256,256,256
palfx.add = 40,-70,-200
palfx.sinadd = 40,30,0,10
palfx.invertall = 1
palfx.color = 0

[State 1161]
type = DestroySelf
trigger1 = frontedgedist < -100
trigger2 = movecontact

I've noticed that, in a mirror match, if the character uses that special move to redirect its own projectile-type helper already redirected by the enemy, the reversaldef doesn't work and the character is hit. Is it possible that Reversaldef recognizes only helpers spawned by the enemy and not the ones spawned by its owner? I'm not very interested to make them play Pong endlessy, but I would like to know how it could be done.

Thanks!
Last Edit: June 17, 2019, 01:27:09 am by FobiaZz
Re: Reversaldef against own helpers..?
#2  June 16, 2019, 12:04:03 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Reversaldef can sometimes take some hitdef parameters. You could try an affectteam = B on it. Or swap to hitoverride and go through a convoluted path to detect the helper didn't hit the player and needs to turn around.


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: Reversaldef against own helpers..?
#3  June 16, 2019, 11:34:50 pm
  • **
  • Some People Are Born To Be Extraordinary
    • Italy
    • fab.marchetti86@gmail.com
Hi Cyanide! Thanks!

I tried affectteam = B and this time the reversaldef collides, but the helper is destroyed in the process...it's strange!

I've coded other stuff into the helper to let it go back to original state if the original spawner goes to the state with the reversaldef (1090). This way I've obtained the Pong playing, but it's not perfect yet since I want to trigger to animelem = 4 of 1090 (it gave me error with it):

Code:
; Energy bolt (helper)
[Statedef 1161]
type = A
movetype = A
physics = N
juggle = 2
velset = 0,0
ctrl = 0
anim = 10091
sprpriority = 2

[State 1161]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1161]
type = Turn
trigger1 = prevstateno = 1092
trigger1 = time = 0
trigger2 = root,stateno = 1090
trigger2 = time = 0

[State 1161]
type = VelSet
trigger1 = prevstateno != 1092
trigger1 = time > 0
x = 6

[State 1161]
type = VelSet
trigger1 = prevstateno = 1092
trigger1 = time > 0
trigger2 = root,stateno = 1090
trigger2 = time > 0
x = 12

[State 1161]
type = HitDef
triggerall = prevstateno != 1092
trigger1 = !movecontact
attr = S, SP
animtype = Light
damage = 90, 9
guardflag = MA
pausetime = 0,2
sparkno = s10092
guard.sparkno = s10092
hitsound = s8, 92
guardsound = s8, 92
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -4,0
air.velocity = -3,-3
airguard.velocity = -2,-2
palfx.time = 24
palfx.mul = 256,256,256
palfx.add = 40,-70,-200
palfx.sinadd = 40,30,0,10
palfx.invertall = 1
palfx.color = 0

[State 1161]
type = HitDef
triggerall = prevstateno = 1092
trigger1 = !movecontact
affectteam = B
attr = S, SP
animtype = Light
damage = 90, 9
guardflag = MA
pausetime = 0,2
sparkno = s10092
guard.sparkno = s10092
hitsound = s8, 92
guardsound = s8, 92
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -4,0
air.velocity = -3,-3
airguard.velocity = -2,-2
palfx.time = 24
palfx.mul = 256,256,256
palfx.add = 40,-70,-200
palfx.sinadd = 40,30,0,10
palfx.invertall = 1
palfx.color = 0

[State 1161]
type = ChangeState
triggerall = prevstateno = 1092
trigger1 = rootdist x < 75 && root,stateno = 1090
value = 1161

[State 1161]
type = DestroySelf
trigger1 = frontedgedist < -100
trigger2 = movecontact

Last Edit: June 17, 2019, 01:26:34 am by FobiaZz

ink

Re: Reversaldef against own helpers..?
#4  June 17, 2019, 01:09:16 am
  • ****
  • inktrebuchet
    • USA
    • s236.photobucket.com/albums/ff271/inktrebuchet/?
I don’t think you can reversal your own helper. You can have that helper go into another state that turns it and sends it back once it makes contact though. Giving the same appearance as a reversal.
Re: Reversaldef against own helpers..?
#5  June 17, 2019, 01:22:21 am
  • **
  • Some People Are Born To Be Extraordinary
    • Italy
    • fab.marchetti86@gmail.com
Hi ink! I wanted to avoid the use of two almost identical helpers...direction and hitdef can be decided in the same statedef.

By the way, I finally found a way to make it work properly:

Code:
; Energy bolt (helper)
[Statedef 1161]
type = A
movetype = A
physics = N
juggle = 2
velset = 0,0
ctrl = 0
anim = 10091
sprpriority = 2

[State 1161]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1161]
type = PosAdd
trigger1 = root,anim = 1090
trigger1 = time = 0
x = -10

[State 1161]
type = Turn
trigger1 = prevstateno = 1092
trigger1 = time = 0
trigger2 = root,anim = 1090
trigger2 = time = 0

[State 1161]
type = VelSet
trigger1 = prevstateno != 1092
trigger1 = time > 0
x = 3

[State 1161]
type = VelSet
trigger1 = prevstateno = 1092
trigger1 = time > 0
trigger2 = root,anim = 1090
trigger2 = time > 0
x = 3

[State 1161]
type = HitDef
triggerall = prevstateno != 1092
trigger1 = time = 0
attr = S, SP
animtype = Light
damage = 90, 9
guardflag = MA
pausetime = 0,2
sparkno = s10092
guard.sparkno = s10092
hitsound = s8, 92
guardsound = s8, 92
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -4,0
air.velocity = -3,-3
airguard.velocity = -2,-2
palfx.time = 24
palfx.mul = 256,256,256
palfx.add = 40,-70,-200
palfx.sinadd = 40,30,0,10
palfx.invertall = 1
palfx.color = 0

[State 1161]
type = HitDef
triggerall = prevstateno = 1092
trigger1 = time = 0
affectteam = F
attr = S, SP
animtype = Light
damage = 90, 9
guardflag = MA
pausetime = 0,2
sparkno = s10092
guard.sparkno = s10092
hitsound = s8, 92
guardsound = s8, 92
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -4,0
air.velocity = -3,-3
airguard.velocity = -2,-2
palfx.time = 24
palfx.mul = 256,256,256
palfx.add = 40,-70,-200
palfx.sinadd = 40,30,0,10
palfx.invertall = 1
palfx.color = 0

[State 1161]
type = ChangeState
triggerall = prevstateno = 1092
trigger1 = root,anim = 1090 && movecontact
value = 1161

[State 1161]
type = DestroySelf
trigger1 = frontedgedist < -100
trigger2 = movecontact

There's only a bug left: when the helper collides with the original owner (just him, not the enemy) in reversal state, it activates sparkno (there's no hit or damage, just collision). I think I could fix it by coding the sparkno as external explods...what a mess! - -' Any suggestions?
Last Edit: June 17, 2019, 07:06:55 pm by FobiaZz
Re: Reversaldef against own helpers..?
#6  June 18, 2019, 12:52:31 pm
  • **
  • Some People Are Born To Be Extraordinary
    • Italy
    • fab.marchetti86@gmail.com
I understood that, during second bounce, the helper reacts to the added hitoverride instead in the reversal move, that's why is destroyed!

Since I cannot use changestate to a specific animelem or time in order to avoid system errors or bugs (f.e. player is hit during anim 1090 but the fireball is reflected the same), I decided to make it end fast: if the original helper spawner get to use the reversal against his already-reversed helper (it's hard to do 'cause the reversed helper is faster than original), simply he destroys it.

Code:
; Energy bolt (helper)
[Statedef 1161]
type = A
movetype = A
physics = N
juggle = 2
velset = 0,0
ctrl = 0
anim = 10091
sprpriority = 2

[State 1161]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1161]
type = Turn
trigger1 = prevstateno = 1999
trigger1 = time = 0

[State 1161]
type = VelSet
trigger1 = prevstateno != 1999
trigger1 = time > 0
x = 6

[State 1161]
type = VelSet
trigger1 = prevstateno = 1999
trigger1 = time > 0
x = 12

[State 1161]
type = HitDef
triggerall = prevstateno != 1999
trigger1 = time = 0
attr = S, SP
animtype = Light
damage = 90, 9
guardflag = MA
pausetime = 0,2
sparkno = s10092
guard.sparkno = s10092
hitsound = s8, 92
guardsound = s8, 92
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -4,0
air.velocity = -3,-3
airguard.velocity = -2,-2
palfx.time = 24
palfx.mul = 256,256,256
palfx.add = 40,-70,-200
palfx.sinadd = 40,30,0,10
palfx.invertall = 1
palfx.color = 0

[State 1161]
type = HitDef
triggerall = prevstateno = 1999
trigger1 = time = 0
affectteam = F
attr = S, SP
animtype = Light
damage = 90, 9
guardflag = MA
pausetime = 0,2
sparkno = s10092
guard.sparkno = s10092
hitsound = s8, 92
guardsound = s8, 92
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -4,0
air.velocity = -3,-3
airguard.velocity = -2,-2
palfx.time = 24
palfx.mul = 256,256,256
palfx.add = 40,-70,-200
palfx.sinadd = 40,30,0,10
palfx.invertall = 1
palfx.color = 0

[State 1161]
type = DestroySelf
trigger1 = frontedgedist < -100
trigger2 = movecontact

If I'll find a way to solve this thing (f.e. add a condition to the hitoverride to recognize helper, like Cyanide suggested), I'll write it in this topic someday...now I have to go forward with other things.

Thanks for your tips guys! :)
Last Edit: June 18, 2019, 12:58:49 pm by FobiaZz