Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Fri 09/07/2010 14:39:46

Title: SOLVED: NPC Slow to materialise in Room
Post by: barefoot on Fri 09/07/2010 14:39:46
Hi

I think i've had something this before... The below code works fine.. but unfortuanately NPC Professor Plum does not materialise untill a milli-second after he starts talking... Obviously I would like him there before anything is spoken...  Pervious room Follow attibutes set to 10,0 even though I added Follow Char in afterfadein ..   Object 1 is water rising slowly..  

Is this a nature of the beast?


function room_AfterFadeIn()
{
 cprof_plum.FollowCharacter(cindy_bones, 10, 92);
Display("The water gradually flows out filling the pit");
cindy_bones.Say("I think the waters speeding out a bit!");
cprof_plum.Say("Yes, its really starting to pour out!");
object[1].Move(227, 341, -15, eBlock, eAnywhere);
SetNextScreenTransition(eTransitionInstant);
cindy_bones.ChangeRoom(47);
}


Any help/comments appreciated..

-barefoot-

Title: Re: NPC Slow to materialise in Room
Post by: Crimson Wizard on Fri 09/07/2010 17:04:31
Can it be that prof plum is not initially invisible?
Title: Re: NPC Slow to materialise in Room
Post by: Sslaxx on Fri 09/07/2010 17:07:19
Perhaps using a Wait (some small amount of time here) statement before the professor starts talking?
Title: Re: NPC Slow to materialise in Room
Post by: barefoot on Fri 09/07/2010 18:04:20
Hi

The NPC has been following Indy from previous rooms. And no, the Wait does not make any difference.

-barefoot-
Title: Re: NPC Slow to materialise in Room
Post by: tzachs on Fri 09/07/2010 18:11:04
When you use follow it does take the follower a few seconds to enter a new room.

Maybe you should call ChangeRoom for plum yourself when indy leaves the room that leads to that room... and if that doesn't work, you can stop the follow command, make plum change room and do a walk, say his lines and then return the follow.
Title: Re: NPC Slow to materialise in Room
Post by: barefoot on Fri 09/07/2010 18:15:55
Hi

I actually added NPC to change from previous room with Indy:


SetNextScreenTransition(eTransitionInstant);
  cprof_plum.ChangeRoom(46);
cindy_bones.ChangeRoom(46);


and this seems to work better..Just spotted your post Tzachs

many thanks

-barefoot-