Forum rules - please read before posting.

Coroutine Error from Conversation inside of Asset Action List

I have a dialogue sequence that gets used multiple times throughout my project so it's stored as Asset Action List. As part of the sequence, the player has the choice of one of three options(always the same). I created a conversation to handle this input choice as it seemed the most natural component for it. The conversation is stored as a prefab inside the project with the action list referencing it via it's ConstantID. Whenever I choose an option however, it can't start the "RunOptionsCo(i)" (line 256 in Conversation for me) coroutine since it claims the conversation object is inactive. I imagine this is because it's referencing a prefab in the project instead of an instance in the scene.

Any decent workaround for getting this to work or something I'm doing wrong?

Comments

  • I figure worst case scenario I can create 3 global vars and a custom menu but was hoping to avoid that route if possible.
  • Going down the custom menu/vars certainly wouldn't be ideal.

    A new instance of the Conversation prefab will need to be present in each scene it can be triggered in.  To get the state of each syncing up properly, however, you'll need a custom script similar to the one discussed here for Containers.

    I'll look into this for you and will update this thread.
  • For the sake of being entirely clear about the situation, the player's choice doesn't have to persist across saves/scenes. They just encounter the same choice multiple times throughout the game.
  • In that case, merely having an instance of the prefab present in the scene will be enough.  You'll also need to have a Constant ID value that's shared between all.

    This is just a case of checking Retain in prefab? in the prefab's Remember Conversation component.  If you don't want any of its data saved, replace Remember Conversation with Constant ID.

    For those reading who do want choices saved, I've written an article on the wiki here.
  • Hey Chris, dropping in the conversation seemed to have done the trick! Thanks for the advice and for creating that script.
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.