randomize animations

Started by SiTHFURioN, July 02, 2012, 10:16:11 PM

Previous topic - Next topic

SiTHFURioN

Ok, lets say a stance. if I got 2 different stances.
no:1, stance 1
no:2, stance 2

How can I set it so every time it goes into state 0, it picks a different animation from 1 or 2?

Cyanide

There is a changeanim in state 0 already, You'll need to alter it. I forget the contents of it exactly but randomising the animation is simple enough, assuming you have action 0 and action 1

value = 0+random%2

Alternatively
value = ifelse(random < 500, 0,1)


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

2OS

[State ]
type=changeanim
trigger1=anim!=0&&anim!=1&&anim!=5
trigger2=anim=5&&animtime=0
value=0+(random<500)*1
ignorehitpause=1


it's gonna randomize every time you turn around too.

SiTHFURioN


Cyanide

Just in case the line he's used is not obvious.

0+(random < 500)*1

Evaluates random, If it's less that 500 it will return 1 so you get

0+(1)*1
giving you 0+1

If it's > 500 you get 0+(0)*1 or 0+0


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.