I'm making a simple simulation, rewriting an old version because mainly my old code was junk even though it worked. Right now, I've just programmed food splotches to appear on the ground.
My problem is that love.draw() seems to get called in the middle of making the x and y coordinates for the splotches, resulting in the x coordinate being created, but not the y. Again, I'm not exactly sure that is what's happening, but it's the only way I can seem to explain it.
Here's the .love and main.lua and food.lua. Right click to crash and see the error message.
expected number, got nil
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
expected number, got nil
- Attachments
-
- food.lua
- (3.16 KiB) Downloaded 114 times
-
- main.lua
- (879 Bytes) Downloaded 96 times
-
4th Gen 30.love
- (1.67 KiB) Downloaded 110 times
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: expected number, got nil
agents.lua not here
Re: expected number, got nil
Neither is path.lua, but that doesn't really matter. No functions are called from agents or path. LOVE didn't throw me any errors about missing either of those files, but you could just create two empty files of the same name if you wanted to try that.Ranguna259 wrote:agents.lua not here
Re: expected number, got nil
You HAVE to have a lua file if you're going to require it. Even if you won't use it's functions.
Github: https://github.com/chroteus
Re: expected number, got nil
Well I added the lua files for you guys, and it still doesn't work, so if we could get back to the original problem, that would be great.Chroteus wrote:You HAVE to have a lua file if you're going to require it. Even if you won't use it's functions.
- Attachments
-
4th Gen 31 all 4 files.love
- (2.71 KiB) Downloaded 100 times
Re: expected number, got nil
First off all, the other guys asked for the missing .lua files, because they are needed to reproduce your error.
And here is your solution:
You made a typo in line 44 in food.lua
is incorrect. The correct line is this (with a capital P)
And here is your solution:
You made a typo in line 44 in food.lua
Code: Select all
yposition = ypos,
Code: Select all
yposition = yPos,
Check out my blog on gamedev
Re: expected number, got nil
Wow, thanks. The SciTE editor font makes 'p' and 'P' look almost exactly the same.micha wrote:First off all, the other guys asked for the missing .lua files, because they are needed to reproduce your error.
And here is your solution:
You made a typo in line 44 in food.luais incorrect. The correct line is this (with a capital P)Code: Select all
yposition = ypos,
Code: Select all
yposition = yPos,
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: expected number, got nil
I recommend notepad++ for programming editing, you can select multiple locations to type among other features, it's only for windows though
Who is online
Users browsing this forum: Bing [Bot] and 4 guests