Unity Events on Dialogue Entry
Unity Events on Dialogue Entry
Would it be possible to get some UnityEvents on the dialogue entries? It would be really powerful. Alternatively, could you point me in the correct direction to implement this myself if not? It would be a really valuable feature for us.
Re: Unity Events on Dialogue Entry
Hi Hannah,
The Dialogue System Events component has two dialogue entry-specific events: On Conversation Line and On Conversation Line Cancelled.
You can also receive these events from script messages, as well as an additional OnPrepareConversationLine that's invoked before a dialogue entry is displayed (versus OnConversationLine which is invoked right after).
If these don't cover your needs, what additional events would be helpful?
The Dialogue System Events component has two dialogue entry-specific events: On Conversation Line and On Conversation Line Cancelled.
You can also receive these events from script messages, as well as an additional OnPrepareConversationLine that's invoked before a dialogue entry is displayed (versus OnConversationLine which is invoked right after).
If these don't cover your needs, what additional events would be helpful?
Re: Unity Events on Dialogue Entry
Sorry for the late reply, I got caught up and forgot that I posted this. I'd like events directly on the dialogue entry if possible.
This would allow my design to do a lot more game logic scripting.
This would allow my design to do a lot more game logic scripting.
Re: Unity Events on Dialogue Entry
Got it, thanks. I just added it. It'll be in a patch release coming out tomorrow.
Re: Unity Events on Dialogue Entry
Amazing, you're the best!
Re: Unity Events on Dialogue Entry
Version 1.6.6 is now available on the customer download site!
This includes an "OnExecute" UnityEvent for each dialogue entry. However, there are a couple restrictions as documented in: Note About UnityEvents in Dialogue Entries
I'll also paste them below:
If you expand the Event foldout, you can add event handlers to a UnityEvent called OnExecute(), similar to adding an event handler to a Unity UI Button's OnClick() event. However, since the dialogue database exists independent of whatever scene is open, you can't assign a scene object to the event handler. Instead, you must assign an asset file such as a ScriptableObject.
To assign custom code to the OnExecute() event, put your custom code inside a ScriptableObject class and create an asset file using that class. For more information on creating ScriptableObject assets, see Unity's tutorial: https://unity3d.com/learn/tutorials/mod ... le-objects
UnityEvents also aren't converted by the Database > Export feature or Dialogue Database Converters since they can't be translated into non-Unity text formats.
This includes an "OnExecute" UnityEvent for each dialogue entry. However, there are a couple restrictions as documented in: Note About UnityEvents in Dialogue Entries
I'll also paste them below:
If you expand the Event foldout, you can add event handlers to a UnityEvent called OnExecute(), similar to adding an event handler to a Unity UI Button's OnClick() event. However, since the dialogue database exists independent of whatever scene is open, you can't assign a scene object to the event handler. Instead, you must assign an asset file such as a ScriptableObject.
To assign custom code to the OnExecute() event, put your custom code inside a ScriptableObject class and create an asset file using that class. For more information on creating ScriptableObject assets, see Unity's tutorial: https://unity3d.com/learn/tutorials/mod ... le-objects
UnityEvents also aren't converted by the Database > Export feature or Dialogue Database Converters since they can't be translated into non-Unity text formats.
Re: Unity Events on Dialogue Entry
Hi Toni
This feature looks REALLY valuable to me but I was caught by not being able to export the database.
Some database features that would be really useful, even if I had to use a second file or non chat mapper compatible file...
1) Export the node layout. (Reimporting nodes as a new database causes everything to be rerouted)
2) This event trigger
3) A field for developer notes on the dialogue
Tip:
Spellcheck the csv files using Notepad++
I've had a lot of spelling errors in my dialogue. Excel was horrible for spell checking these because of the embedded codes for scripts, lua and formatting. However Notepad++ (v6.5.3) recognized the code syntax "\nOne" as being a carriage return followed by the word One. Microsoft excel, not so much. However, some forum notes indicated that the most recent releases of Notepad++ had the dictionary removed.
This feature looks REALLY valuable to me but I was caught by not being able to export the database.
Some database features that would be really useful, even if I had to use a second file or non chat mapper compatible file...
1) Export the node layout. (Reimporting nodes as a new database causes everything to be rerouted)
2) This event trigger
3) A field for developer notes on the dialogue
Tip:
Spellcheck the csv files using Notepad++
I've had a lot of spelling errors in my dialogue. Excel was horrible for spell checking these because of the embedded codes for scripts, lua and formatting. However Notepad++ (v6.5.3) recognized the code syntax "\nOne" as being a carriage return followed by the word One. Microsoft excel, not so much. However, some forum notes indicated that the most recent releases of Notepad++ had the dictionary removed.
Re: Unity Events on Dialogue Entry
Hi Andrew,
Will do. If this doesn't make it into 1.6.6.2 (which will primarily address some Unity 5.4 API changes), it should be in the next version.Roncin wrote:Some database features that would be really useful, even if I had to use a second file or non chat mapper compatible file...
1) Export the node layout. (Reimporting nodes as a new database causes everything to be rerouted)
I'll see what I can do. I may be able to record asset GUIDs and re-link them.Roncin wrote:2) This event trigger
Conversations and dialogue entries both have a Description field. Would this suffice?Roncin wrote: 3) A field for developer notes on the dialogue
Good tip. If you're using the latest Notepad++, you can still download DSpellCheck from the repo and drop the DLL into the Plugins folder to get spellcheck back.Roncin wrote:Tip:
Spellcheck the csv files using Notepad++
I've had a lot of spelling errors in my dialogue. Excel was horrible for spell checking these because of the embedded codes for scripts, lua and formatting. However Notepad++ (v6.5.3) recognized the code syntax "\nOne" as being a carriage return followed by the word One. Microsoft excel, not so much. However, some forum notes indicated that the most recent releases of Notepad++ had the dictionary removed.
Re: Unity Events on Dialogue Entry
In version 1.6.6.2's documentation, I added a complete example (with code and screenshots) of using dialogue entry UnityEvents. You can view it here:
Recipe: Dialogue Entry UnityEvents
Recipe: Dialogue Entry UnityEvents