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?
Custom Lua function helper not showing in Editor UI
-
- Posts: 11
- Joined: Tue Nov 28, 2023 9:36 am
-
- Posts: 11
- Joined: Tue Nov 28, 2023 9:36 am
Re: Custom Lua function helper not showing in Editor UI
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?
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?
-
- Posts: 11
- Joined: Tue Nov 28, 2023 9:36 am
Re: Custom Lua function helper not showing in Editor UI
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:
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
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:
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();
-
- Posts: 11
- Joined: Tue Nov 28, 2023 9:36 am