Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: ugo on April 02, 2012, 05:54:18 AM
-
actor.IdleAnimName
I can not understand how it works. Can I get an example?
-
2D actors:
In actor definition you set a couple of spritesets (idle, talk, walk, turnright etc...)
ANIMATION
{
NAME = "idle"
LEFT = "actors\molly\ll\stand.sprite"
RIGHT = "actors\molly\rr\stand.sprite"
UP = "actors\molly\uu\stand.sprite"
DOWN = "actors\molly\dd\stand.sprite"
UP_LEFT = "actors\molly\ul\stand.sprite"
UP_RIGHT = "actors\molly\ur\stand.sprite"
DOWN_LEFT = "actors\molly\dl\stand.sprite"
DOWN_RIGHT = "actors\molly\dr\stand.sprite"
}
By default the "idle" is used for idle animation. The variable in question allows you to override it by a different animation. This can be usefull for example if you want to randomly play different idle animations. So if you have eg. animation set called idle2, you can use:
actor.IdleAnimName = "idle2";
For 3D actors, the animations (and their names) should be defined in the .x file itself. In actor definition you will reference the animation set like this:
ANIMATION
{
NAME="idle"
LOOPING=TRUE
}
The usage then is the same.
Hope this helped.
-
My file "*. actor", looks like this. This is not correct? So, I need to change it?
ACTOR
{
NAME = "actor"
CAPTION="My brand new actor"
X = 100
Y = 100
SCALABLE = TRUE
INTERACTIVE = FALSE
COLORABLE=TRUE
ROTATABLE = FALSE
SOUND_PANNING=TRUE
SCRIPT="actors\bivalov\bivalov.script"
FONT = "fonts\Teslic1.font"
WALK
{
SPRITESET
{
LEFT = "actors\bivalov\ll\walk.sprite"
RIGHT = "actors\bivalov\rr\walk.sprite"
UP = "actors\bivalov\uu\walk.sprite"
DOWN = "actors\bivalov\dd\walk.sprite"
UP_LEFT = "actors\bivalov\ul\walk.sprite"
UP_RIGHT = "actors\bivalov\ur\walk.sprite"
DOWN_LEFT = "actors\bivalov\dl\walk.sprite"
DOWN_RIGHT = "actors\bivalov\dr\walk.sprite"
}
}
STAND
{
SPRITESET
{
LEFT = "actors\bivalov\ll\stand.sprite"
RIGHT = "actors\bivalov\rr\stand.sprite"
UP = "actors\bivalov\uu\stand.sprite"
DOWN = "actors\bivalov\dd\stand.sprite"
UP_LEFT = "actors\bivalov\ul\stand.sprite"
UP_RIGHT = "actors\bivalov\ur\stand.sprite"
DOWN_LEFT = "actors\bivalov\dl\stand.sprite"
DOWN_RIGHT = "actors\bivalov\dr\stand.sprite"
}
}
...
And then, something like that.
-
I modified the code for an actor and it worked. Everything is working. Thank you very much.