Search Unity

[70% OFF - FLASH DEAL] Dialogue System for Unity - easy conversations, quests, and more!

Discussion in 'Assets and Asset Store' started by TonyLi, Oct 12, 2013.

  1. mikemuk01

    mikemuk01

    Joined:
    Dec 1, 2016
    Posts:
    53
    Hi Tony. As always your reply was prompt and has solved the problem. I set the Dialog State dropdown to always and it works perfectly. Thank you
     
    TonyLi likes this.
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Glad to help! :)
     
  3. Mixxy

    Mixxy

    Joined:
    Jan 13, 2016
    Posts:
    8
    @TonyLi perfect! Thank you sir!
     
    TonyLi likes this.
  4. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    Hi sir,
    How can i get the name of the NPC which has selected.
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi! If a conversation is active, you can check Variable["Conversant"]. Examples:
    • Dialogue Text: "Hello. My name is [var=Conversant]."

    • Conditions: Variable["Conversant"] == "Bob"

    • C# code:
      Code (csharp):
      1. string npcName = DialogueLua.GetVariable("Conversant").asString;
     
  6. Mixxy

    Mixxy

    Joined:
    Jan 13, 2016
    Posts:
    8
    Hey again @TonyLi, got another question for you. Certain apostraphes won't appear in the dialogue window, but others will. Sometimes even within the same sentence, one apostraphe shows up fine, and another one will be hidden. Not even a blank space where it should be, it just acts like it never existed at all. What could I be doing to cause this?
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi @Mixxy - Are you talking about the dialogue UI at runtime? If so, it's possible that whatever font you're using doesn't have those characters. Try using a different font.
     
  8. Mixxy

    Mixxy

    Joined:
    Jan 13, 2016
    Posts:
    8
    I figured out what it was. For some reason, windows automatically merges n' into a single character, which the font had no character for. If I copy-paste an apostrophe from somewhere else, it fixes it.
     
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Well that was a bit tricky of Windows (or whatever writing app you're using in Windows). Glad you found the issue.
     
  10. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    I managed to do like actorName.text = "Talk To " + ps.CurrentUsable.name+":";

    Can i use like this or not?
     
  11. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Hello,

    Im wondering how can I make my own script that listens to events of the NPCs when a dialogue starts and also get access to the conversation actor (the player in my case)?

    Edit: I discovered I can add DialogueSystemEvents on every NPC, but not sure if thats the best way to do it since I already have that script on the DialogueManager game object. What Im trying to do is when a conversation starts send an event to NodeCanvas to set the "Target" to the conversation actor (player), so the NPC can rotate towards it.
     
    Last edited: Mar 11, 2020
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi @goutham12 - Use ps.CurrentUsable.GetName(). This is similar to ps.CurrentUsable.name, except it will also preprocess any Lua codes in the name, get the localized version if you're using multiple languages, and check for a Dialogue Actor override.

    Hi @skinwalker - You can use the Dialogue System Events on the Dialogue Manager. (Or each NPC, which is fine, too.) Hook up its OnConversationStart() event to set the NodeCanvas "Target" to DialogueManager.currentActor. Or add a script to the Dialogue Manager that has a method similar to this:
    Code (csharp):
    1. void OnConversationStart(Transform actor)
    2. {
    3.     var npc = DialogueManager.currentConversant;
    4.     var blackboard = npc.GetComponent<Blackboard>();
    5.     blackboard.GetVariable<Transform>("Target").value = actor;
    6. }
     
    skinwalker likes this.
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Dialogue System 2.2.5 Released!

    Version 2.2.5 of the Dialogue System for Unity is now available on the Asset Store.

    Major additions include: Twine import and support for the New Input System.


    Version 2.2.5

    Core:
    • Dialogue Editor:
      • Improved node colors when using Unity 2019.3+ with Pro skin.
      • Lua wizard Variable dropdowns now split submenus on "." for convenience in organizing large variable lists.
      • Added Menu > Refresh option.
      • Fixed Quest > Use Groups checkbox.
      • Fixed node lasso in Unity 2019.3+.
    • Added: New Unity Input System support.
    • Improved: Sequence "+" menu now has {{shortcuts}} submenu.
    • Improved: Sequencer now replaces [var] and [lua] tags inside shortcuts.
    • Improved: Preload Resources now initializes cutscene sequencer to avoid potential hitch when starting first sequence.
    • Improved: Can now assign Sprite or Texture2D to DialogueActor portrait.
    • Improved: Added DialogueManager.SetDialoguePanel(bool) method.
    • Improved: Added additive option to LoadLevel() sequencer command.
    • Improved: Added overridable PlayCharacterAudio(char) method to typewriter effects.
    • Improved: StandardUISubtitleControls.GetPanel is now public.
    • Improved: ConversationController.currentState is now public.
    • Improved: Added Any Key checkbox to UIButtonKeyTrigger.
    • Improved: Added Deactivate On Close checkboxes to UI panels.
    • Improved: Added Don't Deactivate Main Panel checkbox to StandardDialogueUI.
    • Improved: Unique ID Tool remembers selected databases between editor sessions.
    • Improved: Added Item type to CustomLuaInfo.
    • Fixed: Subtitle panels with visibility set to Always From Start now show correct portrait if previously overridden with SetPortrait().
    • Fixed: ProximitySelector no longer detects new usables when disabled.
    • Fixed: Table indices and custom fields with forward slashes (/) now use underscores in Lua (_).
    • Fixed: Sequencer message timing when next node waits for same messages that previous node continues on.
    • Fixed: If conversation ended due to Continue() and new conversation started on same frame, new conversation would also respond to Continue().
    • Fixed: Dialogue Actors with portrait animator controllers did not assign their animator controllers to overridden panels (e.g., using [panel=#]).
    • Fixed: 1x to 2x Updater didn't update StartSequenceOnDialogueEvent components.
    • Fixed: Audio() sequencer command oneshot parameter can now be `oneshot` or `true` (or omitted if not a oneshot audio).
    • Fixed: Intermittent error messages with Dialogue Editor's global search & replace.
    • Fixed: RandomizeNextEntry() on node when starting a conversation at that node instead of <START>.
    • Fixed: Field names may now have forward slashes (e.g., Actor["Dan"].stats/main/hunger).
    • Fixed: Now looks for DialogueActor portraits on additional participants, not just conversation's primary participants.
    • Timeline: Improved design time preview to show conversation and bark text.
    • Save System: Added MultiActiveSaver component.
    • Save System: When loading game, PersistentDataManager now initializes new quest states to their initial database state.
    • Text Table: Changed: Now uses default field's value if value for a specific language is blank.
    • Text Table: Fixed right-clicking context menu would select wrong field row.
    Third Party Support:
    • Adventure Creator: Updated for 1.70.4.
    • articy: Import window wasn't saving or observing Use Default Actors If None checkbox. Strip elements that aren't actors or items are now put in Lua tables as strings.
    • Aurora: Updated importer for .NET4.x compatibility.
    • Corgi: Updated for 6.2.
    • DoozyUI: Added integration instructions.
    • Inventory Engine: Updated for 1.5.
    • Twine: Added import support.
    • TopDown Engine: Updated for 1.6.1
    • UCC: Converse > Detach Camera checkbox now allows conversations to control UCC camera.
    • uMMORPG: Updated for 1.187; fixed GetPlayerClass().
    • UniStorm: Updated for 4.1.1.
    • uRPG: Updated for 1.20.
    • uSurvival: Updated for 1.72.
     
    skinwalker likes this.
  14. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Hello,

    I have a question - I want to freeze the NPC and player when you start a dialogue so I have subscribed to onConversationStart and onConversationEnd to unfreeze the characters, the problem is that I have sequencer commands that open other windows like vendor, where the characters still have to be frozen but the dialogue isnt running. In my OpenVendorSequencerCommand I can do this

    // Awake
    FreezeActors(actors);
    Stop();

    but what happens is that this method gets called before the dialogue onConversationEnd, so the characters are frozen and then the dialogue exits so it unfreezes them. What I can do it probably call my custom coroutine there but it will require GetComponent calls and Im wondering if there's a better way to do this like executing a sequencer command 1 frame after the dialogue ends
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi @skinwalker - What if you create a method that checks whether the player should remain frozen or can be unfrozen, and call this method in OnConversationEnd()? You can check if any of the extra windows are open and if a conversation is active. For example:

    Code (csharp):
    1. public void UnfreezeIfAllowed()
    2. {
    3.     var remainFrozen = DialogueManager.isConversationActive || InventoryIsOpen || VendorIsOpen || etc.;
    4.     if (!remainFrozen) UnfreezePlayer();
    5. }
     
    skinwalker likes this.
  16. Deviarc

    Deviarc

    Joined:
    Sep 4, 2014
    Posts:
    24
    Hello again!

    I'm having a little trouble understaing how to register a function to work with Conditions.

    For example, I'm doing a InventorySystem, got the GiveItem working from the Dialogue using the Lua Register Function.
    Now I'm trying to check if the user have the item or not, I'm registering the function with a bool return value and a string parameter, but I'm getting erros on Lua, Failed to Parse.

    This happens when I'm trying to check for a double condition: (HaveItem("Helga01-Servidor");) and (HaveItem("Helga02-Servidor");)
    If I do only one condition, it works as expected.

    Any tip on this issue?
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi @Deviarc - You don't need the semicolons. Try this:

    Code (csharp):
    1. HaveItem("Helga01-Servidor") and HaveItem("Helga02-Servidor")
    (Don't put the "1." in your Conditions. That's just a line number from the code block formatting.)
     
    Deviarc likes this.
  18. SOSolacex

    SOSolacex

    Joined:
    Jan 10, 2018
    Posts:
    121
    Hey there. I've been contemplating whether I'd get this asset or not, thus I was delighted to see that there was an evaluation version.

    I currently also own Opsive's First Person controller, meaning I also downloaded the integration.
    Now the issue is, is that I can't get it working at all. I followed the instructions in the documentation, however, at the step where it should show "Press spacebar to start dialogue", there is no such thing.

    I even booted up the example scene, but it had the same issue. I can't coverse with other people, although the quest log etc did work.

    If it matters at all (Which it might since it changes a couple of things for Opsive's FPS camera), I am using the URP pipeline.
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi @SOSolacex - Thanks for checking out the Dialogue System! Did you follow the integration instructions here? Opsive Character Controllers Integration.

    Are you referring to the example scene in Pixel Crushers / Dialogue System / Third Party Support / Opsive UCC Support / Example? If so, there's only one character to converse with:

    upload_2020-3-12_17-25-27.png

    Walk up to this guy and press the 'F' key (or the Interact input, whatever you've mapped it to in Unity's Input Manager).

    There shouldn't be a step with "Press spacebar to start dialogue". The integration instructions recommend using Opsive's interaction system, which is the way the example scene is set up.

    URP should be fine, at least on the Dialogue System side. Are you using the new preview Input System by any chance?
     
  20. SOSolacex

    SOSolacex

    Joined:
    Jan 10, 2018
    Posts:
    121
    Thanks for the quick reply.
    That is indeed the example I looked at. Pressing F does not do anything for me.
    Also, apologies. That spacebar thing was when I followed the quick start before I realized there was an integration package. Although following the integration guide also did not work.

    In regards to the input system, no.
     
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Make sure you're facing the NPC. It's configured to do a directional raycast straight ahead to detect interactable dialogues.

    Are there any errors or warnings in the Console window?

    What versions of Unity and Opsive First Person are you using? I'll check the same here.

    Is this in a new, empty project with the Dialogue System eval version and Opsive First Person, or are there perhaps other customizations or plugins that may be interfering?
     
  22. SOSolacex

    SOSolacex

    Joined:
    Jan 10, 2018
    Posts:
    121
    Okay so I got it to work.
    In regards to the example scene, the ability "Interact" wasn't on the Nolan character. This made it unable to work.

    In my personal project however, when I read "NOTE: To set up interaction on a UCC character, put the Interactable component on the character's Colliders > CapsuleCollider child GameObject."
    I did just that. However, what I didn't do is put the Dialogue System Trigger Interactable Target(DSTIT) script there as well.
    This caused the Target list in the interactable script to look at the Character Foot Effects component from opsive rather than the DSTIT.

    As far as I know, everything works now. Cheers.
     
    Last edited: Mar 13, 2020
    TonyLi likes this.
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Glad you got it working. I'll check the integration download from Opsive's site. The version that I sent Opsive has the Interact ability. Maybe something happened in transit, or specific to the First Person controllers. The example scene was built in a universal way that should work with UCC, first person, and third person controller assets.
     
  24. goutham12

    goutham12

    Joined:
    Jul 14, 2016
    Posts:
    53
    How can i get pic no in runtime. I mean to set the portrait image we use [pic=4]. how can i get that value 4 in runtime.
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi @goutham12 - Check DialogueManager.currentConversationState.subtitle.formattedText.pic. It's in the PixelCrushers.DialogueSystem namespace.
     
  26. Deviarc

    Deviarc

    Joined:
    Sep 4, 2014
    Posts:
    24
    Hello, quick question, when using the default Dialogue Canvas UI, the answers panel is persisting between dialogues.

    For example, doing one dialogue and finishing it with a answer click, when starting a different dialogue, the answers panel is visible with the fade-out animation.
    Is there a way to simply force it to disable state?
     
  27. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi! Yes, the easiest way is to remove the response menu panel's Animator or clear its Hide Trigger field.
     
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Twine Import Video Tutorial

    Version 2.2.5 introduced the ability to import from Twine. Here's a video tutorial:

     
  29. janiche

    janiche

    Joined:
    Jan 4, 2015
    Posts:
    52
    Hi, I'm developing a Chat like game. I want to know if there are a way to start the conversation from an given entryId, I mean if I want to start a conversation from id=10 , and if any way to get current entryId
     
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi @janiche! Yes to both.

    To start a conversation from id=10 in a C# script, use:
    DialogueManager.StartConversation("title", actor, conversant, 10);
    In a Dialogue System Trigger, you can specify the starting entry ID.

    During a conversation, the current entry ID is in:
    DialogueManager.currentConversationState.subtitle.dialogueEntry.id
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Disco Elysium wins Game Developers Choice Awards for Best Narrative, Best Debut

    Congratulations to Studio ZA/UM for winning Best Narrative and Best Debut Developer for Disco Elysium, made with the Dialogue System for Unity!

    If you haven't played the multiple game of the year winner yet, you can get it for 25% off through March 23.

     
    SickaGames1 likes this.
  32. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    Hi, this has suddenly started happening on two of my quests, the duplicate showing of the UI, no idea what I changed to cause this to happen. Using 2017.4.35f1 if that helps. It has been working perfectly since I first added it two years ago, so I am at a loss to why it has started doing this now.
     

    Attached Files:

  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi @helgarddebarros - Do you have two copies of the quest in your dialogue database?

    Do other quests correctly show only one copy in the tracker HUD?

    Please feel free to send a reproduction project to tony (at) pixelcrushers.com if you'd like me to take a look at it directly.
     
  34. M0ti

    M0ti

    Joined:
    May 4, 2019
    Posts:
    14
    Hey everyone, I'm learning how to use this tool now and unfortunately I've got stuck really early.
    I would like for the player's text to not be always as a menu choice.
    After a day of searching, I found the "Always Force Response Menu" checkbox which I unchecked.
    And I've also found the "Show PC Subtitles During Line"
    Now players text is finally shown as a simple text BUT! it's in the "NPC Subtitle Panel" !?!?
    I'm using the Basic Standard Dialogue UI and I just can't force the player's text to show properly in its subtitle panel.

    It's possible that I've just messed something as I was figuring stuff out. After all, at one point during the day when I had "Skip PC Subtitle After Response Menu" unchecked it showed it properly at the bottom of the screen but not anymore.
    So I could just reinstall the package. I just wanted to understand what possibly happened there.

    (I'm using it together with the Top Down Engine )
     

    Attached Files:

  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi @M0ti - In the Dialogue Editor's Actors section, inspect the Player actor. Make sure "Is Player" is ticked.

    If that doesn't help, make sure the Basic Standard Dialogue UI's Conversation UI Elements > Default PC Subtitle Panel still points to the correct subtitle panel (i.e., "PC Subtitle Panel").
     
  36. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Hi,

    I have a question about the DialogueSystemSaver which also applies to FactionManagerSaver, QuestJournal, QuestGiver and FactionMemberSaver they all have a field named SaveAcrossSceneChanges - is this data actually stored to the disk or its in memory? I want this to disappear if the user quits the game, but also to be able to save everything if the user decides to make a save file in another scene. Based on my tests if I go to another scene and quit then play again the data disappears

    Another problem is that for example in my game if you press Escape -> Menu I dont want it to save the data, you can only save if you interact with your shelter, so I need a way to manually wipe all the saved data from these classes if the user goes to the menu, kinda like save across every scene except the menu.

    The way I manually save is this:

    Code (CSharp):
    1.             string s = SaveSystem.Serialize(SaveSystem.RecordSavedGameData());
    2.            
    3.             ES3.Save<string>(SceneManager.GetActiveScene().name,s, filePath);
    4.  
    If SaveAcrossSceneChanges is enabled and it also includes data from previous scenes (if you are on scene 3 but have previously went through 1 and 2), then I will have to change the key to be a constant instead of the current active scene.
     
  37. M0ti

    M0ti

    Joined:
    May 4, 2019
    Posts:
    14
    @TonyLi Wow, thanks for the amazingly fast reply. I've checked your suggestions and both were as you've described.
    I tried to import the asset once again but that did not help as well. So I thought that the problem had to be in something I did in the scene itself.
    Reverting to the last commit and making everything again woked. I hade to be more careful from now on.
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi @skinwalker -

    The save system keeps saved game data in memory, in a dictionary keyed by the saver components' keys.

    When you call SaveSystem.RecordSavedGameData(), it tells all savers in the scene to record their data into the dictionary.

    If you change scenes using SaveSystem.LoadScene() or the LoadLevel() sequencer command, it does the following:
    1. Calls SaveSystem.RecordSavedGameData().
    2. Calls SaveSystem.BeforeSceneChange() to inform all savers that the current scene is going to be unloaded.
    3. Loads the new scene. (Will use a SceneTransitionManager component if present.)
    4. Cleans the dictionary of all saver data except for savers in the new scene or savers with Save Across Scene Changes ticked.
    5. Calls SaveSystem.ApplySavedGameData() to tell all savers in the new scene to restore their state from the data stored in the dictionary.
    If you want to clear the entire dictionary, the best way is to call SaveSystem.RestartGame().

    The save system only saves to permanent storage when you call SaveSystem.SaveToSlot(#). (Or if you connect a UI button to SaveSystemMethods.SaveToSlot, which calls SaveSystem.SaveToSlot.) Alternatively, you can serialize the data and save it yourself, as in the code in your post. Or you can add an ESSavedGameDataStorer to the same GameObject as your SaveSystem component, and it will automatically save using Easy Save.

    To summarize:
    • Change scenes: SaveSystem.LoadScene().
    • Reset game: SaveSystem.RestartGame().
    • Save game to disk: SaveSystem.SaveToSlot() or ESSavedGameDataStorer or the code in your post.
    • If you want to keep data from scenes 1 & 2 when saving in scene 3, tick Save Across Scene Changes on scene 1 & 2's savers.
     
    skinwalker likes this.
  39. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Glad to help!
     
  40. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Thanks for the response, Im using an asset to change the scenes though, is that going to cause a problem?

    Also for things like QuestGivers should I enter the same key or leave it blank so it uses the game object name? Maybe I should leave the Save Key empty everywhere. I hope that it wont cause a problem if I have 2 of these components on the same game object and the key is empty (QuestGiver, FactionMemberSaver) - if thats the case I will fill them manually for each NPC like SaveKey -> MyNameQuestSaveKey, SaveKey -> MyNameFactionMemberSaveKey...

    By the way SaveSystem.RestartGame wants a string : sceneName that it loads, I wont need this functionality (it calls a few methods and one of them is private so cant access it if I wanted to call them one by one from my code).
     
    Last edited: Mar 19, 2020
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    That's fine. Just call SaveSystem.RecordSavedGameData() and SaveSystem.BeforeSceneChange() before changing scenes. Then call SaveSystem.ApplySavedGameData() after changing scenes.

    Each Saver has an "Append Saver Type To Key" checkbox. If you tick this checkbox and the Key is blank, it will generate a key using the GameObject's name and the saver type (e.g., "Player_PositionSaver"). If you don't tick it, it will use the GameObject's name as the key (e.g., "Player"), which will conflict with other savers on the same GameObject.

    There's also a menu item Tools > Pixel Crushers > Common > Save System > Assign Unique Keys that will automatically assign unique keys to savers in the scene.

    I can make the SaversRestartGame() method public in the next update. In the meantime, instead of calling SaversRestartGame(), you can use this:
    Code (csharp):
    1. foreach (var saver in FindObjectsOfType<Saver>()) {
    2.     saver.OnRestartGame();
    3. }
     
  42. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Okay so this seems to be working

    Code (CSharp):
    1.             SaveSystem.ClearSavedGameData();
    2.             SaveSystem.BeforeSceneChange();
    3.            
    4.             foreach (var saver in FindObjectsOfType<Saver>())
    5.             {
    6.                 saver.OnRestartGame();
    7.             }
    8.            
    9.             // Load Scene
    The thing is that the quest log HUD/Journal still display the active quests in the menu until I load the game scene, is there a method I should call from the quest machine to destroy every quest?
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    If you want to hide the HUD while the menu is open, you can call QuestMachine.defaultQuestHUD.Hide(). Call Show() when you want to show it again. Or just temporarily disable the Quest Machine canvas(es) if you prefer. This way you can hide the HUD without actually clearing the player's journal in case the player decides to back out and not restart the game.

    If you want to clear the player's journal, call QuestMachine.GetQuestJournal().ResetToOriginalState().
     
    skinwalker likes this.
  44. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Thanks, I have to rework my npc hierarchy a bit, currently it's like this

    Root (only has Deactivator to hide all children if the player is away)
    ->Components (Dialogue, Quest Giver, Faction Member, Savers...)
    -> Fbx

    so the problem that I see is if the player is far away and I want to save or exit the "Savers" will be disabled and wont do anything, so I have to move them to the Root like this

    Root (Deactivator, Quest Giver, Faction Member, Faction Member Saver)
    -> Components(Dialogue)...

    so far its working great, my only concern is if Love/hate requires the Faction Member to be on the same game object as the DialogueTrigger (to use the Lua functions), I havent done anything with love/hate yet so have no idea, but the QuestGiver doesnt have that requirement it can be anywhere since I just need the GiverId in the lua functions. FactionMember doesnt have an ID so not sure how the lua will reference it from the dialogue.
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi @skinwalker - The FactionMember can be anywhere, too. Faction-related Lua functions such as GetAffinity() go by faction name. FactionMember-related Lua functions such as ReportDeed() go by GameObject name, but if you have a FactionMember named "Adam", you can name the FactionMember child "AdamFactionMember" and refer to that in the Lua function.
     
    skinwalker likes this.
  46. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    Hi, related to earlier post.

    No idea what is going on. In the editor, it works fine, and then in the build, it works fine most of the time, and every know and then it shows the duplicate UI. I have looked a the code, watched the tutorials again in case I missed something, but everything looks right, and it works right most of the time. I unfortunately can't send the game files as it is an entire 5 GIG game, so no idea how to make that smaller to be able to send it. First pic is the editor, second is the build, working fine the last three times I tried, but two different people have reported this bug, and I have encountered it a few times.
     

    Attached Files:

    • 1A.png
      1A.png
      File size:
      1.3 MB
      Views:
      380
    • 2A.png
      2A.png
      File size:
      1.1 MB
      Views:
      360
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    @helgarddebarros - If you can reproduce it in the editor, add a Lua Console component to the scene. Press ~+L to open the Lua Console. Then enter "return Quests". Check if you see the quest listed twice. It should only appear once.

    Do you have a duplicate quest in your dialogue database?

    Are you using any code or visual scripting blocks that creates new quests at runtime?

    I'll need more information to be able to help. 5 GB is no problem. Zip up your Assets, ProjectSettings, and Packages folders. Then send the zip file to tony (at) pixelcrushers.com. Use whatever file sharing service you prefer -- Dropbox, Google Drive, Microsoft OneDrive, etc. Also provide the steps that are most likely to cause the issue.
     
  48. DMRhodes

    DMRhodes

    Joined:
    May 21, 2015
    Posts:
    81
    Hello,

    I've had a lot of success using Playmaker and the Dialogue Engine together, so first off thanks for the great work as always! One question I do have though is how do I use the sync variable playmaker action to sync actor variables rather than global dialogue variables?

    On a related note, is there a way to set global Playmaker variables via a dialogue nodes script/sequence field?

    Cheers
     
    Last edited: Mar 21, 2020
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,702
    Hi @Candy-Bomber - There's no built-in equivalent Sync action for Actor fields. Instead, use the Get Lua Field and Set Lua Field actions. For example, to get the Player actor's Age field:

    upload_2020-3-21_9-11-57.png

    Yes. Use GetFsmType() and SetFsmType() Lua functions. For example, to set the global variable AccessGranted to true:

    upload_2020-3-21_9-15-21.png
     
    DMRhodes likes this.
  50. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    @TonyLi I tried importing the Opsive UCC Support package, but I get the following compile error:

    Assets\Pixel Crushers\Dialogue System\Third Party Support\Opsive UCC Support\Scripts\Lua\UCCLua.cs(5,21): error CS0234: The type or namespace name 'UCCSupport' does not exist in the namespace 'PixelCrushers' (are you missing an assembly reference?)

    [EDIT]
    Wait, I think I missed a step. I didn't download the package from Opsive. I will try that and let you know.

    [EDIT 2]
    Got it. No issues. Sorry for the bother.
     
    Last edited: Mar 21, 2020