Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: The Man on April 11, 2013, 12:13:56 PM

Title: Actor back to default animation
Post by: The Man on April 11, 2013, 12:13:56 PM
I know it will sound stupid to most of you, but I've got this problem...

I need my actor to change his idle animation after a certain action and to obtain this I used the code:

Code: [Select]
actor.SetSprite("actors/Lars/ul/defaultposter.sprite");

The problem is I don't know how to go back to normality! If I use this code the actor will ALWAYS use "defaultposter.sprite".
Probably there must be a simple function to obtain what I need, but I can't find it!
Can somebody give me a help?
Title: Re: Actor back to default animation
Post by: eborr on April 11, 2013, 12:27:05 PM
How a something like

Code: [Select]
if (condition_met == false)
  {
   actor.SetSprite("actors/Lars/ul/defaultposter.sprite");
  }
else
 {

actor.SetSprite("actors/Lars/ul/other.sprite");

}

where condition_met is a global
Title: Re: Actor back to default animation
Post by: The Man on April 11, 2013, 01:11:47 PM
But if I use again SetSprite the problem persist because the actor will use THAT sprite("other") for every standing animation...
Title: Re: Actor back to default animation
Post by: Mnemonic on April 11, 2013, 01:52:17 PM
To reset the value, just use actor.SetSprite(null);
Title: Re: Actor back to default animation
Post by: The Man on April 11, 2013, 02:14:38 PM
I knew it had to be THAt easy.
Thank you very much and I apology for opening such a simple thread!