We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to run a simple script using LuaMachine but it keeps crashing.
FLuaValue Result = LuaState->RunString(TEXT("print('LuaMachine initialized in SampleGameActor!')"), TEXT("SampleGameTest"));
RunString has two arguments. Does the second one have to be the name of a LuaCode asset?
Or am I doing something that's just not meant to work?
Thanks!
The text was updated successfully, but these errors were encountered:
Hi, how you are creating the LuaState?
Sorry, something went wrong.
Thanks Roberto, I did suspect the initialization was not right.
void ASampleGameActor::BeginPlay() { Super::BeginPlay(); LuaState = NewObject<ULuaState>(this, ULuaState::StaticClass(), FName("SampleLuaState")); if (LuaState) { // Test Lua execution FString TestScript = TEXT("print('LuaMachine initialized in SampleGameActor!')"); RunLuaScript(TestScript); } }
Yes, you cannot initialize states in that way. The first step is inheriting from ULuaState (it is an abstract class). If you want to create multiple states dinamically use the luau branch and follow the various provided unit tests: https://github.com/rdeioris/LuaMachine/tree/luau/Source/LuaMachineEditor/Private/Tests
Otherwise follow the classic path and just use the functiona library: https://github.com/rdeioris/LuaMachine/blob/master/Source/LuaMachine/Public/LuaBlueprintFunctionLibrary.h
No branches or pull requests
I'm trying to run a simple script using LuaMachine but it keeps crashing.
FLuaValue Result = LuaState->RunString(TEXT("print('LuaMachine initialized in SampleGameActor!')"), TEXT("SampleGameTest"));
RunString has two arguments. Does the second one have to be the name of a LuaCode asset?
Or am I doing something that's just not meant to work?
Thanks!
The text was updated successfully, but these errors were encountered: