Page 1 of 1
Customise DialogueEntry editor window?
Posted: Wed Apr 30, 2025 11:43 am
by ModestFacialHair
Hi Tony,
I can add fields to a DialogueEntry using a Template, and edit them in All Fields: this works nicely. But I have a couple of very frequently used fields that I'd like to add above the fold. Is there a place I can hook in a subclass so I can do that without directly editing Dialogue System editor classes?
Thanks!
Re: Customise DialogueEntry editor window?
Posted: Wed Apr 30, 2025 2:42 pm
by Tony Li
Hi,
No need to hook in a subclass. Just tick the field's "Main" checkbox in the Templates section and it'll appear in the dialogue entry inspector's main section.
If you want to further customize the appearance of the dialogue entry inspector or the Dialogue Editor's node view, see
Customizing the Dialogue Editor.
Re: Customise DialogueEntry editor window?
Posted: Thu May 01, 2025 11:04 am
by ModestFacialHair
Ideal, thank you!
Re: Customise DialogueEntry editor window?
Posted: Thu May 01, 2025 6:25 pm
by Tony Li
Happy to help! You can customize the editor quite a lot with those hooks. If you ever encounter any area where you can't customize what you need to, let me know and I'll add a hook. It's safer than directly modifying Dialogue System code because otherwise you'd lose your direct modifications whenever you updated the Dialogue System.
Re: Customise DialogueEntry editor window?
Posted: Wed May 07, 2025 10:04 am
by ModestFacialHair
You know, I swear I searched the docs, and I didn't see that big juicy chunk of info you linked to. Maybe I was searching for 'modify'. Or 'customi
se'
> If you ever encounter any area where you can't customize what you need to, let me know and I'll add a hook.
I will bear that in mind! I have stuck religiously to subclassing for exactly this reason, but obviously that has its limits.
A follow-up question. I would like to add something to validate my Lua code immediately after editing a conversation node, because I habitually misspell function names when I type them and don't notice until I hit Play.
(i) is there any functionalityin the system that already does anything like that, or
(ii)if not, any advice on where to add this kind of hook? customDrawDialogueEntryInspector ?
thanking you!
Re: Customise DialogueEntry editor window?
Posted: Wed May 07, 2025 10:18 am
by Tony Li
Hi,
customDrawDialogueEntryInspector would be the place. Unlike Sequence fields, where we can add a Check button to check syntax because we know what sequencer commands are available ahead of time, Lua is more flexible. You could define new functions and structures in the Dialogue Editor's Database Properties > Global User Script, for example, that the entry wouldn't know about until runtime. So it's a bit more challenging to validate Lua. You could do it with a bit of work, though!
Re: Customise DialogueEntry editor window?
Posted: Wed May 07, 2025 10:33 am
by ModestFacialHair
cheers!
Yes, I think proper validation is going to be beyond me. But I also think I really just want a common sense check with a string match on 'does this function even exist', and I'll take my chances with whether the arguments are valid. It looks like registering a custom method just puts the method info in the environment LuaTable? That contains other Lua methods too, right?
Re: Customise DialogueEntry editor window?
Posted: Wed May 07, 2025 12:20 pm
by Tony Li
Yes, you got it.
It may help to set up a
CustomLuaFunctionInfo asset and use the "..." when possible to help prevent typos.