Search found 6 matches

by masakk1
Sun Feb 02, 2025 1:24 am
Forum: Support and Development
Topic: Cannot require modules with init.lua
Replies: 9
Views: 2439

Re: Cannot require modules with init.lua

Well uhh... I don't really know what I did wrong before, but yeah, it works.

Thanks! :)
by masakk1
Sun Feb 02, 2025 1:08 am
Forum: Support and Development
Topic: Cannot require modules with init.lua
Replies: 9
Views: 2439

Re: Cannot require modules with init.lua

What does your parse_args function do? It just reads the args and whether or not there is a `--server` flag, then set the variable isServer to true. local function parse_args(args) for i, arg in pairs(args) do if arg == "--server" or arg == "-s" then _G.isServer = true elseif ar...
by masakk1
Sun Feb 02, 2025 1:04 am
Forum: Support and Development
Topic: Cannot require modules with init.lua
Replies: 9
Views: 2439

Re: Cannot require modules with init.lua

You can delay window creation by setting the window module to false in conf.lua, and then calling love.window.setMode later (if you want to create a window). At the end of love.load, for example. So, you could just have a separate configuration file, maybe with a boolean field that is checked to us...
by masakk1
Sun Feb 02, 2025 12:06 am
Forum: Support and Development
Topic: Cannot require modules with init.lua
Replies: 9
Views: 2439

Re: Löve is missing the package path to import init.lua libraries - Cannot require modules with init.lua

I recommend structuring your project so that main.lua is at the root There's only one slight problem. I use a different configuration for the server to disable the display and not show a window. How can I split `conf.lua` in that case? Specially because `love.conf` runs before `love.load` does...
by masakk1
Sat Feb 01, 2025 11:51 pm
Forum: Support and Development
Topic: Cannot require modules with init.lua
Replies: 9
Views: 2439

Re: Löve is missing the package path to import init.lua libraries - Cannot require modules with init.lua

I recommend structuring your project so that main.lua is at the root, and then you pick whether to load client or server files from there based on a command-line parameter parsed from that main.lua (or something similar). I see. I investigated how to do so, it means changing some of my code structu...
by masakk1
Sat Feb 01, 2025 8:00 pm
Forum: Support and Development
Topic: Cannot require modules with init.lua
Replies: 9
Views: 2439

Cannot require modules with init.lua

The finding Originally I was going to make a post about how I couldn't get modules that have a init.lua to work, even though it worked for lua 5.4. But miraculously, I decided to check the `package.path` and compared love's luajit to lua 5.4's It just so happed that Löve (or luajit) is missing a ce...