Weird execution stop with nested luaj function calls #109

Closed
opened 2023-02-13 20:48:00 +00:00 by UltraBlackLinux · 0 comments
UltraBlackLinux commented 2023-02-13 20:48:00 +00:00 (Migrated from github.com)

Hey there,
I'm currently working on a library that exposes some features of a game to lua scripts.
The issue that I'm facing somehow has to do with my custom luaj library. Whenever I call a function from my library (weirdly enough not my custom print though), luaj just stops executing all the following lines.
I already tried removing \ns from the input string, but that sadly did not solve anything.
Does anyone have an idea, what could be the problem here? LuaJ does not appear to throw any errors when it stops.

The library is assembled here: https://chonkyrabbit.eu/git/luaprocessors.git/tree/src/luaprocessors/lua/LuaExecutor.java#n151
The code gets executed here: https://chonkyrabbit.eu/git/luaprocessors.git/tree/src/luaprocessors/lua/LuaExecutor.java#n66

Just for completeness, here an example snippet:

print(mindustry.env.getTick())
mindustry.world.io.message.print("message1", mindustry.env.getTick()) # Not executed
print("test") # Not executed

Can anyone explain this?
Thanks!

Edit: I found a weird edge-case (which works)

v = mindustry.env.getTick()
mindustry.world.io.message.print("message1", v)
print(v)
Hey there, I'm currently working on a library that exposes some features of a game to lua scripts. The issue that I'm facing somehow has to do with my custom luaj library. Whenever I call a function from my library (weirdly enough not my custom `print` though), luaj just stops executing all the following lines. I already tried removing `\n`s from the input string, but that sadly did not solve anything. Does anyone have an idea, what could be the problem here? LuaJ does not appear to throw any errors when it stops. The library is assembled here: https://chonkyrabbit.eu/git/luaprocessors.git/tree/src/luaprocessors/lua/LuaExecutor.java#n151 The code gets executed here: https://chonkyrabbit.eu/git/luaprocessors.git/tree/src/luaprocessors/lua/LuaExecutor.java#n66 Just for completeness, here an example snippet: ```lua print(mindustry.env.getTick()) mindustry.world.io.message.print("message1", mindustry.env.getTick()) # Not executed print("test") # Not executed ``` Can anyone explain this? Thanks! Edit: I found a weird edge-case (which works) ```lua v = mindustry.env.getTick() mindustry.world.io.message.print("message1", v) print(v) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-autonomous-connection/luaj#109