I need help with loading lua files (my brain cannot comprehend the wiki)
Posted: Mon Jan 01, 2024 3:18 am
So I'm really new to love2d, and tried goofing around with loading files and the sort, but when I tried loading and running this lua file, I got this error:
Error
main.lua:35: attempt to call global 'GAME_START' (a nil value)
Traceback
[love "callbacks.lua"]:228: in function 'handler'
main.lua:35: in function 'update'
[love "callbacks.lua"]:162: in function <[love "callbacks.lua"]:144>
[C]: in function 'xpcall'
Armed with the line where the error occurred, I changed the variable that could be described as pointing to a function with the arguments filled out into a fully defined function (its lines 33-35 now, also I'm a little perplexed on why the little variable thingy I originally tried didn't work, but nonetheless), with there still being a line right after it that calls the function that loads the lua file. When I tried this, I didn't see a blue error screen, from that, I was hoping that the lua file would end up running, but of course, it didn't. I'm just trying to learn how to load files and stuff at this point because thats gonna be like the most important thing if I'm gonna use this a lot. I honestly just need help on how this sort of stuff works and how I messed up and then I'll be on my merry way
Error
main.lua:35: attempt to call global 'GAME_START' (a nil value)
Traceback
[love "callbacks.lua"]:228: in function 'handler'
main.lua:35: in function 'update'
[love "callbacks.lua"]:162: in function <[love "callbacks.lua"]:144>
[C]: in function 'xpcall'
Armed with the line where the error occurred, I changed the variable that could be described as pointing to a function with the arguments filled out into a fully defined function (its lines 33-35 now, also I'm a little perplexed on why the little variable thingy I originally tried didn't work, but nonetheless), with there still being a line right after it that calls the function that loads the lua file. When I tried this, I didn't see a blue error screen, from that, I was hoping that the lua file would end up running, but of course, it didn't. I'm just trying to learn how to load files and stuff at this point because thats gonna be like the most important thing if I'm gonna use this a lot. I honestly just need help on how this sort of stuff works and how I messed up and then I'll be on my merry way