changanim

Started by cake-kun, June 10, 2019, 08:28:29 PM

Previous topic - Next topic

cake-kun

so im trying to work with  "transformations " the way i used to go about this  was with something like this ; Crouch to Stand
[Statedef 12]
type    = S
physics = S
anim = 12

[State 11, 1] ;Change from turning animation
type = ChangeAnim
trigger1 = var(0) = 1
triggerall = anim != 10012
value = 10012

[State 12, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
i would add  changeanim trigger in every state witha  variable for said transformation  and its kinda annoying.




recently ive noticed ppl use a different method i am looking for an explanation as  it seems the  they do not add the changanim code but instead do this
[Statedef 10]
type    = C
physics = C
anim = 10+var(11)

[State 0, PosSet]
type = velset
trigger1 = 1
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y = 0

[State 10, 1]
type = VelMul
trigger1 = Time = 0
x = .75

[State 10, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
they add a variable to the state  and if normal stand is 0 then the transformation would be like 13000  but nowhere in the code does it state this only in the animation file how does mugen know what the new stand is when theres just a varaible attached to the state. how do you figure out which numbers to add for the animation file to the new stance.

im asking cause it seems like everyone is using it and id like to learn

Bannana

You're using the variable as a switch, so it's either one or zero.

They're using the variable to store a number that could change based on different situations and they check it every time they enter that state. If the number is zero then the animation will be 10, but if the stored number is five then the corresponding animation will be 15.

altoiddealer

This belongs in MUGEN Development Help


By default, all Vars are 0.

So, for your example, somewhere in the character's code would be a controller such as:

type = VarSet
trigger1 = *Something*
var(11) = 13000

And once that has been triggered, it would then become a factor for things such as how it is used in your example.

Note that sometimes it is ideal to trigger/assign a Var at the very beginning of each round.  The round initialization state is State 5900.