Hi,
I am a new developer with no experience.
While trying to make my first game, following a tutorial, this error popped up when i tried to load anim8 library.
I have put the correct path in the require section.
Can somebody help?
Thanks a lot.
(Here is the error Love gives me) (attached is the game folder)
Error
main.lua:11: module 'libs/anim8.lua' not found:
no field package.preload['libs/anim8.lua']
no 'libs/anim8/lua' in LOVE game directories.
no file 'libs/anim8/lua' in LOVE paths.
no file './libs/anim8/lua.lua'
no file '/usr/local/share/luajit-2.1/libs/anim8/lua.lua'
no file '/usr/local/share/lua/5.1/libs/anim8/lua.lua'
no file '/usr/local/share/lua/5.1/libs/anim8/lua/init.lua'
no file './libs/anim8/lua.so'
no file '/usr/local/lib/lua/5.1/libs/anim8/lua.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './libs/anim8.so'
no file '/usr/local/lib/lua/5.1/libs/anim8.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
Traceback
[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'require'
main.lua:11: in function 'load'
[love "callbacks.lua"]:136: in function <[love "callbacks.lua"]:135>
[C]: in function 'xpcall'
[C]: in function 'xpcall'
anim8
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: anim8
Use "libs.anim8" instead of "libs/anim8.lua"
require() should use dots for directories, not slashes, and the extension should be left out.
require() should use dots for directories, not slashes, and the extension should be left out.
- CleoCommunist
- Prole
- Posts: 3
- Joined: Sun Nov 10, 2024 1:11 pm
Re: anim8
Thank you, getting to work.
- CleoCommunist
- Prole
- Posts: 3
- Joined: Sun Nov 10, 2024 1:11 pm
Re: anim8
Hi again,
Sorry for the inconvenience.
I was continuing that project, and after solving another error it gave me by myself, i found another that i really couldn't solve.
It is really vague for me, i know where it is and normally can solve it by changing some punctures or capital letters.
Sorry for being stupid and new here.
Here is the error:
Error
main.lua:21: bad argument #1 to 'getWidth' (Texture expected, got no value)
Sorry for the inconvenience.
I was continuing that project, and after solving another error it gave me by myself, i found another that i really couldn't solve.
It is really vague for me, i know where it is and normally can solve it by changing some punctures or capital letters.
Sorry for being stupid and new here.
Here is the error:
Error
main.lua:21: bad argument #1 to 'getWidth' (Texture expected, got no value)
- Attachments
-
- main.lua
- (2.04 KiB) Downloaded 56 times
Re: anim8
The problem is that you used player.spritesheet.getWidth() (with a period) instead of player.spritesheet:getWidth() (with a colon).
To understand why you get that message, you have to know that when using a colon, the object before the colon (in this case player.spritesheet) is passed as an implicit first argument to the function (in this case, getWidth). The function expects the first argument to be the object to apply it to, but it finds that there's no first argument (which is what happens when you pass an empty argument list while not using a colon). Hence the error you got.
To understand why you get that message, you have to know that when using a colon, the object before the colon (in this case player.spritesheet) is passed as an implicit first argument to the function (in this case, getWidth). The function expects the first argument to be the object to apply it to, but it finds that there's no first argument (which is what happens when you pass an empty argument list while not using a colon). Hence the error you got.
Who is online
Users browsing this forum: Amazon [Bot], Bing [Bot], Google [Bot] and 8 guests