If use lua, ScriptPlugin will error in HTML5

there is part of error.

LogPlayLevel:Display: UnrealBuildTool: In file included from J:/C++/UnrealEngine-4.6.1/Engine/Intermediate/Build/HTML5/MeshViewer/Development/Plugins/Static/ScriptPlugin/Module.ScriptPlugin.cpp:9:
LogPlayLevel:Display: UnrealBuildTool: In file included from J:/C++/UnrealEngine-4.6.1/Engine/Plugins/ScriptPlugin/Source/ScriptPlugin/Private/ScriptPlugin.cpp:19:
LogPlayLevel:Display: UnrealBuildTool: In file included from …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/GeneratedScriptLibraries.inl:578:
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:3:27: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_GetActorClass(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:18:33: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_GetComponentByClass(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:35:28: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_ForceNetUpdate(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:43:32: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_K2_OnEndViewTarget(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:57:35: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_K2_OnBecomeViewTarget(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:71:30: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_FlushNetDormancy(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:79:22: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_GetOwner(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:94:38: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_OnRep_ReplicatedMovement(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:102:30: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_ReceiveDestroyed(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:110:36: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_UserConstructionScript(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:118:25: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_GetLifeSpan(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:133:25: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_SetLifeSpan(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:147:26: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_ReceiveInput(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:160:24: error: use of undeclared identifier ‘FLuaVector’
LogPlayLevel:Display: UnrealBuildTool: Params.VectorValue = (FLuaVector::Get(InScriptContext, 4));
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:169:36: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_ReceiveActorOnReleased(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:177:35: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_ReceiveActorOnClicked(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:185:39: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_ReceiveActorEndCursorOver(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:193:41: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_ReceiveActorBeginCursorOver(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: …/…/…/…/Unreal Project/MeshViewer/Intermediate/Build/HTML5/MeshViewer/Inc/ScriptPlugin/Actor.script.h:201:36: error: unknown type name ‘lua_State’
LogPlayLevel:Display: UnrealBuildTool: int32 Actor_ReceiveActorEndOverlap(lua_State* InScriptContext)
LogPlayLevel:Display: UnrealBuildTool: ^
LogPlayLevel:Display: UnrealBuildTool: fatal error: too many errors emitted, stopping now [-ferror-limit=]
LogPlayLevel:Display: UnrealBuildTool: 20 errors generated.
LogPlayLevel:Display: UnrealBuildTool: ERROR root: compiler frontend failed to generate LLVM bitcode, halting
LogPlayLevel:Display: UnrealBuildTool: -------- End Detailed Actions Stats -----------------------------------------------------------
LogPlayLevel:Display: UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: J:\C++\UnrealEngine-4.6.1\Engine\Plugins\ScriptPlugin\Binaries\HTML5\MeshViewer-ScriptPlugin-Static.bc
LogPlayLevel:Display: UnrealBuildTool: Cumulative action seconds (8 processors): 0.00 building projects, 66.89 compiling, 0.00 creating app bundles, 0.00 generating debug info, 2.17 linking, 0.00 other
LogPlayLevel:Display: UnrealBuildTool: UBT execution time: 37.02 seconds
LogPlayLevel:Display: CommandUtils.Run: Run: Took 37.1591254s to run UnrealBuildTool.exe, ExitCode=2
LogPlayLevel:Display: ErrorReporter.Error: ERROR: AutomationTool error: Command failed (Result:2): J:\C++\UnrealEngine-4.6.1\Engine\Binaries\DotNET\UnrealBuildTool.exe MeshViewer HTML5 Development “J:\Unreal Project\MeshViewer\MeshViewer.uproject” -noxge. See logfile for details: ‘UnrealBuildTool.txt’
LogPlayLevel:Display: BuildCommand.Execute: ERROR: BUILD FAILED
LogPlayLevel:Display: Program.Main: ERROR: AutomationTool terminated with exception:
LogPlayLevel:Display: Program.Main: ERROR: Exception in AutomationTool: Command failed (Result:2): J:\C++\UnrealEngine-4.6.1\Engine\Binaries\DotNET\UnrealBuildTool.exe MeshViewer HTML5 Development “J:\Unreal Project\MeshViewer\MeshViewer.uproject” -noxge. See logfile for details: ‘UnrealBuildTool.txt’
LogPlayLevel:Display: Stacktrace: ?? AutomationTool.CommandUtils.RunAndLog(String App, String CommandLine, String Logfile, Int32 MaxSuccessCode, String Input, ERunOptions Options)
LogPlayLevel:Display: ?? AutomationTool.CommandUtils.RunUBT(CommandEnvironment Env, String UBTExecutable, String CommandLine, String LogName)
LogPlayLevel:Display: ?? AutomationTool.UE4Build.BuildWithUBT(String ProjectName, String TargetName, UnrealTargetPlatform TargetPlatform, String Config, String UprojectPath, Boolean ForceMonolithic, Boolean ForceNonUnity, Boolean ForceDebugInfo, Boolean ForceFlushMac, Boolean DisableXGE, String InAddArgs, Boolean ForceUnity)
LogPlayLevel:Display: ?? AutomationTool.UE4Build.Build(BuildAgenda Agenda, Nullable1 InDeleteBuildProducts, Boolean InUpdateVersionFiles, Boolean InForceNoXGE, Boolean InForceNonUnity, Boolean InForceUnity) LogPlayLevel:Display: ?? Project.Build(BuildCommand Command, ProjectParams Params, Int32 WorkingCL) LogPlayLevel:Display: ?? BuildCookRun.DoBuildCookRun(ProjectParams Params) LogPlayLevel:Display: ?? BuildCommand.Execute() LogPlayLevel:Display: ?? AutomationTool.Automation.Execute(List1 CommandsToExecute, CaselessDictionary`1 Commands)
LogPlayLevel:Display: ?? AutomationTool.Automation.Process(String[] CommandLine)
LogPlayLevel:Display: ?? AutomationTool.Program.MainProc(Object Param)
LogPlayLevel:Display: ?? AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param)
LogPlayLevel:Display: ?? AutomationTool.Program.Main()
LogPlayLevel:Display: Program.Main: ERROR: Command failed (Result:2): J:\C++\UnrealEngine-4.6.1\Engine\Binaries\DotNET\UnrealBuildTool.exe MeshViewer HTML5 Development “J:\Unreal Project\MeshViewer\MeshViewer.uproject” -noxge. See logfile for details: ‘UnrealBuildTool.txt’
LogPlayLevel:Display: ProcessManager.KillAll: Trying to kill 0 spawned processes.
LogPlayLevel:Display: Program.Main: AutomationTool exiting with ExitCode=2
LogPlayLevel:Display: Domain_ProcessExit
LogPlayLevel:Display: ProcessManager.KillAll: Trying to kill 0 spawned processes.
LogPlayLevel:Display: copying UAT log files…
LogPlayLevel:Display: RunUAT.bat ERROR: AutomationTool was unable to run successfully.
LogPlayLevel:Display: BUILD FAILED
PackagingResults:Error: Error Launch failed! Invalid Arguments

Hi damody,

Did this produce a crash log? If so can you post it here? These can be found in the filepath \Unreal Projects\PROJECTNAME\saved\logs. Additionally, does this occur in a blank project with no additional content?

this is my compile error log.
link text

Hi damody,

Have you had a look at this forum thread? Manusewzki created the ScriptPlugin and gives information on how to go about getting his Lua proof of concept working.

If this does not help please let me know and I’ll be more than happy to continue trying to assist.

Hi damody,

We have not heard from you in quite some time. I am marking this thread as answered for tracking purposes, if you are still experiencing this error, please comment with the requested information.

Hi ,

Yes I modify ue4 code to pass this problem
and compile lua to liblua.bc for html5.
but final I get runtime error in lua coroutine function.
I use “mingw, win32, pthread” setting to compiled lua.
I think maybe thread model in html5 has problem.
Maybe we need modify lua and make lua prebuilt library.

Happy new year~

I think I find the method, it’s fine.
I will post the answer to he’s thread.