YesNoOk
avatar

power reduciton.. varadd. (Read 889 times)

Started by BC, November 21, 2008, 12:35:23 am
Share this topic:

BC

power reduciton.. varadd.
#1  November 21, 2008, 12:35:23 am
  • ****
    • UK
    • www.mugenevolution.co.uk/Forum
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 -3000

sadly 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.
click the image to join my forum ;)
Last Edit: November 21, 2008, 12:40:02 am by blackchaos07
Re: power reduciton.. varadd.
#2  November 21, 2008, 12:47:26 am
  • ******
    • www.mugenguild.com/pots/
power = ifelse((var(6)=[0,60]),-1000,ifelse((var(6)=[61,120]),-2000,-3000))

...???
Use anything you want from my works.  If you need to contact me use email, not private messages.

BC

Re: power reduciton.. varadd.
#3  November 21, 2008, 12:51:12 am
  • ****
    • UK
    • www.mugenevolution.co.uk/Forum
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 power

when 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.

click the image to join my forum ;)
Re: power reduciton.. varadd.
#4  November 21, 2008, 01:00:00 am
  • ******
    • www.mugenguild.com/pots/
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).
Use anything you want from my works.  If you need to contact me use email, not private messages.

BC

Re: power reduciton.. varadd.
#5  November 21, 2008, 01:07:15 am
  • ****
    • UK
    • www.mugenevolution.co.uk/Forum
sorry for not being clear enough. (this is for the cns)

its a rocket kick move

you activate the command for the move  which is D,DF,F c

doing 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 kick

if 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.
click the image to join my forum ;)
Re: power reduciton.. varadd.
#6  November 21, 2008, 01:10:31 am
  • ******
    • www.mugenguild.com/pots/
Ah, I see, you want it to remove power on the spot while charging. Try this:

[Statedef]
poweradd=-1000; first level

[State]
type=poweradd
trigger1= var(6)>=60; second level
value=-1000
persistent=0

[State]
type=poweradd
trigger1= var(6)>=120; third level
value=-1000
persistent=0

Quote
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.
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.
Use anything you want from my works.  If you need to contact me use email, not private messages.

BC

Re: power reduciton.. varadd.
#7  November 21, 2008, 01:19:26 am
  • ****
    • UK
    • www.mugenevolution.co.uk/Forum
thanks that works fine.

one last thing.

i added power>=1000 in the cmd

when i have at least 1000 power.. i can still charge to the second phase which requires 2000 power

i 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?
click the image to join my forum ;)
Re: power reduciton.. varadd.
#8  November 21, 2008, 01:22:20 am
  • ******
    • www.mugenguild.com/pots/
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.
Use anything you want from my works.  If you need to contact me use email, not private messages.

BC

Re: power reduciton.. varadd.
#9  November 21, 2008, 01:27:22 am
  • ****
    • UK
    • www.mugenevolution.co.uk/Forum
[mcode][State 3002, ChangeAnim]
type = ChangeAnim
trigger1 = (var(6)=[0,60]) && power>=1000
value = 3001
persistent = 0
ignorehitpause =1

[State 3002, ChangeAnim]
type = ChangeAnim
trigger1 = (var(6)=[61,120]) && power>=2000
value = 3002
persistent = 0
ignorehitpause =1

[State 3002, ChangeAnim]
type = ChangeAnim
trigger1 = var(6)>120 && power>=3000
value = 3003
persistent = 0
ignorehitpause =1[/mcode]


ok i added that...works ok, but removes the power levels still
click the image to join my forum ;)

BC

Re: power reduciton.. varadd.
#10  November 21, 2008, 01:30:29 am
  • ****
    • UK
    • www.mugenevolution.co.uk/Forum
its ok i solved it

trigger3 = power<=1000


added that to the changestate that makes him travel on the rocket.


EDIT: actually that didnt ignore that lol
click the image to join my forum ;)
Re: power reduciton.. varadd.
#11  November 21, 2008, 01:34:49 am
  • ******
    • www.mugenguild.com/pots/
ok i added that...works ok, but removes the power levels still

so 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 :dizzy2:, 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.
Use anything you want from my works.  If you need to contact me use email, not private messages.
Last Edit: November 21, 2008, 01:42:49 am by P.o.t.S.

BC

Re: power reduciton.. varadd.
#12  November 21, 2008, 01:49:19 am
  • ****
    • UK
    • www.mugenevolution.co.uk/Forum
[mcode][statedef 3000]
type = S
movetype = I
physics = S
velset = 0,0
ctrl = 0
anim = 3000
poweradd = -1000

[State 0, SuperPause]
type = SuperPause
trigger1 = time = 0
time = 45
anim = -1
sound = S1500,7
pos = 0,40
darken = 1
p2defmul = 0
poweradd = 0
unhittable = 1

[State 3002,VarSet]
type = Varset
trigger1 = Time = 0
v = 6
value = 0

[State 3002,VarSet]
type = Varset
trigger1 = Time = 0
v = 7
value = 0

[State 3002,VarSet]
type = Varadd
trigger1 = Command = "hold_c"
v = 6
value = 1

[State 3002,VarSet]
type = Varset
trigger1 = Command = "hold_c"
v = 7
value = 1

[State 3002,VarSet]
type = Varset
trigger1 = Command != "hold_c"
v = 7
value = 0

[State 3002, ChangeAnim]
type = ChangeAnim
trigger1 = (var(6)=[0,60])&& power>=1000
value = 3001
persistent = 0
ignorehitpause =1

[State 3002, ChangeAnim]
type = ChangeAnim
trigger1 = (var(6)=[61,120])&& power>=2000
value = 3002
persistent = 0
ignorehitpause =1

[State 3002, ChangeAnim]
type = ChangeAnim
trigger1 = var(6)>120 && power>=3000
value = 3003
persistent = 0
ignorehitpause =1

[State 3000]
type=poweradd
trigger1= var(6)>=60
value=-1000
persistent=0

[State 3000]
type=poweradd
trigger1= var(6)>=120
value=-1000
persistent=0

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 3001
trigger1 = animelem = 2
value = S1500,6
volume = 100

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 3002
trigger1 = animelem = 2
value = S1500,6
volume = 100

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 3003
trigger1 = animelem = 2
value = S1500,6
volume = 100

[State 3002,ChangeState]
type = ChangeState
trigger1 = Var(7) = 0
trigger2 = Var(6) >= 190
value = 3100
ctrl = 0[/mcode]

im being a tit...lol

ok now when i have 3000 power and hold the move charging button it doesnt get past anim 3001
click the image to join my forum ;)
Re: power reduciton.. varadd.
#13  November 21, 2008, 01:56:19 am
  • ******
    • www.mugenguild.com/pots/
[State 3002, ChangeAnim]
type = ChangeAnim
trigger1 = (var(6)=[0,60])  && power>=1000
value = 3001
persistent = 0
ignorehitpause =1

[State 3002, ChangeAnim]
type = ChangeAnim
trigger1 = (var(6)=[61,120])&& power>=1000
value = 3002
persistent = 0
ignorehitpause =1

[State 3002, ChangeAnim]
type = ChangeAnim
trigger1 = var(6)>120 && power>=1000
value = 3003
persistent = 0
ignorehitpause =1

Tried 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.
Use anything you want from my works.  If you need to contact me use email, not private messages.
Last Edit: November 21, 2008, 02:06:13 am by P.o.t.S.

BC

Re: power reduciton.. varadd.
#14  November 21, 2008, 01:58:44 am
  • ****
    • UK
    • www.mugenevolution.co.uk/Forum
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  :S
click the image to join my forum ;)
Re: power reduciton.. varadd.
#15  November 21, 2008, 02:04:41 am
  • ******
    • www.mugenguild.com/pots/
[State 3000]
type=poweradd
trigger1= var(6)>60
value=-1000
persistent=0

[State 3000]
type=poweradd
trigger1= var(6)>120
value=-1000
persistent=0

Try like this, with > rather than >=. Also check my edit on the previous post.
Use anything you want from my works.  If you need to contact me use email, not private messages.

BC

Re: power reduciton.. varadd.
#16  November 21, 2008, 02:11:18 am
  • ****
    • UK
    • www.mugenevolution.co.uk/Forum
ok thanks that works now.

not sure how to go about what you said in the previous post.

Quote
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.

[mcode][State 3002,VarSet]
type = Varadd
trigger1 = Command = "hold_c"
v = 6
value = 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 on


or am i being completely retarded and need to code something in the changestate
click the image to join my forum ;)
Last Edit: November 21, 2008, 02:14:33 am by blackchaos07

BC

Re: power reduciton.. varadd.
#17  November 21, 2008, 02:44:39 am
  • ****
    • UK
    • www.mugenevolution.co.uk/Forum
ok for the changing into the attack state i have

[mcode][State 3002,ChangeState]
type = ChangeState
trigger1 = Var(7) = 0
trigger2 = Var(6) >= 150
trigger3 =  (var(6)=[61,120]) && power!=2000
trigger4 = (var(6)=[0,60]) && power!=1000
value = 3100
ctrl = 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 maximum

now 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.
click the image to join my forum ;)
Re: power reduciton.. varadd.
#18  November 21, 2008, 08:27:56 am
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
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 :-X

BC

Re: power reduciton.. varadd.
#19  November 21, 2008, 02:20:16 pm
  • ****
    • UK
    • www.mugenevolution.co.uk/Forum
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 = S
movetype = I
physics = S
velset = 0,0
ctrl = 0
anim = 3000
poweradd = -1000

[State 0, SuperPause]
type = SuperPause
trigger1 = time = 0
time = 45
anim = -1
sound = S1500,7
pos = 0,40
darken = 1
p2defmul = 0
poweradd = 0
unhittable = 1

[State 3002,VarSet]
type = Varset
trigger1 = Time = 0
v = 6
value = 0

[State 3002,VarSet]
type = Varset
trigger1 =  Command != "hold_c"
v = 7
value = 0

[State 3002,VarSet]
type = Varadd
trigger1 = Command = "hold_c"
v = 6
value = 1

[State 3002,VarSet]
type = Varset
trigger1 = Command = "hold_c"
v = 7
value = 1

[State 3002, ChangeAnim]
type = ChangeAnim
trigger1 = (var(6)=[0,60])
value = 3001
persistent = 0
ignorehitpause =1

[State 3002, ChangeAnim]
type = ChangeAnim
trigger1 = (var(6)=[61,120])&& power>=1000
value = 3002
persistent = 0
ignorehitpause =1

[State 3002, ChangeAnim]
type = ChangeAnim
trigger1 = var(6)>120 && power>=1000
value = 3003
persistent = 0
ignorehitpause =1

[State 3000]
type=poweradd
trigger1= var(6)>60
value=-1000
persistent=0

[State 3000]
type=poweradd
trigger1= var(6)>120
value=-1000
persistent=0

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 3001
trigger1 = animelem = 2
value = S1500,6
volume = 100

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 3002
trigger1 = animelem = 2
value = S1500,6
volume = 100

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 3003
trigger1 = animelem = 2
value = S1500,6
volume = 100

[State 3002,ChangeState]
type = ChangeState
trigger1 = Var(7) = 0
trigger2 = Var(6) >= 150
value = 3100
ctrl = 0

[statedef 3100]
type = A
movetype = A
physics = N
ctrl = 0
velset=  0,0
poweradd = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time = 0
value = 3500

[State 3300, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 40
length = 13
palcolor = 256
palbright = 0,0,0
palcontrast = 100,0,0
paladd = 80,10,25
palmul = .66,.65,.75
timegap = 1
framegap = 2
trans = add1
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S1500,4
volume = 100
channel = 3

[State 0, StopSnd]
type = StopSnd
trigger1 = movecontact
channel = 3

[State 3003,Valadd]
type = Veladd
trigger1 = 1
x = .2

[State 3003,Valadd]
type = Veladd
trigger1 = 1
trigger1 = Var(6) > 0
trigger1 = Var(6) < 60
x = .10

[State 3003,Valadd]
type = Veladd
trigger1 = 1
trigger1 = Var(6) > 60
trigger1 = Var(6) < 120
x = .40

[State 3003,Valadd]
type = Veladd
trigger1 = 1
trigger1 = var(6)>120
x = .70

[State 600, 1]
type = HitDef
trigger1 = time = 0
attr = A, HA
damage = ifelse((var(6)=[0,60]),120,ifelse((var(6)=[61,120]),230,305))
animtype = hard
guardflag = MAF
hitflag = MA
priority = 7, Hit
pausetime = 5, 10
sparkno = 2
sparkxy = -10, -48
hitsound = S1500,5
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 25
ground.velocity = -6
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12
fall = 1
getpower = 0
air.fall= 1
fall.recover=0
envshake.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 = ChangeState
trigger1 = movecontact
value = 0
ctrl = 1[/mcode]


3000 is the charging state(super pause and stuff as well)

3001 is the attack state.
click the image to join my forum ;)

BC

Re: power reduciton.. varadd.
#20  November 21, 2008, 02:45:12 pm
  • ****
    • UK
    • www.mugenevolution.co.uk/Forum
ok well with the above this worked

trigger3 = (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 = ChangeState
trigger1 = Var(7) = 0
trigger2 = Var(6) >= 150
trigger3 = (var(6)=[61,120]) && power=0
trigger4 = (var(6)=[0,60]) && power = 0
value = 3100
ctrl = 0
[/mcode]


move works fine now...thanks for the help.

EDIT:

slight correction

[mcode][State 3002,ChangeState]
type = ChangeState
trigger1 = Var(7) = 0
trigger2 = Var(6) >= 150
trigger3 = (var(6)=[61,120]) && power<1000
trigger4 = (var(6)=[0,60]) && power < 1000
value = 3100
ctrl = 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.
click the image to join my forum ;)
Last Edit: November 21, 2008, 02:51:51 pm by blackchaos07