Can't call table values??

General discussion about LÖVE, Lua, game development, puns, and unicorns.
ThatBoiNavy
Prole
Posts: 15
Joined: Fri Jul 05, 2024 6:39 pm

Re: Can't call table values??

Post by ThatBoiNavy »

RNavega wrote: Sat Jul 20, 2024 2:12 am
ThatBoiNavy wrote: Fri Jul 19, 2024 9:09 pm I dont think the local module would matter as I haven't used local in the script.
Oh, I mean "local module" as in the module you have in your hard drive, which seems to be different than the module over in Replit's servers. Not as in "local vs global".

If you can't post the whole project for privacy reasons, maybe just attaching camera.lua so we can see how it's supposed to be initialized. As you've tried, it needs to be something different than what you had in your original script. Maybe the snippet that MrFariator shared.
just realized the code for anim8 was in camera instead of the camera.lua. I have made at least 100 mistakes in coding and this has to be the dumbest of mine... comes up with a new error however:
Error: main.lua:20: attempt to index global 'anim8' (a boolean value)
stack traceback:
[love "boot.lua"]:352: in function '__index'
main.lua:20: in function 'load'
[love "callbacks.lua"]:136: in function <[love "callbacks.lua"]:135>
[C]: in function 'xpcall'
[love "boot.lua"]:368: in function <[love "boot.lua"]:355>
[C]: in function 'xpcall'
Program completed in 7.93 seconds (pid: 11988).

Tis the life of a programer
RNavega
Party member
Posts: 385
Joined: Sun Aug 16, 2020 1:28 pm

Re: Can't call table values??

Post by RNavega »

From the error message it does find something called "anim8" and imports it, but it's not being used properly (it's returning a Boolean, like true or false, not a table or function).

My suggestion is to re-download the latest camera.lua and anim8.lua and work on an isolated demo using them, like a sanity test that they're working right. After that, you'll know what you need to make them work in your original project.
ThatBoiNavy
Prole
Posts: 15
Joined: Fri Jul 05, 2024 6:39 pm

Re: Can't call table values??

Post by ThatBoiNavy »

RNavega wrote: Sat Jul 20, 2024 7:20 pm From the error message it does find something called "anim8" and imports it, but it's not being used properly (it's returning a Boolean, like true or false, not a table or function).

My suggestion is to re-download the latest camera.lua and anim8.lua and work on an isolated demo using them, like a sanity test that they're working right. After that, you'll know what you need to make them work in your original project.
Alright I try that!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest