I'm working on a projectile reflect setup, and I've gotten it functioning, except for one thing: I need the newly generated "reflected" projectile to have variable speeds, depending on the type of projectile being reflected.
The method I thought to try was to put this in the projectile summon state.
[State 1050, ReflectStrength]
type = VarSet
trigger1 = time = 0
var(11) = [between 0 and 2]
My projectiles are helpers in this case, and the reversaldef is being triggered by a helper...
[State 1000, Projectile]
type = Helper
trigger1 = time = 0
trigger1 = enemy, Name = "testname"
name = "Proj Reversed"
id = 1050 + (enemy, var(11) * 10)
postype = p1
pos = 80, 0
stateno = 1050 + (enemy, var(11) * 10)
ownpal = 1
The idea being that it would read that 0/1/2 and then summon the projectile from state 1050, 1060, or 1070, as appropriate. But no such luck. I tried putting that varset inside the original projectile helper state, too, but still nothing. It only ever calls the helper at state 1050. Anyone have any ideas? Thanks in advance.
Fixed with putting a parentvarset in the helper projectile state.
[State 1050, ReflectStrength]
type = ParentVarSet
trigger1 = time = 0
var(11) = 0
That makes this work like a charm.
[State 1000, Projectile]
type = Helper
trigger1 = time = 0
trigger1 = enemy, Name = "testname"
name = "Proj Reversed"
id = 1050 + (enemy, var(11) * 10)
postype = p1
pos = 80, 0
stateno = 1050 + (enemy, var(11) * 10)
ownpal = 1
Thanks, everyone.