Forum rules - please read before posting.

Conversation -> continue when no enabled option remaining

edited August 2014 in Technical Q&A
Hi again,
and thank you for your help so far.
This is a great asset.

So this is my situation.

I've a conversation with multiple choices and I'd like to let the player use them all before continuing. 
Is it possible in some way?

Ex.
Conversation:
- Option1 -> when used it will become disabled and player return to the conversation
- Option2 -> when used it will become disabled and player return to the conversation
- Option3 -> when used it will become disabled and player return to the conversation

So, when player uses all 3 options he will be stuck.

Instead I'd like something like this:

Option 2 -> Option1 -> Option 3 -> NO REMAINING OPTIONS -> so Dialogues continue

How could I do it?

Thank you again!

Comments

  • Local variables.

    Create a local variable (local, assuming you don't want to have it cluttering up your Variables Manager in every scene), and make it an integer.  Leave it's default value as 0, and use the Variable: Set Action at the end of every option to increase it by one.  Then follow it up by a Variable: Check Action to see if it's 3: if so, run the next sequence.

    You could even place these two actions in a separate Cutscene objet, and run it at the end of each DialogueOption, to save repeating yourself.
  • Thank you very much. I will use this!
  • Hi guys,
    I thought I'd revive this since I was trying something very similar and came across a problem.

    That is, I'm able to setup the conversation as Chris describes, but since we can't prevent the user from clicking on the same conversation option more than once, the integer can just keep going past the desired number if the same option is repeatedly chosen.

    Did I miss something @ChrisIceBox? Is there a way around this?
  • You could do it by using a separate boolean variable for each line, and set each to "true" (on) when each is chosen by the player.  A series of Variable: Check Actions would then be necessary to check that each of these variables are true, and act accordingly.

    Going one step further, you could even think about using a binary system to work with just one Integer variable instead:

    One digit for each option, so 4 options chosen would be: 1111 (1 = chosen, 0 = not chosen yet).

    So it starts off as 0000 (just 0), and the player chooses e.g. option 2.  It then becomes:

    0100

    Then choose option 4:

    0101

    And you just use one Variable: Check Action to check the value is 1111.  The trick would be to use the Variable: Set Actions to add to the variable's value.  e.g. if you choose option 2, add 100.
  • Hi Chris,
    It seems both these options have considerable downsides:

    A boolean variable for each conversation option is a significant amount of work for even just a handful of options (5 options would require 5 "set variable" and 5 "check variable" actions). Right now, it seems the conversation system knows which options I've exhausted (turns them grey in the conversation menu), is there a way to use this information?

    The binary system would be great to reduce manual work, but I still don't know how to get around the fact that if a single option is repeatedly selected by the player, the integer can just keep going past the desired "check" number.
  • Of course - you can do it all through script quite easily.  You're correct about the binary system flaw, but I was trying to offer a solution using AC's provided Actions.

    A custom Action could easily iterate through all options in a Conversation, and run one of two outputs according to whether or not they've all been used at least once.

    I'm feeling generous: here's such an Action.  Paste it in a C# script named ActionCheckConversationExhausted, and place it in a new folder.  Point to that folder in your Actions Manager, and you'll then have access to it in your ActionLists.  It will return True if all enabled options in the selected Conversation have been chosen.
  • We like it when you are generous >:D<
  • edited July 2016
    Indeed, your generosity is greatly appreciated!

    I'm self-learning (or is it self-teaching) Unity+scripting so having AC, and your support, has been invaluable.

    Thanks again.
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.