YesNoOk
avatar

Teleport after been hit (Read 709 times)

Started by demovv, November 23, 2017, 11:33:18 pm
Share this topic:
Teleport after been hit
#1  November 23, 2017, 11:33:18 pm
  • avatar
  • *
    • Poland
May you guys help me I got stuck in coding command. I just want to add teleport teleport when you get hit by enemy but i don't know how to do that.
I already have this code
Code:
;----------------------------------------------------------------------------
[StateDef 700]
type = S
movetype = H
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 9999
poweradd = -250
sprpriority = 2

[State 0, Helper]
type = Helper
trigger1 =time=3
helpertype = normal ;player
name =""
ID =701
stateno =701
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal =1
supermovetime = 0
pausemovetime = 0

[State 0, Explod]
type = Explod
trigger1 =time=0|time=10
anim = 1251
ID = 1251
pos = 0,10
postype = p1
scale = 1,1
sprpriority = 9
ownpal = 1
ignorehitpause = 1
trans = add

[State 0, PosAdd]
type = PosAdd
trigger1 =time=10
x = -20+random%30000
y = -50

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
;value2 = S,NA

[State 700, end]
type = ChangeState
trigger1 = time=10
value = 50
ctrl = 1
;----------------------------------------------------------------------------
[StateDef 701]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 6011
sprpriority = 2

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

[State 0, VelSet]
type = VelSet
trigger1 = time>1
y = 7

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
y = -70

[State 0, AngleDraw]
type = AngleDraw
trigger1 =1
value = time*20

[State 701, end]
type = ChangeState
trigger1 = pos y>0
value = 703
ctrl = 1
;----------------------------------------------------------------------------
[StateDef 703]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 6011
sprpriority = 2

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

[State 0, AngleDraw]
type = AngleDraw
trigger1 =1
value = -10

[State 0]
type = Trans
trigger1 = time >= 50
trans = addalpha
alpha = 256-(20*(time-50)), 256

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time=60
Re: Teleport after been hit
#2  November 24, 2017, 05:02:31 pm
  • **
  • Power of the Power of the Power of the Power
    • Canada
If it's supposed to be a counter move, you should use Hitoverride or ReversalDef.
Hitoverride simply requires you to get hit, whilst you need to set up some clsn1's for the reversaldef to work.
Re: Teleport after been hit
#3  November 26, 2017, 12:01:39 am
  • ****
  • Shame on you!
    • USA
Basically you're making 1 part of an AI. You can either do it in Statedef -2, or do it in the CMD file, or in your hit reaction states.
But basically you're going to make a ChangeState that fires off once you've been hit.
If you're trying to do like Solarflared said, look up Hitoverride & ReversalDef in Mugen Class.
vVv Wheat Stage Released vVv