power = ifelse((var(6)=[0,60]),-1000,ifelse((var(6)=[61,120]),-1000,-1000))not sure if im going the right way about this but, im coding a move for a friend, and when holding the button in it charges and the longer you charge it the move faster and powerful it becomes... also the longer you charge it the more power is required.i added this code in and it only removes 1000... how can i make it remove another 1000 when var(6) = [61,120] ? also the next value would mean if greater than 120 remove another.so when charged for maximum it removes -3000sadly though all my code does is remove 1000... even when var(6) is charging past 0,60...and if i have no power levels, and do the move(not adding a triggerall in the cmd yet) it adds 1000 for somereason.
var(6) is for when the kick button is held.then i used a varadd(the move works fine apart form the power requirement problem)and when var(6)=[0,60] the move is at the lowest damage and power = 1000 is required when var(6)=[61,120] the move requires 2000 powerwhen var(6) is > 120 then it requires 3000 power.my question was basically how do i implement this?like while charging i want it to remove power accordingly.
Do you mean how to do it for the command requirements? You're not being very clear.In any case, it'd work best if when you have power<3000 it doesn't charge to the maximum level at all, and so on, which would be coded in the actual state (only command requirement would be power>=1000).
sorry for not being clear enough. (this is for the cns)its a rocket kick moveyou activate the command for the move which is D,DF,F cdoing this removes 1000 power(goes into the superpause also) then if you arent holding the c button the character will fly across the screen on a rocket doing the kickif you hold c for long enough it goes into the next phase of charging(gaining more power and speed) at this point i want it to remove another level from the power bar(-1000) and if you hold for even longer till its at maximum it removes another level.so the move can remove up to 3 lvls from your powerbar if you have the right amount of power.and also how do i limit the move so that if you dont have enough power to go into the next phase of charging it wont play that anim.
Ah, I see, you want it to remove power on the spot while charging. Try this:[Statedef]poweradd=-1000; first level[State]type=poweraddtrigger1= var(6)>=60; second levelvalue=-1000persistent=0[State]type=poweraddtrigger1= var(6)>=120; third levelvalue=-1000persistent=0Quoteand also how do i limit the move so that if you dont have enough power to go into the next phase of charging it wont play that anim.You know all this would be simpler if each level charge anim was a different state. Anyway, just don't let the var go past 59 or 119 if the char doesn't still have at least 1000 power left.
thanks that works fine.one last thing.i added power>=1000 in the cmdwhen i have at least 1000 power.. i can still charge to the second phase which requires 2000 poweri use changeanims to play the next animation when var(6)=[61,120] how do i stop this from playing when i only have 1000 power?
In the changeanims, use power triggers along with the var triggers.Edit: oh wait, for this to work the changeanims need to be placed before those poweradds.
[mcode][State 3002, ChangeAnim]type = ChangeAnimtrigger1 = (var(6)=[0,60]) && power>=1000value = 3001persistent = 0ignorehitpause =1[State 3002, ChangeAnim]type = ChangeAnimtrigger1 = (var(6)=[61,120]) && power>=2000value = 3002persistent = 0ignorehitpause =1[State 3002, ChangeAnim]type = ChangeAnimtrigger1 = var(6)>120 && power>=3000value = 3003persistent = 0ignorehitpause =1[/mcode]ok i added that...works ok, but removes the power levels still
its ok i solved ittrigger3 = power<=1000added that to the changestate that makes him travel on the rocket.EDIT: actually that didnt ignore that lol
blackchaos07 said, November 21, 2008, 01:27:22 amok i added that...works ok, but removes the power levels stillblackchaos07 said, November 21, 2008, 01:07:15 amso the move can remove up to 3 lvls from your powerbar if you have the right amount of power.You're making me dizzy here , removing the power was the first thing you wanted...If you do want the power to drain as he charges, then all you need to fix in the latest code is change all the powers to power>=1000, since because of the draining he won't reach the max level with a full bar.
[mcode][statedef 3000]type = Smovetype = Iphysics = Svelset = 0,0ctrl = 0anim = 3000poweradd = -1000[State 0, SuperPause]type = SuperPausetrigger1 = time = 0time = 45anim = -1sound = S1500,7pos = 0,40darken = 1p2defmul = 0poweradd = 0unhittable = 1[State 3002,VarSet]type = Varsettrigger1 = Time = 0v = 6value = 0[State 3002,VarSet]type = Varsettrigger1 = Time = 0v = 7value = 0[State 3002,VarSet]type = Varaddtrigger1 = Command = "hold_c"v = 6value = 1[State 3002,VarSet]type = Varsettrigger1 = Command = "hold_c"v = 7value = 1[State 3002,VarSet]type = Varsettrigger1 = Command != "hold_c"v = 7value = 0[State 3002, ChangeAnim]type = ChangeAnimtrigger1 = (var(6)=[0,60])&& power>=1000value = 3001persistent = 0ignorehitpause =1[State 3002, ChangeAnim]type = ChangeAnimtrigger1 = (var(6)=[61,120])&& power>=2000value = 3002persistent = 0ignorehitpause =1[State 3002, ChangeAnim]type = ChangeAnimtrigger1 = var(6)>120 && power>=3000value = 3003persistent = 0ignorehitpause =1[State 3000]type=poweraddtrigger1= var(6)>=60value=-1000persistent=0[State 3000]type=poweraddtrigger1= var(6)>=120value=-1000persistent=0[State 0, PlaySnd]type = PlaySndtriggerall = anim = 3001trigger1 = animelem = 2value = S1500,6volume = 100[State 0, PlaySnd]type = PlaySndtriggerall = anim = 3002trigger1 = animelem = 2value = S1500,6volume = 100[State 0, PlaySnd]type = PlaySndtriggerall = anim = 3003trigger1 = animelem = 2value = S1500,6volume = 100[State 3002,ChangeState]type = ChangeStatetrigger1 = Var(7) = 0trigger2 = Var(6) >= 190value = 3100ctrl = 0[/mcode]im being a tit...lolok now when i have 3000 power and hold the move charging button it doesnt get past anim 3001
blackchaos07 said, November 21, 2008, 01:49:19 am[State 3002, ChangeAnim]type = ChangeAnimtrigger1 = (var(6)=[0,60]) && power>=1000value = 3001persistent = 0ignorehitpause =1[State 3002, ChangeAnim]type = ChangeAnimtrigger1 = (var(6)=[61,120])&& power>=1000value = 3002persistent = 0ignorehitpause =1[State 3002, ChangeAnim]type = ChangeAnimtrigger1 = var(6)>120 && power>=1000value = 3003persistent = 0ignorehitpause =1Tried like this?More things:- Why storing Command="hold_c" / Command != "hold_c" in var(7) when you can just use those triggers by themselves?- You're allowing var(6) to increase even if the char doesn't have enough power for it, that'll cause you problems when you get to the attack state and need to check how much he charged the move. In other words, he'll be able to charge to max with only one power bar.
ok oddly it played the first...second....but not 3rd animation(3003)also..if i have 2000 power and charge it plays the first animation only
blackchaos07 said, November 21, 2008, 01:49:19 am[State 3000]type=poweraddtrigger1= var(6)>60value=-1000persistent=0[State 3000]type=poweraddtrigger1= var(6)>120value=-1000persistent=0Try like this, with > rather than >=. Also check my edit on the previous post.
ok thanks that works now.not sure how to go about what you said in the previous post.QuoteYou're allowing var(6) to increase even if the char doesn't have enough power for it, that'll cause you problems when you get to the attack state and need to check how much he charged the move. In other words, he'll be able to charge to max with only one power bar.[mcode][State 3002,VarSet]type = Varaddtrigger1 = Command = "hold_c"v = 6value = 1[/mcode]how do i implement that here..... like obviously for increasing from 0-60 ill need 1000 power, and from 61-120 2000 power and so onor am i being completely retarded and need to code something in the changestate
ok for the changing into the attack state i have[mcode][State 3002,ChangeState]type = ChangeStatetrigger1 = Var(7) = 0trigger2 = Var(6) >= 150trigger3 = (var(6)=[61,120]) && power!=2000trigger4 = (var(6)=[0,60]) && power!=1000value = 3100ctrl = 0[/mcode]if i have 1000 power only, it attacks and cannot charge any higher.if i have 2000 power it charges to the next level then attacks without allowing me to charge to maximumnow the problem is when i have 3000 power i just plays the attack animation(only removing 1000 power)so i almost got it right... atleast now i cant charge fully when i dont have enough power.
thats because you only specified one value i believe. !=2000 means your power can still be 2001 or 2059. adding some range for what you want to do might work!=[2000,2999] or !=[1000,1999] i haven't read everything above, so i might be posting nonsense
i think its a case of me coding the wrong thing, and not giving enough information over. i dunno.how do i make it so that if i only have 1000 power it wont charge and just attack? i have the trigger when var(7)=0 in the changestate which is when im not holding the button in it will go into the attack state anyway. i just need to sort the power requirements out.also like you have 2000 power so you charge it for 2 lvls..... how do i make it attack after the 2nd level is charged and i have no power left?because i have the trigger when var(6)>=150 to go into the attack state, as thats the maximum time alowed to charge(which is also 3 lvls of charging power)heres my code see if you can help[mcode][statedef 3000]type = Smovetype = Iphysics = Svelset = 0,0ctrl = 0anim = 3000poweradd = -1000[State 0, SuperPause]type = SuperPausetrigger1 = time = 0time = 45anim = -1sound = S1500,7pos = 0,40darken = 1p2defmul = 0poweradd = 0unhittable = 1[State 3002,VarSet]type = Varsettrigger1 = Time = 0v = 6value = 0[State 3002,VarSet]type = Varsettrigger1 = Command != "hold_c"v = 7value = 0[State 3002,VarSet]type = Varaddtrigger1 = Command = "hold_c"v = 6value = 1[State 3002,VarSet]type = Varsettrigger1 = Command = "hold_c"v = 7value = 1[State 3002, ChangeAnim]type = ChangeAnimtrigger1 = (var(6)=[0,60])value = 3001persistent = 0ignorehitpause =1[State 3002, ChangeAnim]type = ChangeAnimtrigger1 = (var(6)=[61,120])&& power>=1000value = 3002persistent = 0ignorehitpause =1[State 3002, ChangeAnim]type = ChangeAnimtrigger1 = var(6)>120 && power>=1000value = 3003persistent = 0ignorehitpause =1[State 3000]type=poweraddtrigger1= var(6)>60value=-1000persistent=0[State 3000]type=poweraddtrigger1= var(6)>120value=-1000persistent=0[State 0, PlaySnd]type = PlaySndtriggerall = anim = 3001trigger1 = animelem = 2value = S1500,6volume = 100[State 0, PlaySnd]type = PlaySndtriggerall = anim = 3002trigger1 = animelem = 2value = S1500,6volume = 100[State 0, PlaySnd]type = PlaySndtriggerall = anim = 3003trigger1 = animelem = 2value = S1500,6volume = 100[State 3002,ChangeState]type = ChangeStatetrigger1 = Var(7) = 0trigger2 = Var(6) >= 150value = 3100ctrl = 0[statedef 3100]type = Amovetype = Aphysics = Nctrl = 0velset= 0,0poweradd = 0[State 0, ChangeAnim]type = ChangeAnimtrigger1 =time = 0value = 3500[State 3300, AfterImage]type = AfterImagetrigger1 = time = 0time = 40length = 13palcolor = 256palbright = 0,0,0palcontrast = 100,0,0paladd = 80,10,25palmul = .66,.65,.75timegap = 1framegap = 2trans = add1ignorehitpause = 1[State 0, PlaySnd]type = PlaySndtrigger1 = time = 0value = S1500,4volume = 100channel = 3[State 0, StopSnd]type = StopSndtrigger1 = movecontactchannel = 3[State 3003,Valadd]type = Veladdtrigger1 = 1x = .2[State 3003,Valadd]type = Veladdtrigger1 = 1trigger1 = Var(6) > 0trigger1 = Var(6) < 60x = .10[State 3003,Valadd]type = Veladdtrigger1 = 1trigger1 = Var(6) > 60trigger1 = Var(6) < 120x = .40[State 3003,Valadd]type = Veladdtrigger1 = 1trigger1 = var(6)>120x = .70[State 600, 1]type = HitDeftrigger1 = time = 0attr = A, HAdamage = ifelse((var(6)=[0,60]),120,ifelse((var(6)=[61,120]),230,305))animtype = hardguardflag = MAFhitflag = MApriority = 7, Hitpausetime = 5, 10sparkno = 2sparkxy = -10, -48hitsound = S1500,5guardsound = 6, 0ground.type = Highground.slidetime = 5ground.hittime = 25ground.velocity = -6airguard.velocity = -1.9,-.8air.type = Highair.velocity = -1.4,-3air.hittime = 12fall = 1getpower = 0air.fall= 1fall.recover=0envshake.time = ifelse((var(6)=[0,60]),30,ifelse((var(6)=[61,120]),40,50))envshake.freq = ifelse((var(6)=[0,60]),80,ifelse((var(6)=[61,120]),120,200))[State 0, ChangeState]type = ChangeStatetrigger1 = movecontactvalue = 0ctrl = 1[/mcode]3000 is the charging state(super pause and stuff as well)3001 is the attack state.
ok well with the above this workedtrigger3 = (var(6)=[61,120]) && power=0 (trigger in the changestate)this means that if when (var(6)=[61,120]) and i have no power left(so basically its charged by 2 levels) then attack.so all i gotta do is the same for var(6)=[0,60]finally i fixed it[mcode][State 3002,ChangeState]type = ChangeStatetrigger1 = Var(7) = 0trigger2 = Var(6) >= 150trigger3 = (var(6)=[61,120]) && power=0trigger4 = (var(6)=[0,60]) && power = 0value = 3100ctrl = 0[/mcode]move works fine now...thanks for the help.EDIT:slight correction[mcode][State 3002,ChangeState]type = ChangeStatetrigger1 = Var(7) = 0trigger2 = Var(6) >= 150trigger3 = (var(6)=[61,120]) && power<1000trigger4 = (var(6)=[0,60]) && power < 1000value = 3100ctrl = 0[/mcode]the first code would let me charge a level even if i only have 1 value of power or more... this one not limits that in saying i have to have 1000 power minimum to charge a level.