It is documented, just not in the wiki page for it yet - but it's in the changelog: "Updated most love.filesystem functions to return nil, error on internal failure."Dattorz wrote:There's some undocumented breakage(?) in love.filesystem.load().
LÖVE 0.9.0 released
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: LÖVE 0.9.0 released
Re: LÖVE 0.9.0 released
Hmm, so is the pcall() on love.filesystem.load still necessary? Or should users not worry about it? I'm not sure what circumstances "internal error" refers to.
Edit: Looks like it still throws an error if the loaded file has a syntax error, so I'll go ahead and put the pcall() back in.
Edit: Looks like it still throws an error if the loaded file has a syntax error, so I'll go ahead and put the pcall() back in.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: LÖVE 0.9.0 released
It basically matches the lua behaviour of "expected errors are returned", a file not found is something you'd want to check for, it happens (a lot), so returning it makes sense. A syntax error in the loaded file is (hopefully) exceptional, therefore it's a proper error.
Re: LÖVE 0.9.0 released
I really hope you will reconsider removing the seeding of math.random from the default love.run. I know there's love.math.random now but I don't really care to use it when math.random is sufficient and it's pretty ingrained in me to type that. I don't think there's anything to lose by also seeding math.random by default.
Re: LÖVE 0.9.0 released
The problem with math.random is it is not consistent over each OS, which can be hugely problematic in many cases. For example, in a multi player game, if you want to generate terrain or objects or whatever, if you use math.random each client will see different results. Using love.math.random, each client will see the same results, regardless of OS or any other factors.
You should seriously reconsider your stance of "this is how I've always done it, so everyone else should change to conform to me" and try using the vastly superior love.math.random.
You should seriously reconsider your stance of "this is how I've always done it, so everyone else should change to conform to me" and try using the vastly superior love.math.random.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: LÖVE 0.9.0 released
LuaJIT's math.random implementation isn't the same as Lua's, and it doesn't vary between OSes.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: LÖVE 0.9.0 released
Love can be built against either Lua or LuaJIT, so the problem still stands. If you use love.math.random, whether using Lua, LuaJIT, Windows, OSX, Linux, or any combinations thereof, you will have consistent results. There is absolutely no reason to do otherwise. "I don't like change" is not a valid reason to hinder progress.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: LÖVE 0.9.0 released
I've been thinking about this for a while, and then remembered that an error also gets thrown if the system runs out of memory while trying to load properties. A change in game behavior as a result of OOM is not something that would be desirable, obviously. Also, while I want to allow the game to continue running without a properties file, I can see a malformed properties file going either way - I think it would be acceptable to let a syntax error in a properties file stop the game.bartbes wrote:A syntax error in the loaded file is (hopefully) exceptional, therefore it's a proper error.
So I've decided I'm going to leave out the pcall() after all.
Re: LÖVE 0.9.0 released
Oh my god! Its really here!? (0_0)
-
- Prole
- Posts: 13
- Joined: Sat Aug 11, 2012 7:37 pm
Re: LÖVE 0.9.0 released
Thank you, guys, for your diligent work. Of all the engines and frameworks using Lua, I love LÖVE the most.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 8 guests