Scripting Language extensions via plugins

There’s some scripting language related stuff on the roadmap for december, but they’re being very vague as usual…

Hi, i try to build the lua Script, i had build the lua.sln and have lib in Lib\Release\win32(win64), but when i build the ue4.sln , have link error like:void __cdecl LuaRegisterExportedClasses(struct lua_State *)" (?LuaRegisterExportedClasses@@YAXPEAUlua_State@@@Z), public: virtual bool __cdecl FLuaContext::Initialize(class FString const &,class UObject *)" (?Initialize@FLuaContext@@UEAA_NAEBVFString@@PEAVUObject@@@Z)

i also check the GeneratedScriptLibraries.inl file , it not exit my folder. what happen?

you can try my plugin,It works. https://github.com/asqbtcupid/unreal.lua/tree/demo_firstperson_umg

hi.I have the same error.I debuged the UHT and I fond the ScriptGeneraterPlugin.dll is not properly loaded by UHT because the dll name is not proper for the UHT style.UHT load dll use the name likely AAA-Win64-Debug.dll,but my ScriptGeneraterPlugin.dll is auto generated named not UHT style.have you solve the error?

I just tried to get this to build too… noticed a few things:

  • You need to use a game project that you created with a source built engine, the UE4 solution itself does not work
  • It seems hard to get the UHT plugin to actually compile. You need to rebuilt UHT and then build your game project for it to notice it
  • It does generate lua bindings, but they are not included anywhere for some reason… I added them in ScriptPlugin.cpp at the bottom
  • The generated lua bindings are quite out of date and don’t compile due to changes in the engine

Oh,that is to say we can not use lua in ue4 any more,bad news.do you use any other script language for ue4 now?

It’s not that we can’t use lua anymore, just the example lua plugin is a bit broken at the moment. You’ll have to make your own, or maybe try the one 4 posts up

the problem is :there are so many functions need to be exported to lua,but i don’t know how to export by tools,it is impossible to make it one by one.

@ - Is there any trick to getting script-defined functions to show up in the actions/suggestions/right-click list in Blueprint graphs?

I’ve verified that CreateScriptDefinedFunction gets called in FScriptBlueprintCompiler::CreateFunctionList and everything seems to be working fine, but no matter what I do the generated functions won’t show up in the actions list in any graph editor (with or without context-sensitivity).

Are functions added through CreateFunctionContext() supposed to show up in the actions list just like normal UFUNCTION’s?

I’m on UE 4.17.1, if that matters.