Infinity MUGEN Team

IMT Main => M.U.G.E.N Help => Topic started by: Luis/Dshiznet on September 11, 2007, 10:04:43 PM

Title: Help on charging code.
Post by: Luis/Dshiznet on September 11, 2007, 10:04:43 PM
im trying to make a charging animation for my wip, i have the previous movements for the charge, and the charge animations
can some one help me?
Title: Re: Help on charging code.
Post by: Error Macro on September 11, 2007, 10:06:02 PM
Charge? You mean like CVS, and DBZ characters building up energy in the power bar?
Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 11, 2007, 10:08:04 PM
Charge? You mean like CVS, and DBZ characters building up energy in the power bar?
yes .. help?
Title: Re: Help on charging code.
Post by: Error Macro on September 11, 2007, 10:13:04 PM
I think I know how to do this.

Make a state with a

[State 0, PowerAdd]
type = PowerAdd
trigger1 = animelem = (the first frame of his charging anim)
value = 4
;ignorehitpause =
;persistent =

Just off top of my head, try it and tell me how it works.
Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 11, 2007, 10:14:11 PM
I think I know how to do this.

Make a state with a

[State 0, PowerAdd]
type = PowerAdd
trigger1 = animelem = (the first frame of his charging anim)
value = 4
;ignorehitpause =
;persistent =

Just off top of my head, try it and tell me how it works.
and then what?
cuz i already had that..
Title: Re: Help on charging code.
Post by: Error Macro on September 11, 2007, 10:20:52 PM
Really? Just add it to the state and try using it. :|

Also for CvS the charge command is Y+B (MP+MK)
Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 11, 2007, 10:24:35 PM
man you really need work on your helping skill.. no offense..
ok now im doing all over from scratch. now tell me

where do i begin in my cns.
Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 11, 2007, 10:30:52 PM
[StateDef 678]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 678
poweradd = 20

[State 1050, PowerAdd]
type = PowerAdd
trigger1 = AnimElem =  1
value = 4
;ignorehitpause =
;persistent =

thats what i have so far..
Title: Re: Help on charging code.
Post by: Error Macro on September 11, 2007, 10:46:09 PM
Modified version of P.o.t.s charge code.

Ok then, add this ANYWHERE in the cns, just not under Statedef -2, or -3.

[Statedef 740]
type=S
physics=S
movetype=I
anim= number of charging anim.
ctrl=0
velset=0,0

[State 740, power]
type=poweradd
triggerall=anim= *your anim* &&power<powermax
trigger1=var(??)<=0&&(command="holdb"&&command="holdy")
trigger2=var(??)>=1
value=2+(time/10)

[State 740, shake]
type=envshake
trigger1=anim=740&&!(time%4)
time=4
freq=80
ampl=2

[State 740, flash]
type=palfx
trigger1=anim=740&&!(time%12)
add=80,20,0
sinadd=80,20,0,12
time=12

[State 740, anim]
type=changeanim
triggerall=anim=*Your anim*&&animelemtime(2)>=0
trigger1=var(??)<=0&&(command!="holdb"||command!="holdy")
trigger2=power>=powermax||roundstate!=2
trigger3=var(??)>=1&&(inguarddist||p2movetype=A||p2dist x<160)
value=741

[State 740, end]
type=changestate
trigger1=anim=741&&!animtime
value=0
ctrl=1

Make var (??) any free var number that you may have.

Ok then after adding that, add this to your cmd.

[Command]
name="holda"
command=/a
time=1

[Command]
name="holdb"
command=/b
time=1

[Command]
name="holdc"
command=/c
time=1

[Command]
name="holdx"
command=/x
time=1

[Command]
name="holdy"
command=/y
time=1

[Command]
name="holdz"
command=/z
time=1

Now add this under statedef -1 in the cmd

[State -1, powercharge]
type=changestate
value=740
triggerall= var(??)>=1
trigger1= roundstate=2 && statetype!=A
trigger1= (power < const(data.power) && power < powermax) && !var(qwerty)
trigger1= ctrl
trigger1= !inguarddist && p2bodydist x>=160 && random<100

Make var (qwerty) any free var number you have.

(hopefully I explained this easily.)
Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 12, 2007, 03:45:46 PM
Modified version of P.o.t.s charge code.

Ok then, add this ANYWHERE in the cns, just not under Statedef -2, or -3.

[Statedef 740]
type=S
physics=S
movetype=I
anim= number of charging anim.
ctrl=0
velset=0,0

[State 740, power]
type=poweradd
triggerall=anim= *your anim* &&power<powermax
trigger1=var(??)<=0&&(command="holdb"&&command="holdy")
trigger2=var(??)>=1
value=2+(time/10)

[State 740, shake]
type=envshake
trigger1=anim=740&&!(time%4)
time=4
freq=80
ampl=2

[State 740, flash]
type=palfx
trigger1=anim=740&&!(time%12)
add=80,20,0
sinadd=80,20,0,12
time=12

[State 740, anim]
type=changeanim
triggerall=anim=*Your anim*&&animelemtime(2)>=0
trigger1=var(??)<=0&&(command!="holdb"||command!="holdy")
trigger2=power>=powermax||roundstate!=2
trigger3=var(??)>=1&&(inguarddist||p2movetype=A||p2dist x<160)
value=741

[State 740, end]
type=changestate
trigger1=anim=741&&!animtime
value=0
ctrl=1

Make var (??) any free var number that you may have.

Ok then after adding that, add this to your cmd.

[Command]
name="holda"
command=/a
time=1

[Command]
name="holdb"
command=/b
time=1

[Command]
name="holdc"
command=/c
time=1

[Command]
name="holdx"
command=/x
time=1

[Command]
name="holdy"
command=/y
time=1

[Command]
name="holdz"
command=/z
time=1

Now add this under statedef -1 in the cmd

[State -1, powercharge]
type=changestate
value=740
triggerall= var(??)>=1
trigger1= roundstate=2 && statetype!=A
trigger1= (power < const(data.power) && power < powermax) && !var(qwerty)
trigger1= ctrl
trigger1= !inguarddist && p2bodydist x>=160 && random<100

Make var (qwerty) any free var number you have.

(hopefully I explained this easily.)
omg.. no that did not help
like i said.. i need help in coding this.. not to rip a code from another type of character
now like i said be4
help me code it from scratch.. no more coding from other characters ok?
Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 12, 2007, 06:59:04 PM
.....
Title: Re: Help on charging code.
Post by: Fallen_Angel on September 12, 2007, 07:30:26 PM
I'm just going to tell you what to do and you have ti code it, first create the statedef, and then put a poweradd, and the you put in the trigger1 = time >= 0 ; these means than as soon as you start the anim , then the value, is the number of energy that you will increase, and then make the changestate and thats it
Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 12, 2007, 07:38:19 PM
ok, thanks fall i can always rely on you
ok this is what i have so far
[Statedef 654]
type    = S
movetype= S
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
anim = 654
sprpriority = 2
trigger1 = time >= 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =   AnimElem = 1
value = 1011
;elem = 1
;ignorehitpause =
;persistent =

654= animation before charging
1011= charging animation.

is it good so far?
Title: Re: Help on charging code.
Post by: Fallen_Angel on September 12, 2007, 07:55:24 PM
ok, thanks fall i can always rely on you
ok this is what i have so far
[Statedef 654]
type    = S
movetype= S
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
anim = 654
sprpriority = 2
trigger1 = time >= 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =   AnimElem = 1
value = 1011
;elem = 1
;ignorehitpause =
;persistent =

654= animation before charging
1011= charging animation.

is it good so far?
No, because you put a trigger in the statedef, and not in a state, and  I would have make it in 2 differents state, like these

[Statedef 654]
type    = S
movetype= S
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
anim = 654
sprpriority = 2


[State 0, Change]
type = Changestate
trigger1 =   Animtime = 0
value = 655
ctrl = 0

[Statedef 655]
type    = S
movetype= S
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
anim = 1011
sprpriority = 2

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time >= 0
value = 100

[State 0, Change]
type = Changestate
trigger1 =   Animtime = 0
value = 0
ctrl = 1
Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 12, 2007, 08:06:37 PM
ok i tried this error came up:
state movetype *s* is not valid
Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 12, 2007, 08:08:07 PM
klolol ok i got it again
now like i said be4, how can i make it so when i let go of the button config, he stops?
Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 12, 2007, 08:40:40 PM
still there angel? anyone?
Title: Re: Help on charging code.
Post by: Fallen_Angel on September 12, 2007, 10:11:33 PM
sorry for not answering earlyer
To male that happens you need to put these in the changestate, I'asumming that the commands thar you are using is holdy and holdb

[State xxxx, x]
type = ChangeState
trigger1 = command != "holdy" && command != "holdb"
value = 0
ctrl = 1

these means that the character is going to change the state when you are not pressing y and b

Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 12, 2007, 10:22:10 PM
not really i had it.. the cmd code for it was a,c lol
will that effect it?

or do i have to change it to * y+b*?
Title: Re: Help on charging code.
Post by: Fallen_Angel on September 12, 2007, 10:33:26 PM
not really i had it.. the cmd code for it was a,c lol
will that effect it?

or do i have to change it to * y+b*?

if you are using a,c, make sure than in the cmd you have these

[Command]
name = "holdc"
command = /$c
time = 1

[Command]
name = "holda"
command = /$c
time = 1

and in the changestate change these

trigger1 = command != "holdc" && command != "holda"
Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 12, 2007, 10:41:29 PM
not really i had it.. the cmd code for it was a,c lol
will that effect it?

or do i have to change it to * y+b*?

if you are using a,c, make sure than in the cmd you have these

[Command]
name = "holdc"
command = /$c
time = 1

[Command]
name = "holda"
command = /$c
time = 1

and in the changestate change these

trigger1 = command != "holdc" && command != "holda"

still wont work.. this is what i have.

charge
[Statedef 654]
type    = s
movetype= A
physics = s
juggle  = 4
poweradd= 10
ctrl = 0
anim = 654
sprpriority = 2


[State 0, Change]
type = Changestate
trigger1 = command != "holdc" && command != "holda"
value = 655
ctrl = 0


[Statedef 655]
type    = s
movetype= A
physics = s
juggle  = 4
poweradd= 10
ctrl = 0
anim = 1011
sprpriority = 2

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time >= 0
value = 10


cmd.
[command]
name = "charging"
command = a+c
time = 15

;charging
[State -1, charging]
type = ChangeState
value = 654
triggerall = command = "charging"
trigger1 = (statetype = s) && ctrl



Title: Re: Help on charging code.
Post by: Fallen_Angel on September 12, 2007, 10:47:56 PM
You have to change the  first changestate, and you have to add one in the secnd one, remembre you always have to have a changestate

these is the first change state
State 0, Change]
type = Changestate
trigger1 = animtime = 0
value = 655
ctrl = 0

these is the second changestate
[State 0, Change]
type = Changestate
trigger1 = command != "holdc" && command != "holda"
value = 0
ctrl = 1
Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 12, 2007, 10:52:14 PM
ok i put it in, now he does it.. but doesnt want to stop 0_o

[Statedef 654]
type    = s
movetype= A
physics = s
juggle  = 4
poweradd= 10
ctrl = 0
anim = 654
sprpriority = 2


[State 0, Change]
type = Changestate
trigger1 = animtime = 0
value = 655
ctrl = 0

[State 0, Change]
type = Changestate
trigger1 = command != "holdc" && command != "holda"
value = 0
ctrl = 1

[Statedef 655]
type    = s
movetype= A
physics = s
juggle  = 4
poweradd= 10
ctrl = 0
anim = 1011
sprpriority = 2

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time >= 0
value = 10
Title: Re: Help on charging code.
Post by: Fallen_Angel on September 12, 2007, 10:54:41 PM
thet happened because you didnt puy the changestate in the second statedef, try these
[Statedef 654]
type    = s
movetype= A
physics = s
juggle  = 4
poweradd= 10
ctrl = 0
anim = 654
sprpriority = 2


[State 0, Change]
type = Changestate
trigger1 = animtime = 0
value = 655
ctrl = 0



[Statedef 655]
type    = s
movetype= A
physics = s
juggle  = 4
poweradd= 10
ctrl = 0
anim = 1011
sprpriority = 2

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time >= 0
value = 10

[State 0, Change]
type = Changestate
trigger1 = command != "holdc" && command != "holda"
value = 0
ctrl = 1
Title: Re: Help on charging code.
Post by: Luis/Dshiznet on September 12, 2007, 11:05:59 PM
omfg

i love you dude it works great!!

thanks alot dude.
SimplePortal 2.3.5 © 2008-2012, SimplePortal