Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Sat 01/01/2011 17:33:33

Title: SOLVED: Determining npc in room function
Post by: barefoot on Sat 01/01/2011 17:33:33
Hi

I have a number of characters in one scene that you can click on... any character you click on will change room..  any npc you click on will go to the same room.

So far so good....

Now my problem is: I need a function to determine which npc is in the room.

Like when you talk to him you need the right npc to respond...

Sort of like


if character_cChris

Do this

if character_cFrankm

Do this



This type of thing..

I was thinking along the lines of after picking any npc have him transparent 100% and have an object of the npc in its place in the next room.. for all npc...  if possible..

cheers for any help/suggestions

barefoot



Title: Re: Determining npc in room function
Post by: Dualnames on Sat 01/01/2011 17:41:47
Quote
I need a function to determine which npc is in the room.

cEgo.Room;

Gets the room number the character is in. Returns an integer.


if (character.Room==) {
//Do this
}
Title: Re: Determining npc in room function
Post by: barefoot on Sat 01/01/2011 18:21:45
Cheers Dualnames...  

easy when you remember  :=

Unfortunately i had to reformat my computer and did not save my file of codes... devastated i can tell you!

barefoot