Thanks! The PreAction worked. I’m trying to set up animations right now. Say I have an animation asset ‘sad’ in my animset, and in the text column I have {PlayAnim(‘sad’)}, is there anything else I need to add besides this script function override? (I’m not entirely sure I’ve implemented it properly)
Glad to hear the pre-action worked
For the custom function handler, all that’s left (that I can see) is to name the switch’s parameter (it should be the name of your function instead of Case 0 - eg. PlayAnim). The switch case is searching for the exact text of the function name to know what path to take.
I’m having a little trouble getting this to work. Going off the documentation, if my inline script is {PlayAnim(‘laughing’)}, would I be making the switch on name node case 0 into PlayAnim, or laughing? And does it make a difference if I use the play anim node shown above should I be using the play slot animation node where I can specify the asset?
Here is the inline:
Example Animation function
Oh right, you’re passing in a parameter, sorry I was completely overlooking what you were trying to achieve with my last response (Holiday season, so I’m all over the place haha).
The animation ‘laughing’ needs to be converted into the reference of your animation asset, this is done by copying it into the asset table (copy [ctrl+c] the animation asset from the content browser and paste to the AssetReference column)
- The “switch on name” case 0 should be the name of the function (PlayAnim).
- Place your animation in the asset table (eg. ctrl+c on the asset and paste it
- Use GetScriptArg on your Args array to extract the name of the animation from idx 0 (macro available in MLib_Dialogue if you’re using the latest version, else you can find it in BPC_Dialogue and copy it over to your child class)
- Get the named asset from the asset table using the extracted animation name (GetAsset dialogue function)
- Play animation
I felt that was a bit hard to follow, so I pasted my version here: Animation Dialogue Function posted by anonymous | blueprintUE | PasteBin For Unreal Engine
I also felt that the blueprintue was hard to follow, so I took some screenshots
AssetTable
Example Animation Function
I’m not able to copy the animation asset to the dialogueassets data table. In the data editor I can’t edit anything but width and height. How would I go about importing the data table to CSVed?
Aye, the data table editor is limited in some ways. Importing CSV files is explained here: Data Driven Gameplay Elements in Unreal Engine | Unreal Engine 5.3 Documentation
You can work in excel/google spreadsheets too if you prefer (I’ve been using google sheets for a while now, and used CSVed before that). They export to CSV too
Argh! I’ve replaced DT_DialogueAssetsMain with my own csv and replaced the references, but now the dialogue doesn’t start at all when I use E to interact.
Going to leave it for the moment. I know there’s probably something stupid I’m doing wrong but I’m stumped. Thank you for your help thus far
Okay - I’ve rebuilt the handle function script override and created the animation function - nearly. At the end of the script you have a function; RunEndofAnimScript. I don’t have this function. How am I building it?
Edit: I also don’t have a function for GetAnimInstance that doesn’t target the skeletal mesh component. Is this an issue? I don’t want to have to reference one skeleton because I’d like to be able to use multiple skeletons with this script.
As it is right now, I have ‘laughing’ as an element for the arg string array but the animation doesn’t play.
I’m also creating a component I can attach to NPCs that will generate a random name from a markov list. However, whenever I try to cast the new speaker attribute row to the UI_dialogue I get a compile error. What am I missing here?
Hi Greg - I’m noticing BPC dialogue no longer works due to depricated features in UE4. Are you planning an update that fixes these for non-coders?
Sorry about the large amount of posts - I have resolved the markov problem myself. I am wondering if it is possible for the speaker attributes table to create rows and set members in the columns on runtime. I’m reading old posts saying they are read only but just wanted to check if you knew a workaround. I’m trying to get actors withrandomly generated names to be assigned ‘personalities’ from several data tables but can’t seem to get the speaker name to update in the UI, firstly.
Hi all, I just returned from the Holidays, sorry for the delay in my replies!
Hi , the example I posted was specific to a character in my case, the PlayAnimation function I posted was just a custom example - it’s all regular blueprints after the extraction of the function names and arguments in the Handle function.
You can certainly do this, though how will depend on what you need. The Attributes table is optional if you override the **GetSpeakerAttributes **function in your BPC_Dialogue child class. The standard is to retrieve a table row here, but instead you can build a new struct with whatever details you need.
Hi BaconMonkey, the current version should be fully compatible with 4.14.1. If you’ve updated, can you provide additional details as to what is going wrong?
Hey neat system you got here. This might be a silly question, but it wasn’t shown in your video so here goes.
Does it know when the chat window is filled, and then waits for the player to press a button to continue the dialogue? Not really an issue on your typical pc screen, but potentially would affect lower resolution screens where space is limited.
Hi Selentic,
No ‘pages’ in the dialogues are not automatically detected, this is left to the writer to insert page breaks (>> operator](Blueprint Dialogue System - Documentation - Google Docs)). Instead, the dialogue box grows to fit the text expected in that branch (a scroll bar appears and the dialogue scrolls to the newest line of text added).
Cheers!
Thanks, this is my speaker attributes override in a child component class of BPC Dialogue for all NPCs whose name will be randomly generated. Upon simulation however, the speaker attributes table is not updated. Nearly there?
Aye, nearly there. You’ll want to store a variable for the out parameter (result) in the case that the item is in the data table, or have a second return node. This being said though, the name will be randomly generated for every dialogue page that pops up. I’m not sure what you’re trying to do exactly, but this might not be what you want? If you meant to have a consistent result every time you speak to the same character (for example), then you’d generate the speaker attribute table item at some other time and return it in this function.
Could you perhaps show me when I should be generating the speaker atrribute table item? I’m not too sure what you mean. I’d like for the character name to be consistent. Apologies if this is a bother. I’m still learning. Let me know and I will private message you with details about how I’m set up.
From the dialogue system’s perspective, it doesn’t matter when it’s generated (as long as it’s before it’s needed). If you are generating characters for example, when you generate the character, generate it’s attributes as well. This is pretty custom to your project I’m afraid.
No problem - I’ll figure it out. Thank you for this plugin my man. It’s been a huge time saver. Definitely will be getting a 5 star rating from me on the marketplace.
Very glad that it’s been helpful, thanks and best of luck!
I’d like to have a “typing” sound play as words are typed on screen. The sound should be in “sync” - start playing when the first word appears, and stop playing on the last word. It should work when playing at normal speed as well as the faster click through speed.
I’m pretty new to UE4 and Blueprints - my focus is mainly on audio and music design using middleware apps like FMOD. Can anyone help me get started in how to accomplish something like this? Speaking of FMOD, is there any way for the sound assets we’re triggering to be FMOD Events rather than SoundCues?