Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Dr Fred Rubacant Edison on Mon 04/12/2006 03:50:14

Title: Now i need help with Text parser when two chars in the same room
Post by: Dr Fred Rubacant Edison on Mon 04/12/2006 03:50:14
Its just a test I'm doing. But I'm trying to make it so you can Talk to NPC by typeing useing the Text parser It works real good But
only if one NPC is in the room at a time if not they both talk   GRRR

I been working on this for a few hours

When 2 NPC are in the same room   both say someing and i only Want  one of them to talk to me The NPC thats in Dialog Mode:

here some code


   #sectionstart dialog_request  // DO NOT EDIT OR REMOVE THIS LINE


function dialog_request (int param){ 



if(cSyd.room)  // If your in the room  And what Char you are
{
  if (Parser.Said("whats going on")) { // you Type
 
  cSyd.Say("Whats going on");  // What you say
 
 
  if(cBernhard)  // NPC just a test // i want this NPC only to talk if I'm in Dailog with him
  {
   cBernhard.Say("Nothing Much");  // what they say   
  }
 
  if(cDrfreddytest) // NPC the same // i want this NPC only to talk if I'm in Dailog with him
  {
     cDrfreddytest.Say("Takeing over the WORLD");  // and so on
     }
}

  }   





I need to state that the one I'm talking to will only talk back

Im useing 

// script for Character 106 (Dr Freddy Test): Talk to character



if(player.Room == cDrfreddytest.Room)  // All Chars
{
dDrFreddy.Start();

player.FaceCharacter(cDrfreddytest);

cDrfreddytest.FaceCharacter(player);

}






// script for Character 4 (Bernard): Talk to character



if(player.Room == cBernhard.Room)  // All Chars
{
dTalktest1.Start();

player.FaceCharacter(cBernhard);

cBernhard.FaceCharacter(player);





//Cant get the [ code ] tags when posting code to work when posting


Title: Re: Now i need help with Text parser when two chars in the same room
Post by: Khris on Mon 04/12/2006 09:00:47
Use [*code]code[*/code] without the *s.

I've answered this in the german AGS board. (http://www.adventure-treff.de/forum/viewtopic.php0882)