Forum rules - please read before posting.

Tiny fix for AC/Dialogue System integration

I think this is a Dialogue System issue, but I have no experience with AC dialogue options because I replaced it with DS pretty early on, so I could be wrong. The cursor issue happens if you tell Dialogue System to use AC's Dialogue State during conversations.

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using AC;


    // Dialogue System changes the AC Cutscene cursor icon during conversations so that the normal cursor is displayed, and then changes it back once it is done.
    // The issue is that this changes the AC Manager setting, meaning it is NOT only a runtime change. If you quit the game before the conversation is over, it becomes a permanent change.
    // This script is intended to set the correct cursor when the scene starts.

    public class RevertCutsceneIcon : MonoBehaviour
    {
        public Texture defaultTexture;

        void Start()
        {
            AC.KickStarter.cursorManager.waitIcon.ReplaceTexture(defaultTexture);
        }


    }

Comments

  • @Rairun "I replaced it with DS pretty early on"

    I actually own DS for ages, but never really tried it. I know it's an elaborate asset, but in what ways is it "better" than AC's robust dialogue engine?

  • It has a lot more features than the ones I've used, so I can't give you a complete answer, but the reasons I use it are:

    (1) I really like the conversation editor and how it handles dialogue options. With AC, as far as I can remember, you have to create a separate conversation object every time the player is presented with dialogue options, and then you can call it in a longer cutscene that contains the rest of the dialogue. With DS, if you connect a dialogue entry to more than one node, DS automatically presents the player with those options:

    (2) It's VERY easy to create conditional dialogue options. Each dialogue entry has a "conditions" field (which can be left empty if you want no conditions). This can be a DS variable, an AC one, or even something like an item in the player inventory. BUT there's more! You can actually write a condition like this:

    Conversation[2].Dialog[14].SimStatus == "WasDisplayed"
    

    Meaning: if dialogue entry 14 from conversation 2 was ever displayed to the player, then display this dialogue option. You can ask DS to save the display status of EVERY dialogue line the player ever sees or is presented with! The player once said they like pie? You can easily pepper your other conversations with pie references, and they are displayed if and only if that one dialogue line was displayed.

    Basically, this means there's no need to painstakingly set variables to be checked later. No need to create and run a chain of "check variable" actions to toggle dialogue options on and off. This is particularly useful if you want a dialogue option to have multiple conditions! Want the NPC to make a pie joke if the player has mentioned a pie before AND is carrying a pie? Easy.

    DS is just a very, very versatile system. I find it indispensable if you are dealing with complex branching storylines.

  • Oh! And the integration includes several AC actions that allow AC to access all the data stored by DS as well. You can easily check if a line has been spoken, etc.

    Also, something I find very good is that yes, all DS dialogue can be displayed independently from AC, but you can also funnel all the speech lines through AC if you wish. So I'm using DS to manage all the dialogue, but when the lines are actually spoken, I set DS to send those lines over to AC.

  • Wow, thanks very much for a detailed explanation! I think I'm finally sold on DS. I just hope integration with AC is tight.
    I've been trying to reconcile some assets with AC in the past, and failed with most of them.

  • The integration is very good. You will need to create a Unity UI dialogue response menu that isn't linked to AC and assign it to the DS manager, but as for the rest, you can keep using your AC speech menu. To route speech lines through AC, you can use something like "ACSpeech(entrytag)@0.6" as the default sequence command (this means it will send the speech line to AC 0.6 seconds after the node is reached). If you do this, you can keep using all AC speech tokens like [wait:x], etc.

    To run a DS conversation, you just need to use an AC action that comes with the integration pack.

    The one thing you need to be aware of is that to access AC variables (so you can use them as conditionals, change them with DS sequence commands, etc), DS creates its own duplicate of all AC variables, but they aren't synchronised every frame. By default, when a conversation starts, DS will copy the values stored by AC onto its own variables, and then it will copy them back when the dialogue ends.

    This works well for a lot of games, but I have a few actionlists constantly running in the background (for example, increasing the Time variable by 1 every second). So if DS copies the variables back to AC, this will overwrite my time counter with whatever number it retrieved when the dialogue started. You can modify this behaviour by unticking a checkbox in the Adventure Creator Bridge.

    Personally, I copy all variables FROM AC at the start of a dialogue, but I don't copy them back when it ends. This basically makes AC variables read-only within DS, but if I really need to modify an AC variable mid-dialogue, DS can trigger AC actionlists with a sequence command like: AC(Change variable) [plays the "Change variable" cutscene].

    Also, you can easily link DS to the AC save system by assigning an AC global string variable for DS use. By doing this, an AC savegame will contain a long string with all DS info, and DS will retrieve this data when you load a game with AC. This happens automatically, so you can just set it up and forget.

  • Thanks! Yeah, I see on DS's site that the AC bridge is frequently updated.

    Do you happen to know any solution for an external in-game puzzle system that does work with AC? Or do you create them from scratch with AC variables etc.?
    I mean simple but substantial stuff like fuseboxes, generators, padlocks and keypads that all function with scripts. AC's actual examples are a little too simple.

    I tried for several days to reconcile the likes of Adventure Puzzle Kit and First Person Exploration Kit with AC's system, but I failed. I mean AC.KickStarter.TurnOffAC () just won't do in these cases, since you need to retain AC for the variables and saved states.

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.