Forum rules - please read before posting.

Conversation options saving

edited June 2024 in Technical Q&A

imgur.com/W0tWxLD

Greetings. I tried to use AC conversations and a bit confused about how to their saving works. I figured out that when i changed dialog option states (On/Off/OnForever/OffForever), that reperesented by those two checkboxes and it works good. But if i try load gameSave or restart game, it looks like dialog options dont change.

For gameplay save/load i assume that i must save game right after every change any dialog option, that after load they was synchronized with gameplay. Is that correct way?
But i still cant understand how to reset those options to default state, if user start new game.
Any help pls.

Conversation Interaction source:Assetfile
Unity 2021.3.15, AC 1.76.1

Comments

  • For a Conversation's state to be saved, it needs:

    • To be present in the scene
    • To have a Remember Conversation component attached

    Upon restarting (via the Engine: End game Action), all scene save data will be reset.

    Are the above conditions both true?

  • Remember Conversation component is attached, but conversation prefabs indeed wasnt presented in scenes. If i placed them on their scenes happens something weird, if i change dialog option in the same scene it chahging only on scene prefab, not in asset prefab. If i change dialog option on assetConversationPrefab which actually is in other scene, it changes only on asset prefab but when i enter on that scene there isnt changes on scene prefab and dialog option dont show up.
    Also Engine -> End Game -> Restart Game still dont reset conversations to default.
    I have strong feeling that i do something wrong, but cant understand what is.

  • You need to make sure that the Conversation referenced in your ActionLists is the one in the scene - not the original prefab.

    You can still assign the prefab in your lists, but the Constant ID will need to be consistent as this is how it will "look" for the scene instance.

    Can you elaborate on the wider situation? Are you looking to have a Conversation be accessible from multiple scenes, hence the use of a prefab?

    The way to do this is to instead have your Conversation prefab spawn itself in when the game begins - one way to do this is to create an "ActionList on start game" at the top of the Settings Manager, and have this run an Object: Add or remove Action to spawn in your Conversation prefab.

    To have your Conversation prefab then survive scene changes, attach the Survive Scene Changes component to it. You'll also need to make sure no copies of the Conversation are still within your scene files: the one that gets spawned in at runtime should be the only one present.

    In the prefab's Remember Conversation component, be sure to check Retain in prefab? so that its Constant ID number is always the same when placed in the scene. That way, ActionLists that reference the prefab will know that the one in the scene represents the same object.

    I'm only speaking generally, however - if you can share details/screenshots on your exact setup, I can try to give more specific advice.

  • First of all sorry for lack of informaions. I indeed was looking for conversation objects accessible throw multiple scenes, and i thought that using prefabs with constant id would be enough.
    Finally i did exactly what you said and it works good. Оne moment was that my version doesnt contain SurviveSceneChanges component, i just got DontDestroyMe script from wiki, i think thats about the same.
    Thank you for help and detailed explanations.

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.