Hi, tried searching, and fiddling about but cannot find a way to do this. As per; https://love2d.org/wiki/love.audio.rewind (which is now removed since 11.0) An example why i'd like to find a way to do this; a player can collect a series of pickups (coins, gems or whatever), which all use the same s...

Yeah, you missed returning the value for pcall: pcall(function() return assert(... Edit: also, you missed the second argument, now that I look closer. The first argument is always a boolean. That was probably the problem. Yeah, looking at that now, i see that is the case. Can't thank you enough for...

By the way, i posted to soon about this being solved, whilst it didn't crash on invalid syntax, it did crash when the syntax was valid (something about expecting string/boolean error). You probably don't want to use assert , as that would need more layers of error handling. Try this: local fn, err =...

Oh nevermind, i just got this working; local out = pcall(function() assert(loadstring(console.command))() end) if out then console:print(out) else console:print("ERROR: invalid lua snytax!") end This works! Thanks for reminding me of pcall, i gave up the other day trying to solve this, but misunders...

Looks like a job for pcall . Hi, thanks for replying. I previously looked up that function, but can't understand how i would use it here. How would i go about using pcall for this snippet? local out = assert(loadstring(console.command))() console:print(out) I have tried something such as: local out...

I am trying to add scriptable lua to a console as part of a game, for example to change variables quickly or run custom lua code to edit levels etc. I have figured out i can use something like this: local out = assert(loadstring(console.command))() Where the console uses text input to supply the con...

Derp. Ignore this post... i had some keypress input that was placed in some update() functions... hence they were triggering keypresses outside of the love.keypressed() function... I ended up wrapping the keyboard related code in a block like: if not console.active then -- blah blah end Solved!

Can anyone explain why this doesn't work? function love.keypressed(key) if console.active then console:keypressed(key) return -- <---should exit function here end player:keypressed(key) --[[ other code etc.... than should only be run when console.active = false --]] end The problem is that the line ...