My game worked perfectly fine in 0.7.2, but trying to run it in 0.8.0 with requires on top doesn't work.
require 'maps/level1.lua'
require 'maps/level2.lua'
require 'lib/direction.lua'
require 'lib/hero.lua'
require 'lib/quad_make.lua'
require 'lib/game.lua'
require 'lib/Box_Map.lua'
require 'lib/box.lua'
require 'lib/stage.lua'
require 'lib/End_Points.lua'
require 'lib/Main_Menu.lua'
require 'lib/Pause_Menu.lua'
require 'conf.lua'
require 'config/debug.lua'
I get the following error from attachement.
It seems to be a problem only when using 'require'. I tested this out by making a simple game with a movable character and it works fine. But once I add in some 'require' files I get the error. I'm guessing 0.8.0 uses a different method to call in external lua files, but what?
'require' not working in 0.8.0
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Puzzlem00n
- Party member
- Posts: 171
- Joined: Fri Apr 06, 2012 8:49 pm
- Contact:
Re: 'require' not working in 0.8.0
Just remove the .lua in all the requires. Should work.
I LÖVE, therefore I am.
Re: 'require' not working in 0.8.0
Thanks that worked. Is there any other big change from 0.7.2 to 0.8.0? I know about pixel shaders but that anything else?
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: 'require' not working in 0.8.0
I'd like to take this moment to fix your requires more, the slashes should be replaced by dots.
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: 'require' not working in 0.8.0
I didn't know that syntax was even working...
Code: Select all
require 'foo.lua'
By the way, is there really a difference calling require with dots instead of slashes...?
Code: Select all
require 'folder.script'
require 'folder/script'
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: 'require' not working in 0.8.0
This:Roland_Yonaba wrote:Is it related to the way OS filesystem paths are handled ? ...Fact is, I am working under Windows, and both of them works as well.
Code: Select all
require 'folder.script'
On the other hand this:
Code: Select all
require 'folder/script'
So, the recommendation is using dots, not slashes.
When I write def I mean function.
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: 'require' not working in 0.8.0
Cool, thanks doe the replies. I'll make the changes later and test them. Did'nt know about using dots instead of slashes for file locations.
Who is online
Users browsing this forum: Google [Bot], Semrush [Bot] and 6 guests