@Just No Point: Backwards: I want P2 to remain in the "confused" state if they are hit, and then, after a set amount of time, leave the state and return to their own.
@altoiddealer: I could experiment with HitOverrides but I'll try what you sent first.
It dawned on me that unlike the other topics I've created, I actually did not share any code here! That probably would have been immensely helpful. (I have some things going on in real life and that kinda took some of my attention away, oops)
Here is the code with the changes AD has proposed; I'm sure a lot of it is placed in the wrong spots so please feel free to correct me.
Attack Start code:
[Statedef 3500]
type = S
movetype= I
physics = S
ctrl = 0
anim = 3101
sprpriority = 2
facep2 = 1
velset = 0,0
[State 0]
Type = Varset
trigger1 = time = 0
Var(35) = Gametime
[State 3000, Explod]
type = Explod
trigger1 = Time = 0
anim = 8300
id = 8300
supermove = 1
sprpriority = 4
ownpal = 1
[State 3000, VarSet]
type = VarSet
trigger1 = animelem = 2
var(4) = 1
[State 3000, Helper]
type = Helper
trigger1 = animelem = 2
stateno = 8500
supermovetime = 99999999
pos = -15,ceil(-160*const(size.yscale))
ownpal = 1
id = 8500
[State 0, PalFX]
type = envshake
trigger1 = time = 40
time = 16
ampl = -3
ignorehitpause = 1
[State 3000, SuperPause]
type = SuperPause
trigger1 = animelem = 2
time = 36
movetime = 36
darken = 1
anim = -1
p2defmul = 1
poweradd = -5000
[State 3001, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = S3001, 0
channel = 0
[State 3001, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 1480,0
channel = 0
[State 0, PalFXWiz]
type = PalFX
triggerall = (time%2)=0
;triggerall = time <= 240
;triggerall = numhelper(3301)
trigger1 = animelemtime(5) >= 0
time = 1
add = 256,-50,-50
mul = 256,200,200
sinadd = 0,0,0,1
invertall = 0
color = 128
[State 0, Helper]
type = Helper
;trigger1 = time = 55
trigger1 = animelem = 8
helpertype = normal
name = "Mind Env"
ID = 3501
stateno = 3501
pos = 0,0
postype = p1
facing = 1
ownpal = 1
persistent = 0
supermovetime = 90
pausemovetime = 90
[State 0]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1
First helper (sends opponent into "confused" state):
[Statedef 3501]
type = A
movetype= A
physics = N
ctrl = 0
anim = 3500
poweradd = 0
sprpriority = 5
velset = 0,0
facep2 = 1
[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,NA,SA,NT,ST,HT
time = 2
ignorehitpause = 1
[State 200, 1]
type = HitDef
trigger1 = time = 1
attr = S, NA
palfx.color = 256
palfx.invertall = 1
fall.envshake.ampl = ID
[State 0]
type = TargetState
trigger1 = movecontact
value = 3503
[State 0, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0
Second helper (should be used to check if opponent has been knocked out of state, then return to said state):
[Statedef 3502]
type = A
movetype= A
physics = N
ctrl = 0
anim = 3500
poweradd = 0
sprpriority = 5
velset = 0,0
facep2 = 1
[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,NA,SA,NT,ST,HT
time = 2
ignorehitpause = 1
[State 200, 1]
type = VarSet
trigger1 = numtarget
var(36) = target,ID
[State 200, 1]
type = HitDef
trigger1 = PlayerIDExist(var(36))
trigger1 = PlayerID(var(36)),StateNo = [200, 250]
Id = 1000
[State 200, 1]
type = TargetState
trigger1 = numtarget(1000)
Value = 3503 ;The Custom state you wanna force p2 back into
[State 0]
type = TargetState
trigger1 = movecontact
value = 3503
[State 0, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0
"Confused" state:
[Statedef 3503]
type = S
physics = S
ctrl = 1
[State 0]
type = VarSet
trigger1 = time = 0
var(32) = 1
[State 0]
type = VarSet
trigger1 = time = 100
var(32) = 0
[State 0]
Type = SelfState
trigger1 = Gametime > PlayerID(GetHitVar(fall.envshake.ampl)),var(10) + 1000 ;effect duration = 1000
value = 0
[State 0]
type = SelfState
trigger1 = time = 100
value = 0
As it is currently, var(35) = Gametime throws an error. (That variable is free of use, just in case that was a question.) On top of that there is no code that actually utilizes the second helper YET. Any further tips would be wonderful.