Forum rules - please read before posting.

Toggle conversation options based on conditions

The last adventure game we developed using the Wintermute Engine. For setting up my conversation options (called responses in Wintermute) I scripted something like this:

if(Auftrag_GarnHolen && !Fertig_GarnHolen && !Game.IsItemTaken("Garn")) Game.AddResponse(0, "/emma0021/Ich brauche etwas Garn.");
if(Auftrag_BootBauen && !Fertig_BootBauen && !Fertig_ReisszweckenHolen) Game.AddResponse(1, "/emma0022/Ich brauche Reißzwecken.");
if(!Game.IsItemTaken("Chili") && !Chili_InSuppe) Game.AddResponse(2, "/emma0023/Ich hätte gern etwas von dem Chili-Gewürz.");
if(!Game.IsItemTaken("Marmelade") && !Sprengstoff_Marmelade) Game.AddResponse(3, "/emma0024/Ich hätte gern ein Glas Marmelade.");
if(Komakelle_Gelesen && !Game.IsItemTaken("Vogelbet")) Game.AddResponse(4, "/emma0025/Ich brauche etwas von dem Vogelbetäubungsmittel.");
Game.AddResponse(5, "/emma0026/Ich glaube ich brauche eigentlich gar nichts.");

I rebuilt the same options setup using AC now and I came up with this:
image

I think that there is often a demand to set up dialogue options based on certain conditions that have to be met to be displayed. I'm thinking about an action, maybe called "Dialogue: Toggle option conditioned", that would let you choose a conversation and an option like the "Dialogue: Toggle option" action does, but additionaly let you define a number of conditions (variables) that all have to be in a defined state to toggle this option to on. If one condition is not met, the option would be toggled off by default.

I don't know if others would find this usefull too or if I just did a wrong approach on this. I would try to code a custom action for this, but that would take me some time to get myself into Unity and AC scripts.

Comments

  • edited February 2016
    Well, much as I love AC, it does tend to become a bit messy when dealing with large amounts of dialogue and the accompanying logic.

    I believe some sort of external tool is the best approach for bigger projects - this blog entry more or less describes the workflow I'm using at the moment: http://www.storybeasts.com/getting-the-words-into-the-game-ii/

    I've also considered writing my own tool to handle XML-based dialogue data, but have decided, at least for now, to stick with my current setup. As always, it's a trade-off between the time it would take to write a custom tool and how much time it would actually save in the long run.

  • And yes, this is a fine example of the "Sargasso Sea" you quickly end up with in node-based visual logic - even if you keep the layout as tidy as in your picture!
  • Would parameters not be capable of this?  You should be able to create an ActionList that connects several Variable: Check Actions followed by a Dialogue: Toggle option Action if all return True.  You could then parameterise the variables, conversation and option, allowing you to conditionally enable any option you like with different variables each time you run it.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.