Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Xadhoom on Fri 25/04/2003 02:13:46

Title: Making NPCs animate in background?
Post by: Xadhoom on Fri 25/04/2003 02:13:46
Hey there!
I was wondering, could anybody tell me how I make an NPC perform a continuous series of animation loops, while still making it possible for the player character to move about? I've gotten as far as making the NPC do what he's supposed to, but the whole game goes in wait mode while he moves.
Thanks. :)

EDIT: Nevermind I found it out myself after some more tweaking. Sorry, mr. Moderator guy... ;)
Title: Re:Making NPCs animate in background?
Post by: Nacho on Sun 27/04/2003 13:40:59
I am going to say something that might help you, unless this is not the answer you´re looking for (i am not a programmer...).

Here comes my tip: The animated backgrounds are very helpfull, and they can work for an animated character to make a loop (but you won´t be able to interactuate with him). For example, i am doing a background of a bar with a fdrunk guy... I animate the five screens to pretend he is breathing and bubbles are rising from his head and explode... It is nice and you can use this tecnique to many thinks (moving shadows on the walls, candles...)
Title: Re:Making NPCs animate in background?
Post by: Xadhoom on Sun 27/04/2003 16:19:08
True, but isn't it kinda overkill for just one character? But the technique would be excellent for a bar with lots of people and candles and stuff.
Title: Re:Making NPCs animate in background?
Post by: Dave Gilbert on Tue 29/04/2003 20:14:48
How are you making your NPCs move?  The best way is to set an idle animation for them.  I forget the code offhand, but looking up "idle" in the help file should tell you all about it.
Title: Re:Making NPCs animate in background?
Post by: miguel on Tue 29/04/2003 23:45:31
I´ve got a robot in one room that walks around cleaning the place, what I did was this:

int timer=0;
   

function movebot() {
  timer++;
 if (timer>=1500)  timer=0;
 if (timer==10)    MoveCharacter(BOT,65,85);
 if (timer==400)    MoveCharacter(BOT,125,110);
 if (timer==600)     MoveCharacter(BOT,82,187);
 if (timer==800)      MoveCharacter(BOT,285,185);
 if (timer==1000)      MoveCharacter(BOT,240,85);
}

function room_a() {
 // script for room: Repeatedly execute
movebot();
 
}

hope it helps
Title: Re:Making NPCs animate in background?
Post by: Andail on Thu 01/05/2003 15:34:38
There is the MoveCharacterPath function for that, Miguel.

No need to change your scrip if it works fine, though.
Title: Re:Making NPCs animate in background?
Post by: miguel on Fri 02/05/2003 00:53:47
it does work fine because the TIMER  does all the object moving when I want it  to move; but it´s my room with it's own particular movements; thanks anyway
Title: Re:Making NPCs animate in background?
Post by: Enlaithion on Sun 04/05/2003 18:58:05
miguel,

Does your robot animate when he is moved to to each coordinate?


Enlaith
Title: Re:Making NPCs animate in background?
Post by: miguel on Sun 04/05/2003 23:56:17
Quote from: Enlaithion on Sun 04/05/2003 18:58:05
miguel,

Does your robot animate when he is moved to to each coordinate?


Enlaith

yep, the robot trows water on the floor when moving
because it´s a character, it uses the view frames when moving left,right,up....
Title: Re:Making NPCs animate in background?
Post by: Enlaithion on Mon 05/05/2003 21:39:38
Thanks.  I was curious.   :)