Error graphics.lua:1273

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.
Post Reply
revolucas
Prole
Posts: 2
Joined: Fri Jul 20, 2012 1:30 am

Error graphics.lua:1273

Post 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.
User avatar
dreadkillz
Party member
Posts: 223
Joined: Sun Mar 04, 2012 2:04 pm
Location: USA

Re: Error graphics.lua:1273

Post 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.
revolucas
Prole
Posts: 2
Joined: Fri Jul 20, 2012 1:30 am

Re: Error graphics.lua:1273

Post 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:

Code: Select all

require "game.lua"
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.
User avatar
Qcode
Party member
Posts: 170
Joined: Tue Jan 10, 2012 1:35 am

Re: Error graphics.lua:1273

Post 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.
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Error graphics.lua:1273

Post 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).
Shallow indentations.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests