Search found 70 matches

by unixfreak
Thu Feb 28, 2019 6:14 pm
Forum: Support and Development
Topic: Shaders: having trouble porting existing shaders
Replies: 2
Views: 1943

Re: Shaders: having trouble porting existing shaders

Many thanks for all of that information, sorry for the late reply. This will be very useful to me, although, i think i'm going to go and look at GLSL shaders to try and understand things more about how shaders are generally put together. Your shader example does work, although i'm not sure how to im...
by unixfreak
Sat Feb 09, 2019 9:55 pm
Forum: Support and Development
Topic: Shaders: having trouble porting existing shaders
Replies: 2
Views: 1943

Shaders: having trouble porting existing shaders

I've been digging through the net looking at simple shaders on websites such as shadertoy and others. Trying to implement those examples into a love project to understand things; however they never seem to work and i get all kinds of errors, or broken/visual changes when applied. Even with shaders t...
by unixfreak
Wed Aug 15, 2018 3:49 pm
Forum: Support and Development
Topic: [SOLVED] How can i rewind a sound source, now that love.audio.rewind(source) has been removed?
Replies: 2
Views: 348

Re: [SOLVED] How can i rewind a sound source, now that love.audio.rewind(source) has been removed?

Found a solution... turns out it was quite simple. Now it seems :stop() on an audio source automatically rewinds. Solved.

Code: Select all

function sound:play(fx)
	fx:stop()
	fx:play()
end
by unixfreak
Wed Aug 15, 2018 3:29 pm
Forum: Support and Development
Topic: [SOLVED] How can i rewind a sound source, now that love.audio.rewind(source) has been removed?
Replies: 2
Views: 348

[SOLVED] How can i rewind a sound source, now that love.audio.rewind(source) has been removed?

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...
by unixfreak
Tue Aug 14, 2018 10:04 pm
Forum: Support and Development
Topic: [SOLVED] Handling error exceptions for assert(loadstring(str))() ?
Replies: 8
Views: 660

Re: [SOLVED] Handling error exceptions for assert(loadstring(str))() ?

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 unixfreak
Tue Aug 14, 2018 9:55 pm
Forum: Support and Development
Topic: [SOLVED] Handling error exceptions for assert(loadstring(str))() ?
Replies: 8
Views: 660

Re: Handling error exceptions for assert(loadstring(str))() ?

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 =...
by unixfreak
Tue Aug 14, 2018 9:46 pm
Forum: Support and Development
Topic: [SOLVED] Handling error exceptions for assert(loadstring(str))() ?
Replies: 8
Views: 660

Re: Handling error exceptions for assert(loadstring(str))() ?

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...
by unixfreak
Tue Aug 14, 2018 9:33 pm
Forum: Support and Development
Topic: [SOLVED] Handling error exceptions for assert(loadstring(str))() ?
Replies: 8
Views: 660

Re: Handling error exceptions for assert(loadstring(str))() ?

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...
by unixfreak
Tue Aug 14, 2018 8:54 pm
Forum: Support and Development
Topic: [SOLVED] Handling error exceptions for assert(loadstring(str))() ?
Replies: 8
Views: 660

[SOLVED] Handling error exceptions for assert(loadstring(str))() ?

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...
by unixfreak
Mon Aug 06, 2018 12:23 am
Forum: Support and Development
Topic: [Solved] Exit love.keypressed() function
Replies: 1
Views: 232

Re: Exit love.keypressed() function? Cannot figure this out

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!