I'm making a game from Goature's tutorials, and I've had a few problems with the entities system.
It claims, among other things, that ents.Startup() in line 3 is attempting to index global 'ents', which it says is a boolean value. The code is below.
function love.load()
ents = require ("entities")
ents.Startup()
love.graphics.setBackgroundColor( 225, 225, 30 )
xCloud = 0
imageCloud = love.graphics.newImage( "textures/cloud.png" )
imageGround = love.graphics.newImage( "textures/ground.png" )
imageAfif = love.graphics.newImage( "textures/afif.png" )
imagePlayer = love.graphics.newImage( "textures/player.png" )
ents.create( "afif", 128, 128 )
end
Thanks.
Attempt to index global 'ents' (a boolean value)
-
- Prole
- Posts: 1
- Joined: Fri Jan 16, 2015 4:56 am
Re: Attempt to index global 'ents' (a boolean value)
could you post the .love?
and please use code blocks
and please use code blocks
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: Attempt to index global 'ents' (a boolean value)
It seems the file entities.lua returns a boolean.
Try to print(ents, type(ents)). It should be true/false, plus the string "boolean".
Please, share your .love.
Try to print(ents, type(ents)). It should be true/false, plus the string "boolean".
Please, share your .love.
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Attempt to index global 'ents' (a boolean value)
the problem is probably that the ents.lua doesn't return a table, i.e. the ents module;
If the tutorial was correct, then you probably left out a from the very end of that file.
If the tutorial was correct, then you probably left out a
Code: Select all
return ents -- or t or something similar
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Attempt to index global 'ents' (a boolean value)
Are you sure that the variable ents is not a GLOBAL variable?... try this:
Code: Select all
function love.load()
require ("entities")
ents.Startup()
love.graphics.setBackgroundColor( 225, 225, 30 )
xCloud = 0
imageCloud = love.graphics.newImage( "textures/cloud.png" )
imageGround = love.graphics.newImage( "textures/ground.png" )
imageAfif = love.graphics.newImage( "textures/afif.png" )
imagePlayer = love.graphics.newImage( "textures/player.png" )
ents.create( "afif", 128, 128 )
end
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Who is online
Users browsing this forum: Bing [Bot], Semrush [Bot] and 15 guests