YesNoOk
avatar

How to make a move only activate once (X-Factor)? (SOLVED) (Read 304 times)

Started by KBN22, September 07, 2011, 07:29:34 pm
Share this topic:
How to make a move only activate once (X-Factor)? (SOLVED)
#1  September 07, 2011, 07:29:34 pm
  • ***
  • Heroin-flavored bananas finance revolutions!!!
I've been trying to add Kamekaze's X-Factor to one of my characters.
And so far I've been successful, except I can't figure out how to make it
only activate once per match.IS there anyway to make a changestate only activate once?
And if that's not my problem, what am I missing?? 

Code:
;---------------------------------------------------------------------------
;X Factor (Activation code)

[Statedef 4000]
type = S
movetype = I
physics = N
poweradd = 0
velset = 0,0
ctrl = 0
anim = 198

[State 4000, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 4000, assert]
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 4000, Pause]
type = Pause
trigger1 = time = 0
time = 26
movetime = 26
endcmdbuftime = 0

[State 4000, CtrlSet]
type = CtrlSet
trigger1 = time>27;9
value = 1

[State 4000, Helper]
type = Helper
trigger1 = time=5
helpertype = normal
name = "X-Factor"
ID = 4001
stateno = 4001
pos = 0,0
postype = p1   
facing = 1
keyctrl = 0
ownpal = 0

[State 4000, Helper]
type = Helper
triggerall = numhelper(4002)<1
trigger1 = time = 0
helpertype = normal
name = "fx"
ID = 4002
stateno = 4002
pos = 0,0
postype = p1   
facing = 1
keyctrl = 0
ownpal = 0
pausemovetime = 40

[State 4000, 3]
type = PlaySnd
trigger1 = Time = 0
value = 0, 2
channel = 0

[State 4000, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S3000,0
channel = 12

[State 4000, VarSet]
type = VarSet
trigger1 = time = 5
v = 24   
value = 1

[State 4000, changestate]
type = ChangeState
trigger1 = animtime=0
value = 0
ctrl = 1

;--------------------------------------------------------------------------
[Statedef 4001];X Factor Gauge

type    = S
movetype= I
physics = S
velset = 0,0
anim = 9741  ;Blank anim
ctrl = 0
sprpriority = 5

[State 4001, VarSet]
type = parentVarSet
trigger1 = time = 0
fv =4
value = 1000

[State 4001, VarSet]
type = parentVarSet
trigger1 = time = 0
v = 25
value = 1

[State 4001, VarAdd]
type = parentVarAdd
triggerall = parent,fvar(4) >0
trigger1 = 1
fv = 4
value = -ifelse((root,life <= root,floor(lifemax/1.5)&& (root,life > root,floor(lifemax/3.25))),1.8,ifelse((root,life <= root,floor(lifemax/3.25)),1.1,2.5))

[State 4001, Explod]
type = Explod
triggerall = teamside = 1
trigger1 =  numexplod(16010) < 1
anim = 13000
ID = 16010
pos = 35,210
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = .5,.5
ontop = 1
sprpriority = 9
shadow = 0,0,0
ownpal = 1
persistent = 0

[State 4001, Explod]
type = Explod
triggerall = teamside = 2
trigger1 =  numexplod(16010) < 1
anim = 13000
ID = 16010
pos = 200,210
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = .5,.5
ontop = 1
sprpriority = 9
shadow = 0,0,0
ownpal = 1
persistent = 0

[State 4001, Explod]
type = Explod
triggerall = teamside = 2
trigger1 =  numexplod(16011) < 1
anim = 13001
ID = 16011
pos = 259,212
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = .5,.5
ontop = 1
sprpriority = 8
shadow = 0,0,0
ownpal = 1
persistent = 0

[State 4001, Explod]
type = Explod
triggerall = teamside = 1
trigger1 =  numexplod(16011) < 1
anim = 13001
ID = 16011
pos = 94,212
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = .5,.5
ontop = 1
sprpriority = 8
shadow = 0,0,0
ownpal = 1
persistent = 0

[State 4001, ModifyExplod]
type = ModifyExplod
trigger1 =1
ID = 16011
removetime = -1
shadow = 0,0,0
ownpal = 1
scale =  (parent,fvar(4) * .0005)

[State 4001, RemoveExplod]
type = RemoveExplod
trigger1 = parent,fvar(4) <= 0
trigger2 = winko
trigger3 = roundstate !=2
id =16010

[State 4001, RemoveExplod]
type = RemoveExplod
trigger1 = parent,fvar(4) <= 0
trigger2 = winko
trigger3 = roundstate !=2
id =16011

[State 4001, Destroy]
type = destroyself
trigger1 = roundstate !=2
trigger2 = parent,fvar(4) <= 0
trigger3 = winko

;--------------------------------------------------------------------------
[Statedef 4002];Afterimage/FX

type    = S
movetype= I
physics = S
ctrl = 0
sprpriority =-3

[State 4002, ChangeAnim]
type = ChangeAnim
trigger1 =1
value = root,anim
elem = root,animelemno(0)
ignorehitpause =0

[State 4002, NotHitBy]
type = NotHitBy
trigger1 =1
value = SCA
time = 1

[State 4002, Trans]
type = Trans
trigger1 =1
trans =  sub

[State 4002, BindToParent]
type = BindToParent
trigger1 = 1
time = 1
facing = 0
pos = 0,0

[State 4002, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 1
scale = 1+(sin(.0025*var(16))),1+(sin(.0025*var(16)))
ignorehitpause =0

[State 4002, VarSet]
type = Varset
trigger1 =var(16)>=50
v = 11
value = 1
ignorehitpause =0

[State 4002, VarSet]
type = Varset
trigger1 =var(16)=0
v = 11
value =0
ignorehitpause =0

[State 4002, VarSet]
type = Varadd
triggerall = var(11)=0
trigger1 =var(16)<50
v = 16
value = 1
ignorehitpause =0

[State 4002, VarSet]
type = Varadd
triggerall = var(11)=1
trigger1 =var(16)>0
v = 16
value = -1
ignorehitpause =0

[State 4002, assert]
type = assertspecial
trigger1 = 1
flag = NoShadow
flag2 = invisible

[State 4002, afterimage]
type = AfterImage
trigger1 = 1
time = 2
trans = add
timegap = 1
framegap = 1
length = 2
PalBright = 128,0,0
PalContrast = 255,0,0
PalAdd = 128,0,0
persistent = 1
ignorehitpause = 1

[State 4002, turn]
type = Turn
trigger1 = Facing != Root,Facing

[State 4002, Destroy]
type = destroyself
trigger1 = roundstate !=2
trigger2 = root,fvar(4) <= 0 && time >50
trigger3 = winko

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------

[statedef -2]

[State -2, ChangeState]
type = ChangeState
triggerall = roundstate = 2
triggerall = stateno!=[3000,3499];Hypers
triggerall = var(25)=0
triggerall = movetype!=H || (stateno=[120,155])
triggerall = var(24)=0
triggerall = stateno!=4000
triggerall = statetype!=A
triggerall = !numhelper(4002)
trigger1 = command="XFactor"
value = 4000
ctrl = 0
ignorehitpause = 0

[State -2, VarSet]
type = VarSet
trigger1 = fvar(4)<=0
fv = 4   
value = 0

[State -2, VarSet]
type = VarSet
trigger1 =fvar(4)<=0
v = 25   
value = 0

[state -2]
type = lifeadd
trigger1 = time%6 = 0 ;&& life > 1
trigger1 = fvar(4) >= 1
value = ifelse(winko=1,0,1)

[State -3, Speed]
type = ChangeAnim
triggerall = stateno!=[800,899]
triggerall = stateno!=[3000,3499]
triggerall = stateno!=[4001,4002]
triggerall = stateno!=300
triggerall = numhelper(4002) && time%2=0
;triggerall = var(25)=1 && time%2=0
triggerall = (RoundState = 2) && (MoveType != H)
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
trigger1 = AnimElemTime(AnimElemNo(0)) > floor ((AnimElemTime(AnimElemNo(0)) - AnimElemTime(AnimElemNo(0) + 1))/2)
ignorehitpause = 1
value = anim
elem = AnimElemNo(0) + 1
Last Edit: September 08, 2011, 02:25:27 pm by KBN22

2OS

Re: How to make a move only activate once (X-Factor)?
#2  September 07, 2011, 08:06:51 pm
  • ****
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
[State Command]
value=whatever
trigger1=command="whatever"
trigger1=statetype=whatever&&ctrl
trigger1=var(#)!=1
trigger1=var(#):=1


^ This activates if the variable of your choosing isn't equal to 1, it also SETS it to 1, don't ever reset the var and tada.


[ 052012 ] Inazumachi 181/256  /  deviantART   /  2OS Grafphicsxz  Dead Anims ( Orochi/Mizuchi )  /  608's FX Volume 3
Re: How to make a move only activate once (X-Factor)?
#3  September 07, 2011, 08:38:10 pm
  • ***
  • Heroin-flavored bananas finance revolutions!!!
I tried using both variables 24 and 25 using that method in my changestate and alone in my CMD & it can still activate more than once per match.
Re: How to make a move only activate once (X-Factor)?
#4  September 08, 2011, 03:40:02 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
but but, you turn 25 back to 0 when fvar(4) = 0 I imagine you do the same thing to 24 somewhere.

Turn it to 1 and leave it there.


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: How to make a move only activate once (X-Factor)?
#5  September 08, 2011, 04:25:27 am
  • ***
  • Heroin-flavored bananas finance revolutions!!!
Even without that varset, it still activates once the numhelper disappears... and there are no other states that put var(24) or var(25) back to zero.... This is really confusing  :S
Re: How to make a move only activate once (X-Factor)?
#6  September 08, 2011, 05:53:10 am
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
So you removed this varset, right ?
[mcode]
[State -2, VarSet]
type = VarSet
trigger1 =fvar(4)<=0
v = 25   
value = 0
[/mcode]

Use displaytoclipboard to display the values of var(24) and var(25) at all times and report what value they're taking and when.
Re: How to make a move only activate once (X-Factor)?
#7  September 08, 2011, 02:25:05 pm
  • ***
  • Heroin-flavored bananas finance revolutions!!!
You're Awesome!! Found out I was using var(24) for another move... Changed that and it works great. From now on I'll always use displaytoclipboard to check my vars, my bad & Thank you!