Issues with my world.lua file when using LDtk

Hey all, I am making my first Playdate game in Lua and am using LDtk to help build the levels. Following some advice from SquidGodDev’s tutorials, I am using precomputed levels when actually on the Playdate and not the simulator. See Below

local usePrecomputedLevels = not pd.isSimulator

ldtk.load("levels/world.ldtk", usePrecomputedLevels)

if pd.isSimulator then
    ldtk.export_to_lua_files()
end

When I build my game, I grab the LDtk_lua_levels file from the data folder and add it to my project in a levels folder. This was working great until today. Now, for some reason I keep getting errors like this where it is having trouble dealing with dialogue strings I have in my game.

If I look at the world.lua file that has been generated, it seems to be getting stuck on splitting the dialogue string between 2 lines with the ending “ coming on the next line. Note: the game builds fine and works on the simulator as long as there is not a world.lua file there. With the added file, it will not build due to the errors. I am not sure if anyone else has dealt with issues like this and I know it’s more a third party tool than official Playdate, but any help or insight would be appreciated.

Screenshot 2025-11-12 at 11.50.07 PM

Looks like one of your text fields coming from LDTK has a mix of apostrophes or quotes in it. Causing all the code to get out of whack maybe?

Thanks for the quick response. I found a few things and was able to fix it. These are things that work fine for creating worlds in LDtk but do not translate at all to that precomputed file working. Attempts to make multi-line text caused problems, as did using “ or ‘ in the text. Once I got all those removed it worked again. Things aren’t as nicely formatted now, but it works!