Search found 1629 matches

by pgimeno
Tue May 14, 2019 4:26 pm
Forum: Support and Development
Topic: [SOLVED] getDirectoryItems() and getInfo()
Replies: 9
Views: 838

Re: getDirectoryItems() and getInfo()

It doesn't return an empty table, but you have to iterate over the table with pairs(), not with ipairs(), because it doesn't use integer indices.

In the github page you linked, it used ipairs.
by pgimeno
Sat May 11, 2019 10:52 pm
Forum: Support and Development
Topic: windfield/init.lua:36: attempt to call method 'collisionClear' (a nil value)
Replies: 12
Views: 1921

Re: windfield/init.lua:36: attempt to call method 'collisionClear' (a nil value)

Well, idk how it works, but i fixed. I had this line: self.world:setCallbacks(beginContact, endContact, preSolve, postSolve) That line was at few lines after original problem: self.world = wf.newWorld(0, 0, true) Somehow Lua interpreted "setCallbacks" at the same time as creating new world. Last li...
by pgimeno
Fri May 10, 2019 6:52 pm
Forum: Support and Development
Topic: windfield/init.lua:36: attempt to call method 'collisionClear' (a nil value)
Replies: 12
Views: 1921

Re: windfield/init.lua:36: attempt to call method 'collisionClear' (a nil value)

I tried this:

Code: Select all

local wf = require 'windfield'
world = wf.newWorld(0, 0, true)
No error.

It's not possible for anyone to help any further without seeing the code that leads to the situation that you're describing. If you don't want to provide it, you'll have to deal with it by yourself.
by pgimeno
Fri May 10, 2019 6:01 pm
Forum: Support and Development
Topic: How to send email via smtp?
Replies: 2
Views: 371

Re: How to send email via smtp?

luasocket does not support SSL.

That aside, I for one abhor the practice of sending things without the user's consent, even worse behind the user's back.
by pgimeno
Fri May 10, 2019 9:42 am
Forum: Support and Development
Topic: Canvas and shader coordinate weirdness
Replies: 2
Views: 313

Re: Canvas and shader coordinate weirdness

My best guess is that rendering to a canvas does not flip, because otherwise, when rendering the canvas to the screen it would be flipped twice. Since flipping inverts the sign of the cross product, the winding needs to be changed in order for the polygons to be drawn at all when drawing to the canv...
by pgimeno
Fri May 10, 2019 2:12 am
Forum: Support and Development
Topic: windfield/init.lua:36: attempt to call method 'collisionClear' (a nil value)
Replies: 12
Views: 1921

Re: windfield/init.lua:36: attempt to call method 'collisionClear' (a nil value)

world = wf.newWorld(0, 0, true) When I try that, I get this error instead: Error: main.lua:1: attempt to index global 'wf' (a nil value) stack traceback: [string "boot.lua"]:637: in function '__index' main.lua:1: in main chunk [C]: in function 'require' [string "boot.lua"]:475: in function <[string...
by pgimeno
Thu May 09, 2019 9:05 pm
Forum: Support and Development
Topic: saving a canvas as an image
Replies: 15
Views: 2934

Re: saving a canvas as an image

Beware that the os.rename() method may not work if the destination is in a different filesystem. I'm not sure it will work for example with an SD card on Android.
by pgimeno
Wed May 08, 2019 1:42 pm
Forum: General
Topic: [SOLVED] Spawning/instantiating several objects on a grid
Replies: 6
Views: 766

Re: [HELP] Spawning/instantiating several objects on a grid

Poisson discs. It might not be suitable for this application: it only generates points directly next to existing points. You're describing more or less what a dense Poisson disc distribution does, but it doesn't need to be dense. See e.g. https://staffwww.dcs.shef.ac.uk/people/S.Maddock/research/ga...
by pgimeno
Wed May 08, 2019 11:05 am
Forum: Support and Development
Topic: How to do a one-off collision?
Replies: 3
Views: 345

Re: How to do a one-off collision?

Have a variable 'door_collided' which is set to false at the beginning of the level. Check for collision only when it is false. Set it to true when the player collides with the door.
by pgimeno
Tue May 07, 2019 11:25 pm
Forum: Support and Development
Topic: random number without duplicate [SOLVED]
Replies: 6
Views: 408

Re: random number without duplicate

(@Nelvin - Don't miss my last edit)