Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: MCF on Fri 19/12/2003 21:44:02

Title: Character interactions. Must be set globally?
Post by: MCF on Fri 19/12/2003 21:44:02
When your playable character interacts with another character, do you have to have the global interaction responses -- those set in the character menu.  What if I want different interactions for different times in the game... when another character appears in a different room, say?

What is the code to dictate room-specific character responses?

Title: Re:Character interactions. Must be set globally?
Post by: Javier on Sat 20/12/2003 00:51:44
WOW!!! This is the first time I help and I'm not asking for help...:P

  Well... you have to set the character's interactions in the "Characters" option, which is in the left hand pane.
  All the things you add or change in the items of the Interaction Editor are "global",as you said...it doen't matter which room the character is in...
  I hope I could help.
Title: Re:Character interactions. Must be set globally?
Post by: MCF on Sat 20/12/2003 01:26:08
That's the problem.  I want to override to global.  I was wondering if anyone knew of the code to do this.
Title: Re:Character interactions. Must be set globally?
Post by: Javier on Sat 20/12/2003 01:30:46
Hummm...ok, I think you don't need to use any code, but let's wait some code expert comes and helps you...bye!
Title: Re:Character interactions. Must be set globally?
Post by: Scorpiorus on Sat 20/12/2003 01:46:30
Well, you could check for the current room:

character talk interaction:

int PC = GetPlayerCharacter(); // get player character

if (character[PC].room == 1) { //if we in the 1st room

Display("You are in the room number 1);

}


if (character[PC].room == 2) { //if we in the 2nd room

Display("You are in the room number 2);

}

// if we in the same room where MAN is
if (character[PC].room == character[MAN].room) {

DisplaySpeech(MAN, "Im here!");

}