To encourage a NPC. Without pauses and that it doesn't interrupt the character

Started by , Wed 11/02/2004 00:13:34

Previous topic - Next topic

vegetamaker_1

That is my question. I tried to use the animatecharacter in the repedly execute but she/he doesn't cheer up neither for I appear. She/he only begins to cheer up when the player is spoken or loading a loop that is not the one of walking. How can I fix this? Or is there another command to make this?  
 
Thanks.

It postdates: forgive me for my horrible English

Wolfgang Abenteuer

I'm guessing that you mean that the character does not animate until you speak with someone.  Here's the reason for that:

If you put something in the repeatedly_execute part of a script, it will get run every game cycle (normally 40 times per second).  In this case, you used AnimateCharacter, so the character will begin at a certain frame of animation and then continue on.  Problem is, that is resetting each time the game cycles (again, normally 40 times per second), so the character is starting back at the first frame of their animation each time.  The reason that the animation continues as normal when you speak with someone is likely because it's a blocking command (meaning it pauses the game, and stops the repeatedly_execute from cycling), so the character is able to continue his animation as normal, until you're done speaking and the repeatedly_execute resumes.  Am I right so far?

How to fix it:

What you'll need to do is put the AnimateCharacter line somewhere other than the repeatedly_execute section.  If you want it to happen as soon as you enter the screen, put it in the "player enters screen after fadein" part.  If you want it to happen at another time, like after you've picked up an object for example, then put the line at the end of the object interaction, and so on.  If you want the animation to happen only one time, and then stop, set the last value of AnimateCharacter to 0.  If you want it to keep animating over and over, set it to 1 instead.

...I probably confused you even more, didn't I? :P

~Wolfgang

LordHart

I'm not sure I fully understand, but I'll take a guess by what I interpreted it as...

Now, I'm guessing you have a NPC in the room, and when your character walks in, they cheer up, because they are seeing you... and you are their friend?

I dont have anything with me for reference, but I believe you could have this attached to a region, so that when your character walks onto it, the NPC animates to have a happy face...

So,

if character(EGO) {
 AnimateCharacterEx(SAD, 1, 0, 0, 1, 1);
}


SAD is the characters ID name, the first 1 is the loop that the animation will play based upon the specific view (i'll get to that).

So, draw a region, and then go to the region INTERACTIONS button. Click on it and right-click on Player Walks Onto Region, a little menu will come up where you it has a NEW ACTION... select that and then where it says Do Following Command, choose the RUN SCRIPT from the drop down box. Add the code above to it.

Now you need to add a command to the FIRST TIME PLAYER ENTERS SCREEN section. Right click on it and choose NEW ACTION again. Now, RUN SCRIPT and then finally add:

SetCharacterView(SAD, 4);

SAD of course being the character again, and the 4 part you have to change to whatever the view is for that characters specific view. So when put together, your character (EGO) steps onto the region near the doorway or whatever, and then SAD will start to cheer up, playing loop 1 of the view 4 (or whatever the 1 and 4 are for you).

I hope I explained it good enough, i dont usually write these... is that what you wanted?

vegetamaker_1

Thanks to both. They will be I very useful your advice and sugenrencias. But accidentally I found the solution (after 3 days: ().  
 
That made it was to use the command SetCharacterIdle in the BeforeFadein...And it worked this way perfect.  
 
Thank you.  
 
PD: My English is horrible XP

SMF spam blocked by CleanTalk