Hi there!
Just a short question, I can't sort it out:
I want to have a character, that is always animated with view 2, when he's not moving. I thought about using the idle view and putted a :
if (!character[EGO].walking)
Ã, Ã, {Ã, Ã, Ã,Â
Ã, Ã, Ã, SetCharacterIdle(EGO,2,1);
Ã, Ã, }
into repeatedly_execute, but somehow it won't work. The view isn't displayed.
Does someone have a suggestion?
Bye,
As far as I remember, the AGS text script system doesn't support this C-style expression like "if (!variable)" (anymore, unless the system had been improved), so it should be "if (character[EGO].walking==0)".
However, as idle view is JUST what is used for animating the character when he's not walking. So you don't really need to reset it whenever he's stationary.
All you need is to set the idle view for him in the editor. By default the idle animation would be played every 20 seconds (as mentioned in manual), if you don't like this (or actually as you said you want him always animating while he's stationary), you can just put the following line in "first time player enters screen" into the first room of the game:
SetCharacterIdle(EGO,2,0);
(note that if you want him ALWAYS animating the delay should be 0, not 1, consult the manual for more detail).
So you only need to do it once (unless you want to change it again in later part of the game of course).
Thanks to you, Gilbot. It works. (Man. That happens if you don't script AGS for a loong time!)
Bye,
By the way the official method is SetCharacterIdle (idleview, delay) with a delay of zero.
Yeah, read my post.