Infinity MUGEN Team

IMT Main => M.U.G.E.N Help => Topic started by: shin fuuma on September 20, 2007, 02:14:32 PM

Title: ? about adding a special move to a charecter
Post by: shin fuuma on September 20, 2007, 02:14:32 PM
i have the coding from another (open sorce) charecter for a special move. how do i add this to the new charecter?
i have the new sprites done and an animation made. the problem i have is that the move im adding has the same state # (i think) as an existing move that i dont want to replace. i think it is state 1000 (im at work right now and will check for sure when i get home) i just want to know for sure "where" to add the code, and what else ill need to change.

thanks


Title: Re: ? about adding a special move to a charecter
Post by: A! on September 20, 2007, 02:55:09 PM
add it in the cns then the cmd
Title: Re: ? about adding a special move to a charecter
Post by: grandma on September 20, 2007, 03:28:34 PM
im having the same problem actually.  if someone could post an example of how to accomplish inserting a move into the cns/cmd i would very much appreciate it.
Title: Re: ? about adding a special move to a charecter
Post by: A! on September 20, 2007, 03:33:03 PM
im having the same problem actually.  if someone could post an example of how to accomplish inserting a move into the cns/cmd i would very much appreciate it.

check the tutorial section that mighthelp..
Title: Re: ? about adding a special move to a charecter
Post by: grandma on September 20, 2007, 03:46:34 PM
im having the same problem actually.  if someone could post an example of how to accomplish inserting a move into the cns/cmd i would very much appreciate it.

check the tutorial section that mighthelp..

thanks for the suggestion but theres nothing in there that really addresses the prob im having. i really just need someone to show me exactly what parts of the character who has the move (in the cns and the cmd) and exactly where i need to put them in the cns/cmd of the character i want to transfer the move to.  frankenspriting isnt an issue, ive got that down.  i just need someone to walk me through the technical mumbo jumbo of cns/cmd.
Title: Re: ? about adding a special move to a charecter
Post by: Fallen_Angel on September 20, 2007, 04:03:40 PM
i have the coding from another (open sorce) charecter for a special move. how do i add this to the new charecter?
i have the new sprites done and an animation made. the problem i have is that the move im adding has the same state # (i think) as an existing move that i dont want to replace. i think it is state 1000 (im at work right now and will check for sure when i get home) i just want to know for sure "where" to add the code, and what else ill need to change.

thanks




If its the same statedef number, all you have to do is change it to a statatedef number that you are not using , and change the state number in the cmd
Title: Re: ? about adding a special move to a charecter
Post by: shin fuuma on September 20, 2007, 04:05:33 PM
ok here is the code i want to add:


from cmd:

[State -1, psychocrusher]
type=changestate
value=1000
triggerall=var(59)<=0&&roundstate=2&&statetype!=A
triggerall=(var(20)<=0&&(command="cbfx"||command="cbfy"||command="cbfz"))||(var(20)>0&&(comma

nd="bfx"||command="bfy"||command="bfz"))
trigger1=ctrl
trigger2=(stateno=[200,250])&&movecontact
trigger3=movecontact&&var(20)
trigger4=(stateno=[1000,3999])&&numhelper(stateno+5)&&var(10)<=3&&var(20)
trigger4=helper(stateno+5),var(3)







from cns:


;========================<PSYCHO CRUSHER>=============================
[Statedef 1000]
type=S
physics=S
movetype=A
ctrl=0
anim=1000
velset=0,0
poweradd=60*!var(20)
juggle=ifelse((p2movetype=H&&p2statetype=A),15,5)

[State 1000, strengthvar]
type=varset
trigger1=!time&&var(59)<=0
var(10)=ifelse((command="bfz"||command="cbfz"),3,ifelse((command="bfy"||command="cbfy"),2,1))
[State 1000, strengthvarAI]
type=varset
trigger1=!time&&var(59)>=1
var(10)=ifelse(random<500,3,ifelse(random<666,2,1))

[State 1000, width]
type=width
trigger1=anim=1000&&animelemtime(4)>=0
value=20;55
ignorehitpause=1
[State 1000, push]
type=playerpush
trigger1=anim=1000&&animelemtime(6)>=0
value=0
ignorehitpause=1

[State 1000, nothitby]
type=nothitby
trigger1=anim=1000&&animelemtime(6)>=0
value=,NP
time=1
ignorehitpause=1

[State 1000, shield]
type=helper
trigger1=!numhelper(1007)
trigger1=anim=1000&&animelemtime(6)>=0
helpertype=normal
stateno=1007
ID=1007
name="Projectile Hitter"
postype=p1

[State 1000, vel]
type=velset
trigger1=anim=1000&&animelemtime(4)>=0
x=ifelse(var(10)=3,10,ifelse(var(10)=2,7.5,5))
y=0
[State 1000, statetype]
type=statetypeset
trigger1=anim=1000&&animelemtime(4)>=0
statetype=A
physics=N

[State 1000, fx]
type=helper
trigger1=!numhelper(0)
trigger1=anim=1000&&animelemtime(6)>=0
helpertype=normal
stateno=1005
ID=1005
name="Psycho Crusher"
postype=p1
size.xscale=.5
size.yscale=.5
ownpal=1

[State 1000, snd]
type=playsnd
trigger1=anim=1000&&animelem=4
value=0,40
[State 1000, dust]
type=explod
trigger1=anim=1000&&animelem=4
anim=7100
ID=7100
sprpriority=3
postype=p1
pos=0,ceil(pos y)
scale=.5,.5

[State 1000, snd]
type=playsnd
trigger1=anim=1000&&animelem=5
value=4,5
channel=0
[State 1000, snd]
type=playsnd
trigger1=anim=1000&&animelem=5
value=5,4

[State 1000, hitvar]
type=varset
trigger1=anim!=1000
trigger2=anim=1000&&animelemtime(6)<0
var(14)=0
[State 1000, hitvar]
type=varadd
trigger1=anim=1000&&(movehit=1||moveguarded=1||movereversed=1)
var(14)=ifelse(moveguarded,1,3)
[State 1000, hitvar]
type=varset
trigger1=numtarget(1000)
trigger1=(target(1000),stateno=[5000,5020])&&!(target(1000),time)
var(14)=3
ignorehitpause=1

[State 1000, hit]
type=hitdef
trigger1=anim=1000&&animelemtime(6)>=0
trigger1=!(time%4)&&!movehit&&var(14)<3
attr=A,SA
damage=80+(10*var(10)),5
animtype=Hard
guardflag=MA
hitflag=MAF
priority=7,Hit
pausetime=12,12
sparkno=s7020+(random%8)
guard.sparkno=s7001
sparkxy=-10,-59
hitsound=s2,3
guardsound=s2,0
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity=ifelse(var(10)=3,-6,ifelse(var(10)=2,-5,-4)),ifelse(var(10)=3,-6,ifelse(var(1

0)=2,-5,-4))
ground.cornerpush.veloff=0
air.type=Low
air.velocity=ifelse(var(10)=3,-6,ifelse(var(10)=2,-5,-4)),ifelse(var(10)=3,-6,ifelse(var(10)=

2,-5,-4))
damage=(160+20*var(10))*!var(20)
forcestand=1
envshake.time=16
envshake.freq=60
envshake.ampl=4
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=36+(4*var(10))
fall=1
fall.recover=0
ID=1000
yaccel=.5

[State 1000, flames]
type=helper
triggerall=movehit&&numtarget&&numhelper(7180)<1
trigger1=!(target,time)&&(target,movetype=H)
helpertype=normal
stateno=7180
ID=7180
name="Flames"
postype=p2
ownpal=1
facing=-1
size.ground.front=0
size.ground.back=0
ignorehitpause=1
persistent=0

[State 1000, anim]
type=changeanim
triggerall=anim=1000&&time>=20
trigger1=frontedgedist<=(const(size.air.front)+20)
trigger2=var(10)=1&&time>=37
trigger3=var(10)=2&&time>=61
trigger4=var(10)=3&&time>=85
value=1001
[State 1000, vel]
type=velmul
trigger1=anim=1001
x=.85

[State 1000, end]
type=changeanim
trigger1=anim=1001&&!animtime
value=1002
[State 1000, vel]
type=velset
trigger1=anim=1002
x=0
y=0
[State 1000, pos]
type=posset
trigger1=anim=1002
y=0
[State 1000, statetype]
type=statetypeset
trigger1=anim=1002
statetype=S
physics=S
[State 1000, snd]
type=playsnd
trigger1=anim=1002
value=0,52
persistent=0
[State 1000, dust]
type=explod
trigger1=anim=1002
anim=7102
ID=7102
sprpriority=-2
postype=p1
scale=.5,.5
ownpal=1
persistent=0
[State 1000, end]
type=changestate
trigger1=anim=1002&&!animtime
value=0
ctrl=1



the big question is it has the same state def (1000) as an existing move that i want to keep. what do i need to change and where?

thanks


Title: Re: ? about adding a special move to a charecter
Post by: shin fuuma on September 20, 2007, 04:09:00 PM
Fallen_Angel, sorry i was typing when you posted  :)

do i need to change it in every spot in the cns and cmd? can you show me based on my last post?

EDIT: also do i add it at the end in the cns and cmd or do i need to put it in a certian spot?
Title: Re: ? about adding a special move to a charecter
Post by: Error Macro on September 20, 2007, 04:09:28 PM
IN the cns you can put it anywhere before Statedef - 3, and after The data stuff.

Lets say you added
[Statedef 1337]

In the CMD:

You would put something like this at the top of the CMD

[Command]
name = "WRYYYY"
command = ~D, DF, F, x+y

In statedef -1 (CMD)

You would put something like
[State -1, Hyper1]
type = ChangeState
value = 1337
triggerall = command = "WRYYYY"
trigger1 = Statetype != A && ctrl
trigger2 = (StateType != A) && (HitdefAttr = SC, NA) && (MoveContact)
trigger3 = (stateno = 200) && (MoveContact)
trigger4 = (stateno = 205) && (MoveContact)
trigger5 = (stateno = 210) && (MoveContact)
trigger6 = (stateno = 230) && (MoveContact)
trigger7 = (stateno = 235) && (MoveContact)
trigger8 = (stateno = 240) && (MoveContact)
Title: Re: ? about adding a special move to a charecter
Post by: shin fuuma on September 20, 2007, 04:16:52 PM
so.............

;========================<PSYCHO CRUSHER>=============================
[Statedef 1000]  i would need to change it here
type=S
physics=S
movetype=A
ctrl=0
anim=1000
velset=0,0
poweradd=60*!var(20)
juggle=ifelse((p2movetype=H&&p2statetype=A),15,5)

[State 1000, strengthvar] do i need to change it here as well?
type=varset
trigger1=!time&&var(59)<=0
var(10)=ifelse((command="bfz"||command="cbfz"),3,ifelse((command="bfy"||command="cbfy"),2,1))
[State 1000, strengthvarAI]
type=varset
trigger1=!time&&var(59)>=1
var(10)=ifelse(random<500,3,ifelse(random<666,2,1))

[State 1000, width] and here and so on?
type=width
trigger1=anim=1000&&animelemtime(4)>=0
value=20;55
ignorehitpause=1
[State 1000, push]
type=playerpush
trigger1=anim=1000&&animelemtime(6)>=0
value=0
ignorehitpause=1
Title: Re: ? about adding a special move to a charecter
Post by: Fallen_Angel on September 20, 2007, 10:09:45 PM
shin fuuma, you only need to change it in the statedef, the numbers in the [state #] are used only to identificate it you can put whaterever number its not going to make anything
Title: Re: ? about adding a special move to a charecter
Post by: shin fuuma on September 20, 2007, 11:39:25 PM
ok i only changed the animation # and the statedef # in the CMD and CNS from 1000 to 1010.
i get this error from mugen now:

Error message: Undefined command lable: "bfz"
if not misspelling in CNS, check CMD
Error parsing [state 1000, strengthxar]
Error in states/specials.st
Error loading chars/shingouki/shingouki.def
Error loading p1

library error message: Died parsing
ifelse((command="bfz"||command="cbfz"),3,ifelse((command="cbfy"),2,1))

Title: Re: ? about adding a special move to a charecter
Post by: Fallen_Angel on September 20, 2007, 11:47:02 PM
shin fumma that error its because you haven't made the bfz command to fix that you have to make it
Title: Re: ? about adding a special move to a charecter
Post by: shin fuuma on September 21, 2007, 07:52:44 AM
what do you mean i have to make bfz?? where do i do that? i thought that was what the code i was adding did??
Title: Re: ? about adding a special move to a charecter
Post by: Fallen_Angel on September 21, 2007, 09:06:33 AM
in the cmd of the char look for all these commands and copy them

"bfz"  ,    "cbfz",  "bfy"  , "cbfy"

Title: Re: ? about adding a special move to a charecter
Post by: shin fuuma on September 21, 2007, 09:19:21 AM
so in the cmd i need to copy the "psychocrusher" part and all the motions that have to do with that move........makes sence :) ill try this out when i get home :)
Title: Re: ? about adding a special move to a charecter
Post by: shin fuuma on September 22, 2007, 05:48:09 PM
cool that worked :) i have the move working now except for one small proble. when i do the move for the first time it leaves a copy of the stance behind (still animated) but it does not affect anything, its just there. if i do the move again it works fine and doesnt leave another copy. any idea what i may have done wrong??

thanks again to all for the help with this :)
Title: Re: ? about adding a special move to a charecter
Post by: Fallen_Angel on September 22, 2007, 10:28:22 PM
shin fumma the mistake is because maybe you havent put the statedef of the helpers

[State 1000, fx]
type=helper
trigger1=!numhelper(0)
trigger1=anim=1000&&animelemtime(6)>=0
helpertype=normal
stateno=1005
ID=1005
name="Psycho Crusher"
postype=p1
size.xscale=.5
size.yscale=.5
ownpal=1



[State 1000, flames]
type=helper
triggerall=movehit&&numtarget&&numhelper(7180)<1
trigger1=!(target,time)&&(target,movetype=H)
helpertype=normal
stateno=7180
ID=7180
name="Flames"
postype=p2
ownpal=1
facing=-1
size.ground.front=0
size.ground.back=0
ignorehitpause=1
persistent=0

make sure that you have thse statedefs 1005 and 7180, or try deleting the helpers, maybe you dont need them
Title: Re: ? about adding a special move to a charecter
Post by: shin fuuma on September 24, 2007, 09:52:39 AM
yeah i dont need them :) this was the first "sprite edit" i did about 2 months ago and i made the "fx" part of the normal animations  ;D (i know better now :)) this will get fixed when i get home tonight :)

thanks again for all your help!!
Title: Re: ? about adding a special move to a charecter
Post by: shin fuuma on September 25, 2007, 07:53:22 AM
well i tried removing both of the things you suggested but it still does the same thing (first time you use the special move it leaves a copy of the standing animation behind and after that it works fine) here is the code as im using it now.


;========================<PSYCHO CRUSHER>=============================
[Statedef 1010]
type=S
physics=S
movetype=A
ctrl=0
anim=1010          (1010 is the main animation)
velset=0,0
poweradd=60*!var(20)
juggle=ifelse((p2movetype=H&&p2statetype=A),15,5)

[State 1000, strengthvar]
type=varset
trigger1=!time&&var(59)<=0
var(10)=ifelse((command="bfz"||command="cbfz"),3,ifelse((command="bfy"|

|command="cbfy"),2,1))
[State 1000, strengthvarAI]
type=varset
trigger1=!time&&var(59)>=1
var(10)=ifelse(random<500,3,ifelse(random<666,2,1))

[State 1000, width]
type=width
trigger1=anim=1010&&animelemtime(4)>=0
value=20;55
ignorehitpause=1
[State 1000, push]
type=playerpush
trigger1=anim=1010&&animelemtime(6)>=0
value=0
ignorehitpause=1

[State 1000, nothitby]
type=nothitby
trigger1=anim=1010&&animelemtime(6)>=0
value=,NP
time=1
ignorehitpause=1

[State 1000, shield]
type=helper
trigger1=!numhelper(1007)
trigger1=anim=1010&&animelemtime(6)>=0
helpertype=normal
stateno=1007
ID=1007
name="Projectile Hitter"
postype=p1

[State 1000, vel]
type=velset
trigger1=anim=1010&&animelemtime(4)>=0
x=ifelse(var(10)=3,10,ifelse(var(10)=2,7.5,5))
y=0
[State 1000, statetype]
type=statetypeset
trigger1=anim=1010&&animelemtime(4)>=0
statetype=A
physics=N

[State 1000, fx]
type=helper
trigger1=!numhelper(0)
trigger1=anim=1000&&animelemtime(6)>=0
helpertype=normal
stateno=1005
ID=1005
name="Psycho Crusher"
postype=p1
size.xscale=.5
size.yscale=.5
ownpal=1

[State 1000, snd]
type=playsnd
trigger1=anim=1000&&animelem=4
value=0,40
[State 1000, dust]
type=explod
trigger1=anim=1000&&animelem=4
anim=7100
ID=7100
sprpriority=3
postype=p1
pos=0,ceil(pos y)
scale=.5,.5

[State 1000, snd]
type=playsnd
trigger1=anim=1000&&animelem=5
value=4,5
channel=0
[State 1000, snd]
type=playsnd
trigger1=anim=1000&&animelem=5
value=5,4

[State 1000, hitvar]
type=varset
trigger1=anim!=1010
trigger2=anim=1010&&animelemtime(6)<0
var(14)=0
[State 1000, hitvar]
type=varadd
trigger1=anim=1010&&(movehit=1||moveguarded=1||movereversed=1)
var(14)=ifelse(moveguarded,1,3)
[State 1000, hitvar]
type=varset
trigger1=numtarget(1010)
trigger1=(target(1010),stateno=[5000,5020])&&!(target(1010),time)
var(14)=3
ignorehitpause=1

[State 1000, hit]
type=hitdef
trigger1=anim=1010&&animelemtime(6)>=0
trigger1=!(time%4)&&!movehit&&var(14)<3
attr=A,SA
damage=80+(10*var(10)),5
animtype=Hard
guardflag=MA
hitflag=MAF
priority=7,Hit
pausetime=12,12
sparkno=s7020+(random%8)
guard.sparkno=s7001
sparkxy=-10,-59
hitsound=s2,3
guardsound=s2,0
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity=ifelse(var(10)=3,-6,ifelse(var(10)=2,-5,-4)),ifelse(var

(10)=3,-6,ifelse(var(10)=2,-5,-4))
ground.cornerpush.veloff=0
air.type=Low
air.velocity=ifelse(var(10)=3,-6,ifelse(var(10)=2,-5,-4)),ifelse(var(10

)=3,-6,ifelse(var(10)=2,-5,-4))
damage=(160+20*var(10))*!var(20)
forcestand=1
envshake.time=16
envshake.freq=60
envshake.ampl=4
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=36+(4*var(10))
fall=1
fall.recover=0
ID=1010
yaccel=.5

[State 1000, flames]
type=helper
triggerall=movehit&&numtarget&&numhelper(7180)<1
trigger1=!(target,time)&&(target,movetype=H)
helpertype=normal
stateno=7180
ID=7180
name="Flames"
postype=p2
ownpal=1
facing=-1
size.ground.front=0
size.ground.back=0
ignorehitpause=1
persistent=0

[State 1000, anim]
type=changeanim
triggerall=anim=1010&&time>=20
trigger1=frontedgedist<=(const(size.air.front)+20)
trigger2=var(10)=1&&time>=37
trigger3=var(10)=2&&time>=61
trigger4=var(10)=3&&time>=85
value=1011
[State 1000, vel]
type=velmul
trigger1=anim=1011
x=.85

[State 1000, end]
type=changeanim
trigger1=anim=1011&&!animtime
value=1012
[State 1000, vel]
type=velset
trigger1=anim=1012      (1012 is the ending animation for when he comes out of the crusher)
x=0
y=0
[State 1000, pos]
type=posset
trigger1=anim=1012
y=0
[State 1000, statetype]
type=statetypeset
trigger1=anim=1012
statetype=S
physics=S
[State 1000, snd]
type=playsnd
trigger1=anim=1012
value=0,52
persistent=0
[State 1000, dust]
type=explod
trigger1=anim=1012
anim=7102
ID=7102
sprpriority=-2
postype=p1
scale=.5,.5
ownpal=1
persistent=0
[State 1000, end]
type=changestate
trigger1=anim=1012&&!animtime
value=0
ctrl=1

i left in the 2 things you told me to take out because they didnt seem to affect anything and i wanted you to see the whole code :)  any other ideas what it could be???
Title: Re: ? about adding a special move to a charecter
Post by: Fallen_Angel on September 25, 2007, 09:36:09 AM
shin fuuma, maybe you need to make the statedef for the helpers

[State 1000, shield]
type=helper
trigger1=!numhelper(1007)
trigger1=anim=1010&&animelemtime(6)>=0
helpertype=normal
stateno=1007; you have to make the statedef 1007
ID=1007
name="Projectile Hitter"
postype=p1

maybe the  error is because you dont have the anim of the helper
Title: Re: ? about adding a special move to a charecter
Post by: shin fuuma on September 25, 2007, 10:00:18 AM
do you mean i need to add more code or the actual animations?
Title: Re: ? about adding a special move to a charecter
Post by: Fallen_Angel on September 25, 2007, 10:06:06 AM
do you mean i need to add more code or the actual animations?
I think that you need to add both

in the helper it says stateno = ###  ; thats the statedef that you need to make

Title: Re: ? about adding a special move to a charecter
Post by: shin fuuma on September 25, 2007, 10:18:32 AM
ohh, now i know what you mean :)
in the cmd there is a tab for "helpers" i put in the "phychocrusher" helper but didnt think to see if i needed anything else. i know i saw a "projectile hitter" and "projectile eater" and a few others i dont think i need but ill try this when i get home tonight. for the animation do i use "blank" sprites with clns boxes? reason i ask is a saw some in there and didnt know what they were for.

thanks again!
Title: Re: ? about adding a special move to a charecter
Post by: shin fuuma on September 26, 2007, 09:18:06 AM
i added the "projectile hitter" and a blank animation for it and it now works PERFECT!!!!

thanks for all the help Fallen_Angel!!! your the best  ^:)^ ^:)^ ^:)^
SimplePortal 2.3.5 © 2008-2012, SimplePortal