always animate

Started by fiaschetta, Sun 22/10/2006 02:40:48

Previous topic - Next topic

fiaschetta

I have a character in the room that he always be in movement, therefore in the script of the room: 
cPg.animate (0,2,erepeat); 
 
But, when i talk with he, when the dialog end, the character is static...  doesn't animate.. 
Why?

Theeph

I think the talking animation that is displayed (or at least called by the script) will cancel out the cPg.animate command.

Just go to the interactions for that character, and in the "Talk to" bit, after whatever conversation you have, just add in a "Run Script" that consists of:

cPg.animate (0,2,erepeat); 

Ashen

#2
Since you didn't say you get an error message I guess it's just the way you've typed it here, but as a general note: Remember that AGS is case-sensitive - it needs to be Animate and eRepeat.

Theeph has the right idea - any automatically called animations (talking, walking, etc) will cancel any others that are running. Theeph's suggestion will work (restart the animation after you talk to the character) but it might be easier to use something like this, in the 'Repeatedly_execute' interaction for the room:

Code: ags

if (cPg.Animating == false && cPg.Moving == false) cPg.Animate(0, 2, eRepeat, eNoBlock);


This automatically checks if the character is animating, and starts it if needed. That way you don't have to track down every interaction that might stop him, and add it in manually.

EDIT: Added eNoBlock parameter, as default setting for Character.Animate is blocking which'll lock the game up. Also cPg.Moving == false check, since without it the character apparently can't be moved anywhere. Not a problem if you only want them stationary.
I know what you're thinking ... Don't think that.

Theeph

...oh yeah. That makes way more sense.

Cheers Ashen.  :D

Ashen

#4
Thanks. Thinking about it, though, it would probably make MORE sense to just use the Idle view and set a delay of 0 - which acts like the code above without the need to type it yourself.
I know what you're thinking ... Don't think that.

Robbiedoo

#5
I have been trying to find an answer I understand for this for about an hour and a half... but I've just started playing with this today (I'm addicted!!!) and I've searched the forums and the Tutorial. Maybe I'm just stupid! ;D I have just created a new NPC. It's a very simple character that have 1 view with 1 loop(down) of 4 frames(Dance steps). He's just supposed to stand in the back of a club and dance.

I've created a character with a normal view of 4 so I have the character showing up in the room I want, now I want him to perform his 4 dance steps while now walkng anywhere. Under Characters I have him under view 4 and I have 4 frames under loop 0 (down) under Views. I've searched everywhere for this and I'm so new that I'm not sure of scripts but I found this one(below). Will it do what I'm asking and if so where do I enter it?

Character.Animate(9 loop, 9 delay, optional RepeatStyle,
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  optional BlockingStyle, optional Direction)

Every thread I've searched for has had people telling others to look around for it and read the tutorial, I have done both of thos and I can't find anything I can wrap my mind around!

If there is a simple set of steps or if I missed something I appreciate it if someone can point me in the right direction!!!!

Theeph

The reason why he's not dancing is because it's the "down" loop - ie. he has to be moving down to animate.

So you're on the right track with the character.animate.

What you do is for that particular room, click up the top where the little red "i" is for interactions. Then under Player Enters Room (before fade-in), double click that and add a "Run Script" interaction.

You need to get the character's script name. It's c plus whatever the character name is. you find this in the character menu under "Script Name". So if you've set a script name of Bob, you would type cBob.

Then all you do is type the following in to the window that opens up:

cBob.Animate(0,3, eRepeat);

And that's it. The 0 above is for "Loop 0" - the down loop. The 3 is for the animation delay (basically the speed of the animation. 3 is the default I think). And repeat is self explainatory.

Good luck!

Ashen

Merged two topics, as they deal with very similar things (even if fiaschetta's question is a little more complex).
Robbie, you might find the Idle View of some use (see my earlier post for a link).
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk