Page 1 of 1
Custom Lua function helper not showing in Editor UI
Posted: Thu Nov 30, 2023 4:13 pm
by danieltorok
Hello!
I wanted to add a custom Lua action as a state action, however If I choose Lua -> Custom, the custom helpers are not showing in the editor. The non-custom Lua options from the drop down are all showing their associated helpers.
Picture with non-custom Lua dropdown
Picture with custom Lua dropdown
Is this not supported for custom actions?
Re: Custom Lua function helper not showing in Editor UI
Posted: Thu Nov 30, 2023 7:22 pm
by Tony Li
Re: Custom Lua function helper not showing in Editor UI
Posted: Fri Dec 01, 2023 2:59 am
by danieltorok
Hello,
Yes I did, It is even working with Dialogue System. When I say the custom Lua functions not showing I'm talking about not just mine, but the integration custom functions like PlayMaker's FSMEvent etc. There is just an empty space.
If I did the setup for Dialogue System and it is working fine there, do I need additional setup if I want to use the same custom Lua functions in Quest Machine?
Re: Custom Lua function helper not showing in Editor UI
Posted: Fri Dec 01, 2023 3:53 am
by danieltorok
So I started to debug this. I noticed a significant code duplication in LuaScriptWizard.cs . There are two variants of the method DrawScriptItem, with seemingly the same content. One is called by Quest Machine the other by Dialogue System.
The Dialogue System variant uses EditorGUILayout.BeginHorizontal() and EndHorizontal(), the Quest Machine variant uses GUI.BeginGroup() and EndGroup().
I modified the function used by Quest Machine to look like the one used by Dialogue System and it is now working, only the placement is odd.
New screenshot after aligning the two functions:
Re: Custom Lua function helper not showing in Editor UI
Posted: Fri Dec 01, 2023 8:38 pm
by Tony Li
I can confirm that Custom works with the Lua quest
condition, but not the Lua quest
action. I'll get this fixed in the next release.
In the meantime, you can get it working (but not as pretty) by commenting out these two lines in LuaScriptWizard.cs:
- Line 1088: //GUI.BeginGroup(position);
- Line 1148: //GUI.EndGroup();
The custom dropdown values will appear below the wizard section instead of in-line where they belong, but you'll be able to set them and click Apply.
Re: Custom Lua function helper not showing in Editor UI
Posted: Sat Dec 02, 2023 5:10 pm
by danieltorok
Thank you!