Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this .
subtledemise
Prole
Posts: 6 Joined: Tue Dec 10, 2013 1:34 am
Post
by subtledemise » Fri Dec 13, 2013 4:16 pm
On one of my tables, I get a syntax error when I try to test run my game. The error is as follows:
The table in question looks like this:
Code: Select all
enemies = {
bat = require "enemy/bat"
bigworm = require "enemy/bigworm"
eyeball = require "enemy/eyeball"
ghost = require "enemy/ghost"
flower = require "enemy/flower"
pumpking = require "enemy/pumpking"
slime = require "enemy/slime"
smallworm = require "enemy/smallworm"
snake = require "enemy/snake"
}
Attached a .love also.
Attachments
aRPG.love
(93.98 KiB) Downloaded 74 times
bekey
Party member
Posts: 255 Joined: Tue Sep 03, 2013 6:27 pm
Post
by bekey » Fri Dec 13, 2013 4:22 pm
-snip-
Last edited by
bekey on Fri Jan 24, 2014 1:56 am, edited 1 time in total.
subtledemise
Prole
Posts: 6 Joined: Tue Dec 10, 2013 1:34 am
Post
by subtledemise » Fri Dec 13, 2013 4:26 pm
Of course, I always miss the simplest things. Thanks so much!
subtledemise
Prole
Posts: 6 Joined: Tue Dec 10, 2013 1:34 am
Post
by subtledemise » Fri Dec 13, 2013 4:43 pm
Sorry to double post, but I have a new issue and don't want to make another thread for something that's also quite simple to solve that I'm just missing, but now I get an error saying
main.lua:36: attempt to index field 'slime' (a boolean value)
bekey
Party member
Posts: 255 Joined: Tue Sep 03, 2013 6:27 pm
Post
by bekey » Fri Dec 13, 2013 4:45 pm
-snip-
Last edited by
bekey on Fri Jan 24, 2014 1:56 am, edited 1 time in total.
Jasoco
Inner party member
Posts: 3726 Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:
Post
by Jasoco » Fri Dec 13, 2013 10:35 pm
bekey wrote: Code: Select all
enemies = {
bat = require "enemy/bat",
bigworm = require "enemy/bigworm",
eyeball = require "enemy/eyeball",
ghost = require "enemy/ghost",
flower = require "enemy/flower",
pumpking = require "enemy/pumpking",
slime = require "enemy/slime",
smallworm = require "enemy/smallworm",
snake = require "enemy/snake"
}
notice the comma after every entry except last
The best part is Lua is flexible enough to not care if the last one has a comma too.
Users browsing this forum: Bing [Bot] , Google [Bot] and 2 guests