Page 2 of 3

Re: 3d map test

Posted: Thu Dec 15, 2011 2:47 pm
by Nixola
coffee wrote:
ok thanks, but a bit weird way Nixola.
It's the only way :P

Re: 3d map test

Posted: Thu Dec 15, 2011 5:48 pm
by bartbes
trosh wrote:I'm using 0.7
Robin wrote:I'm running the same LÖVE version, that can't be it.
Wait, how do you know? He just named 3 (!) versions!

Re: 3d map test

Posted: Thu Dec 15, 2011 7:35 pm
by Robin
bartbes wrote:Wait, how do you know? He just named 3 (!) versions!
Well to be honest I wanted to say "That can't be it."

I don't see how you can get a "tried to compare number to nil" error in one version of LÖVE and not another.

Also, I'm too lazy to look through the source to find the origin.

Re: 3d map test

Posted: Thu Dec 15, 2011 8:12 pm
by Nixola
I didn't have any error, on an Ubuntu 11.10 32 bit (with and without wine) and a Windows 7 64 bit

Re: 3d map test

Posted: Thu Dec 15, 2011 10:00 pm
by Robin
I now know how to reliably reproduce the error. First, press "e". Then simply click. The trick is not to hold it, but immediately release the mouse.

You see, in love.mousepressed, you define slct[1].x. (Awful naming, btw. What does slct even mean?).
In the next love.update, if the mouse is down, you define slct[2].x.
When the mouse is released, you compare slct[1].x to slct[2].x. All is well, unless you release the mouse before LÖVE has gotten to the next love.update. Then slct[2].x is still nil.

I know how to fix it, simply insert this in love.mousepressed, next to where you define slct[1].x and slct[1].y:

Code: Select all

		slct[2].x = x ; slct[2].y = y

Re: 3d map test

Posted: Thu Dec 15, 2011 10:15 pm
by trosh
Ooh thanks that's neat :D (should have thought of that...)
Well as usual it's really nice to see such enthusiasm around here ^^
So yeah yesterday I tried around some simple ideas for different kinds of games using this map (including being chased by a giant monster ball until you block it for more than 3 rows, it gets boring) and I'll try to make a cheap version of greed corp
I will just clean up the code for a game-ish version and post it in a while

Re: 3d map test

Posted: Thu Dec 15, 2011 11:08 pm
by trosh
ok change of plans : Right now imma go to bed and I'll do this tomorrow, when I'm on holidddayy :cry: :cry: :cry:
Also I changed the camera so that the player is as much as possible centered in the screen (btw creating your own camera is a pain)
see you fellow lövers ^^

Re: 3d map test

Posted: Thu Dec 15, 2011 11:16 pm
by trosh
Robin wrote:You see, in love.mousepressed, you define slct[1].x. (Awful naming, btw. What does slct even mean?).
What ? slct = select ! isn't that obvious ? Lol, jk I guess at the time I was like "select" → tl;dr :)

Re: 3d map test

Posted: Fri Dec 16, 2011 8:45 am
by Robin
trosh wrote:
Robin wrote:You see, in love.mousepressed, you define slct[1].x. (Awful naming, btw. What does slct even mean?).
What ? slct = select ! isn't that obvious ? Lol, jk I guess at the time I was like "select" → tl;dr :)
Ah, I was thinking too complicated again. :P

Descriptive names for variables is very useful, that way others can more easily see what you mean (and that includes yourself in 6 months ;)).

Re: 3d map test

Posted: Fri Dec 16, 2011 11:45 am
by GijsB
Robin wrote:
trosh wrote:
Robin wrote:You see, in love.mousepressed, you define slct[1].x. (Awful naming, btw. What does slct even mean?).
What ? slct = select ! isn't that obvious ? Lol, jk I guess at the time I was like "select" → tl;dr :)
Ah, I was thinking too complicated again. :P

Descriptive names for variables is very useful, that way others can more easily see what you mean (and that includes yourself in 6 months ;)).
wow Robin didn't say anything about his triple post ;)