Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: lazy-slob on Sat 15/12/2018 21:02:04

Title: Making charactor walk into room when certain dialog used
Post by: lazy-slob on Sat 15/12/2018 21:02:04
Hi All,

My game starts off with the player and another character in the room. I want it so when using dialog if a certain question is chosen then this makes a 3rd charactor walk into the room, ask me a question and the other character to leave.

Any ideas how to achive this?
Title: Re: Making charactor walk into room when certain dialog used
Post by: eri0o on Sat 15/12/2018 21:34:08
On the 3rd character, place it outside of the room from where it's supposed to be, then use cThirdCharacter.walk (https://adventuregamestudio.github.io/ags-manual/Character.html#walk) to make the third character walk to the place you want.

You can do script functions inside a dialog text if you preceed it by a space or more.

Code (ags) Select

@S  // Dialog startup entry point
CharacterOne: Hi Two!
CharacterTwo: Hello One!
  cCharacterThree.Walk(16,32,eBlock);
CharacterThree: Hello One and Two!
CharacterTwo: Humpf.
  cCharacterTwo.Walk(-2,-2,eBlock);
stop
Title: Re: Making charactor walk into room when certain dialog used
Post by: lazy-slob on Sat 15/12/2018 22:09:23
Working thank you very much!