No one could know that you had that line, because you didn't show your code. Next time you ask for help, please provide your code, because otherwise there's no way to help.DjSapsan wrote: ↑Sat May 11, 2019 6:15 pm Well, idk how it works, but i fixed.
I had this line:That line was at few lines after original problem:Code: Select all
self.world:setCallbacks(beginContact, endContact, preSolve, postSolve)
Somehow Lua interpreted "setCallbacks" at the same time as creating new world. Last line that debugger has reach was creating world! I was not expected that line after error can cause problems O_oCode: Select all
self.world = wf.newWorld(0, 0, true)
I sounds stupid but i cant explain this...
windfield/init.lua:36: attempt to call method 'collisionClear' (a nil value)
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: windfield/init.lua:36: attempt to call method 'collisionClear' (a nil value)
Re: windfield/init.lua:36: attempt to call method 'collisionClear' (a nil value)
[/quote]
No one could know that you had that line, because you didn't show your code. Next time you ask for help, please provide your code, because otherwise there's no way to help.
[/quote]
Well i was wrong one more time.
Line:
doesnt cause any error. I guess its was mess with variables. I had variable 'world' and my class was called 'World'. Maybe that names intersected with variables inside Winfield lib.
No one could know that you had that line, because you didn't show your code. Next time you ask for help, please provide your code, because otherwise there's no way to help.
[/quote]
Well i was wrong one more time.
Line:
Code: Select all
world:setCallbacks(beginContact, endContact, preSolve, postSolve)
Re: windfield/init.lua:36: attempt to call method 'collisionClear' (a nil value)
That's interesting, I thought the whole point of
`return wf`
at the end of init.lua was to encapsulate the namespace so you only have to deal with the `wf` table.
`
wf = require("windfield/windfield")
World = "bbbuh"
function love.load()
wf.newWorld(0, 0, false)
end
`
crashes, unless line 2 is commented out, then it runs fine. I wouldn't have realised this if you hadn't pointed it out, thanks.
The actual windfield repo seems to be abandonded. If you want to make sure this doesn't happen again just put declare World to be `local` in your windfield installation. or...
I'm going to quickly plug my own library, a shameless windfield ripoff which I personally prefer (https://github.com/HDictus/breezefield). I'll go through it to make sure I haven't made the same mistake and left some global variables lying around.
Breezefield doesn't currently support windfield's 'collision class' system (and I haven't yet implemented a different one), but other than that should be really easy to swap with windfield ( just change `wf=require('windfield')` to `wf.require('breezefield')`, the rest should be the same. If you do try this and encounter problems, let me know on github!)
`return wf`
at the end of init.lua was to encapsulate the namespace so you only have to deal with the `wf` table.
`
wf = require("windfield/windfield")
World = "bbbuh"
function love.load()
wf.newWorld(0, 0, false)
end
`
crashes, unless line 2 is commented out, then it runs fine. I wouldn't have realised this if you hadn't pointed it out, thanks.
The actual windfield repo seems to be abandonded. If you want to make sure this doesn't happen again just put declare World to be `local` in your windfield installation. or...
I'm going to quickly plug my own library, a shameless windfield ripoff which I personally prefer (https://github.com/HDictus/breezefield). I'll go through it to make sure I haven't made the same mistake and left some global variables lying around.
Breezefield doesn't currently support windfield's 'collision class' system (and I haven't yet implemented a different one), but other than that should be really easy to swap with windfield ( just change `wf=require('windfield')` to `wf.require('breezefield')`, the rest should be the same. If you do try this and encounter problems, let me know on github!)
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 3 guests