If you aren’t using data tables but you still want to use this system, you’ll want to look at overriding the GetDialogueItem, GetDialogueRownNames, GetAsset, and GetSpeakerAttributes functions in your BPC_Dialogue child class. You’ll need to convert your data into DialogueTableItem structures in those functions for the UI to know what to show/respond. If your system works by branching (even dynamically), I’d imagine it should convert fairly easily to the DialogueTableItem structure.
Aha ! That looks like what I was looking for ! I will dive into these BP’s/functions one of the next days. The conversion should be pretty simple, as long as you use UE standard variables in the struct (as I suspect).
First, I just wanted to say that this system is great and we have had a lot of success working with it. It has enabled some cool stuff, including using the BPC use scanner to allow us to create use actions on items in our level entirely unrelated to dialogue. Overall, this has been a great system to use.
We are running into a bug though, and I am not sure what is causing it. Currently, we have a system set up that triggers dialogue when you enter a collision zone. So, for example, you put a box trigger into a level and use a dialogue object when you cross the trigger. However, once you end the dialogue the character continues walking in the direction they had been walking in, until you press and release the movement key again. My understanding is that for some reason, input is being halted from the mouse and keyboard, causing the game to not register the key up event triggering. Have you seen anything like this, or do you have any idea where input might be blocked during the use of dialogue?
I haven’t encountered this myself (I have additional checks outside of the dialogue system), but I have encountered issues with the input mode since 4.11. The system sets the input mode “UI Only” when a dialogue is opened and closed if the component is set to Keyboard & Mouse, and “UI and Game” mode if set to gamepad. If you want to override this, you can set the components to not handle input modes or cursor at all (set it to “unmanaged”).
I’m starting to get into the system and it looks promising. There is a small issue I’ve come across, however. In 4.11 the Datatables that reference assets have ‘Object’ Type in their structs(DT_DialogueAssets_Main and DT_DialogueSpeakerAttributes_Main). Is that intended? because it makes it impossible to actually choose and place an asset into the Data table row from the editor. What is the expected pipeline? Always *.csv and import?
Unfortunately, the UE4 DataTable editor doesn’t support object references, so a CSV import is needed to use assets. The sample has an example asset table csv file you can look at for reference (the basic use is to “Copy Reference” on the object in the content browser and paste it into the row)
Hello again! Things have been going pretty swell, but I’ve run into a new hurdle and I need some help.
Unfortunately I want to do the same thing Ednoc was doing, except your explanation isn’t really working for me. I want a part of a conversation (not the whole thing) to change depending on whether or not the player completed a task in the last level. So, I need to figure out how to share and update variables from level-to-level, which I’m not clear on.
In the meantime I’ve been running tests on the conversation by changing the variable on Begin Play of the level, but no luck so far. The conversation starts and I swap to a branch that’s Silent and a Hub, but instead of picking between two branches to continue the dialogue, it simply ends. Maybe my conditions aren’t being recognized, I don’t know.
Hope you get what I’m saying! I feel like I’m not communicating the issue as well as I should be.
EDIT: I solved the main issue! I feel so silly – I made a simple grammar mistake, that’s what was breaking things for me.
I’m still curious about storing and sharing variables between levels, though. I’m not sure how I’m going to move things from the game mode to the game instance and back again.
Hi Cinebeast, I’m glad you managed to solve the first issue
The only thing that needs to be restored/preserved is the ‘Variables’ array in the ScriptInterpreter. You can choose to copy these somehow before unloading the current level and re-copying them to the new script interpreter when the level loads, OR you can store the script interpreter on the GameInstance to begin with (your BPC_Dialogue child classes will need to be updated to instead get the script interpreter from there)
Ooo, thanks for noticing the link was broken, looks like Epic’s changed to a URL with the asset name in it.
3D Widgets should be perfectly possible with the current system, there are a few functions that would need to be overridden in the BPC_Dialogue component. I haven’t attempted it myself yet, though I did build it with this possibility in mind (especially with the ‘passive’ dialogue I intend to use as chat-bubbles in my own game).
As for existing project integration, the dialogue system is non-intrusive for the most part. A dialogue ‘ScriptInterpreter’ actor needs to be spawned and maintained (variables copied across levels if desired), the dialogue components need to be placed on the actors who will have dialogue, and the Use system should be integrated or replaced with your own ‘use/interact’ system.
Any chance you can add that to existing system in the next update? I’d rather use out of the box system and not try messing with the script myself (plus I am not a BP/UMG guru :o )
That’s pretty cool. I’d probably have to figure out how to adjust your Use/Interact system for my VR project. However, would I be able to use Use/Interact system you provide for non-VR project as-is ?
I really like the sound of that second suggestion, but I’m having difficulty with it. I updated my child classes, but now no dialogue will appear in-game. I get an error saying that UI_Dialogue is Accessing None whenever it tries to use the Script Interpreter. I figure this means I need to tell the UI to get the interpreter from my game instance instead, but I’m not sure how. I can’t find where and when the UI is getting that information.
I’ll keep looking, I’m sure I’m missing it, but here’s hoping you’ll point it out to me. Thanks again!
The BPC_Dialogue function “GetScriptInterpreter” should be overridden to get the script interpreter from wherever you’re storing it.
Note though that when you cross a level, the script interpreter actor will be destroyed and you’ll need to restore the variables still, I forgot about that part in my previous post.
Sorry for the delay, I didn’t get a notification about your response.
There are very few things that can be happening here (afaik). UI_Dialogue asks the BPC_Dialogue that spawns it where the script interpreter is using that getter, and the getter function could then simply return the spawned actor you’re storing.
Is it using the right BPC_Dialogue component, and has the script interpreter actor been spawned yet?
Okay, I think that’s it. I added a print string in there and, while the Game Mode version of the Script Interpreter is printed, the Game Instance version is not.
Hmm, it might be best to keep the game mode as the script host and copying it’s “variables” array over on level load. You’ll have to respawn the actor no matter which way you go, so at least then you’d already have it spawning properly?