Dialogue options

Started by Pointanneclick, Sat 15/12/2018 22:23:06

Previous topic - Next topic

Pointanneclick

Hey I'm new here and a total beginner so please excuse me if I'm asking something very basic. I'm looking to make it so that when the player chooses to say a specific thing from a list of dialogue options in a conversation with one person, it makes another dialogue option available for him to say when he reaches a certain point in a conversation with another person in a different room.

For example: -

The player is talking to a character called Dave in Room 1. There are 3 things that the player can say: 1) "How are you?"), 2) "What day is it?", 3) "Where are you from?". If the player asks "Where are you from?", Dave replies "Sweden".

Later on, the player meets a character called Steve in Room 2. There are the same 3 dialogue options for initiating the conversation: 1) "How are you?"), 2) "What day is it?", 3) "Where are you from?". If the player asks Steve where he is from, Steve replies "Sweden". I then want to make it so that if Dave hasn't previously asked Dave where he's from, the player has 2 dialogue options for follow-up questions ("What's it like there?" and "What's the weather like in Sweden?"), whereas if he's previously asked Dave where he's from, the player has an additional dialogue option of "Did you ever meet Dave in Sweden?" (so the 3 options would be "What's it like there?", "What's the weather like in Sweden?" and "Did you ever meet Dave in Sweden?").

This is just a hypothetical example - my game doesn't actually have anything to do with Sweden!!!

I've tried to figure out how to do this but haven't had any success at all!! Can anybody offer any advice? I'd really appreciate it.

VampireWombat

Okay, the easiest way to do it is to have the dialog for the 2nd person without any checks on it show it doesn't show the dialog by default.
And in the dialog for Dave, have code similar to this:

Code: ags

Dave: Sweden
  dialog[2].SetOptionState(3, eOptionOn);


That specific code sets the 3rd option of Dialog2 (doesn't matter the name, just is the number) to on. Hopefully this makes sense.

Crimson Wizard

Quote from: VampireWombat on Sat 15/12/2018 22:52:56
Code: ags

Dave: Sweden
  dialog[2].SetOptionState(3, eOptionOn);


That specific code sets the 3rd option of Dialog2 (doesn't matter the name, just is the number) to on.

You may also use actual dialog name, the one you see in the project tree.
Code: ags

dAnotherDialog.SetOptionState(3, eOptionOn);

This is much safer, because dialog number may change if you remove/insert dialogs in the list.

Pointanneclick

Okay I'm trying this and can't get it to work for some reason. How do I make it so that the 2nd person without any checks on it show it doesn't show the dialog by default, just to make doubly sure I'm doing the right thing?

VampireWombat

#4
Actually, I was wrong in what I said. Only the "show" check box needs to not be checked. The Say checkbox needs to be left checked. Sorry about that.
Having the show checkbox unchecked means it won't show the option by default. Hopefully I worded that where it makes sense.

Here's an example screenshot to make sure.

SMF spam blocked by CleanTalk