Page 1 of 1
Error graphics.lua:1273
Posted: Fri Jul 20, 2012 1:41 am
by revolucas
I found this SDK and wanted to give it a try so I downloaded it. I followed the getting started guide. But when I try to run the tutorial I get this error no matter what I do:
Code: Select all
Error
graphics.lua:1273:Decoding error: Invalid UTF-8
Traceback
[C]: in function 'printf1'
graphics.lua:1273:in function 'printf1'
[C]: ?
[C]: in function 'require'
[C]: in function 'xpcall'
I am running the 32-bit version under Windows Vista Ultimate 64-bit.
Re: Error graphics.lua:1273
Posted: Fri Jul 20, 2012 3:45 am
by dreadkillz
Friendlier Rewording.
Welcome! Please see:
viewtopic.php?f=4&t=8760
Please post your source code/love files whenever possible for people to help you with your problems.
Re: Error graphics.lua:1273
Posted: Sat Jul 21, 2012 12:18 am
by revolucas
I've read the forum rules and also that topic before I created this thread. That 'fix' did not correct my issue so I posted. My problem was more related to SciTE and creating a text file as UTF-8 then renaming it to main.lua which was causing the issue. Thank you.
But now I have another issue and it also happens in
all example games or demos I try to play. So I won't post a .love.
When ever main.lua tries to require a different script I get errors that it cannot be found. For example calling:
Will give this error:
Code: Select all
Error
main.lua:1:module 'game.lua' not found:
no file "game/lua.lua" in LOVE game directories.
no extension 'game.lua' in LOVE paths.
etc.
Traceback
[C]:in function 'require'
main.lua:1:in main chunk
[C]:in function 'require'
[C]:in function 'xpcall'
This happens if I run
main.lua using SciTE and also if I double-click on a properly created zip file with
.love extension. For some reason it is looking into the main LOVE directory for the files when it should not be. Can anyone explain how to correct this?
EDIT
Grrr...nevermind. Apparently the extension is not needed anymore when you use require...which doesn't make any sense to me why.
Re: Error graphics.lua:1273
Posted: Sat Jul 21, 2012 1:44 am
by Qcode
The reason is in normal lua when using require the . is the same as using /. It used to be the way you described but with 0.8.0 they reverted it back to normal so it was easier for those just coming into love, who already had a background in lua.
Re: Error graphics.lua:1273
Posted: Sat Jul 21, 2012 5:30 am
by Boolsheet
revolucas wrote:[...] which doesn't make any sense to me why.
require isn't just used for loading lua files, it also loads binary modules with .dll or .so extension. Giving only the name of the module makes it more portable and Lua can resolve and search for the extensions itself. See
package.path for controlling the behaviour (The LÖVE loaders for the game and save directory do not use this variable though).