YesNoOk
avatar

multi-hit helper projectile problem (Read 284 times)

Started by Continuity, November 15, 2009, 02:58:41 am
Share this topic:
multi-hit helper projectile problem
#1  November 15, 2009, 02:58:41 am
  • ***
  • 我が名は 「ハクメン」、押して参る!
I'm trying to code a multi-hit projectile with helper and I'm running into a bit of problem here, I'm trying to achieve the effect with very simple codes but so far it doesn't seem to be working out for me,here's my code, I left out the hitdef part so it's easier to read for you guys.

[mcode];ex fireball
[statedef 6000]
type=A
movetype=A
physics=N
velset=7,0
anim=7000

[state 6000] ;sets a counter that records how many hits the helper has hit the opponent
type=varset
trigger1=time=0&&prevstateno!=6000
var(10)=0

[state 6000] ;go through enemy projectiles
type = HitOverride
trigger1 =1
time = 1
slot = 2
attr = SCA, AA, AP
stateno = 6000

[state 6000] ;everytime it hits, this resets the state so the helper can hit again
type=changestate
trigger1=var(10)<3
trigger1=movecontact
value=6000

[state 6000] ;everytime the helper hits, the counter SHOULD go up
type=varadd
trigger1=var(10)<3
trigger1=movecontact
var=10
value=1

[state 6000] ;when the counter reaches a specific number, the helper goes to a destroyself state
type=changestate
trigger1=var(10)>=3
trigger1=movecontact
value=6001[/mcode]

The problem now is that the helper doesn't go to state 6001 so the helper will hit the opponent continuously, I'm suspecting using movecontact as a trigger may cause some problem, but I'm not sure what. Help appreciated, thank you
Re: multi-hit helper projectile problem
#2  November 15, 2009, 03:04:13 am
  • ******
Quote
[state 6000] ;everytime it hits, this resets the state so the helper can hit again
type=changestate
trigger1=var(10)<3
trigger1=movecontact
value=6000
 
[state 6000] ;everytime the helper hits, the counter SHOULD go up
type=varadd
trigger1=var(10)<3
trigger1=movecontact
var=10
value=1
Mugen reads from top to bottom - and it just stops reading if it finds a changestate that triggers. If it reads and triggers the changestate before it reads the varadd, it will do the changestate and never even read the varadd (since they both have the same triggers, there is no situation where it would skip the changestate but still do the varadd).

Just put the varadd at the top of the state, at !time.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: multi-hit helper projectile problem
#3  November 15, 2009, 03:23:34 am
  • ***
  • 我が名は 「ハクメン」、押して参る!
hurm....it was actually just a syntax error in my varadd, I wrote var instead of v...that was dumb, it all works just as planned --;