Lua load function seems to expect a second argument. Why?

I just ran across this thread, as I'm in the process of fleshing out a LDtk project for an untitled RPG in-progress... and thought it would be (very) useful to let our designer put Lua code in LDtk Entity attributes (think things like in-LDtk item/quest scripting). The implementation would have relied heavily on Lua's 'loadstring' being present/supported by the Playdate Lua runtime, but if I'm reading all of the above correctly that won't just not work correctly on hardware, but will never work, on purpose?

Is that the case? If so, I'll probably have to roll my own mini-language+interpreter (was hoping to avoid that, if possible :wink: ).

I mean you could theoretically precompile the code as a PDZ and stick that in the entity attributes, but otherwise, yeah, there's no compiler in the device firmware so your approach wouldn't work.

edit: unless you had the filename of a PDZ to pass to

1 Like

Yeah, no, that won't get me where I need to go (thanks, though!).

Wow, that came out as poetry... completely accidentally.

What I'm shooting for is something like a quest script for Elder Scrolls IV: Oblivion, that the designer can just enter as plain text (actually, a 'multi-lines of type Lua' in LDtk) attached to an Entity in the world editor, I was hoping I could wrap 'loadtext' to produce an analogue on Playdate.

Guess I'll have to go back the drawing board :slight_smile: