Page 1 of 1

Data.lua question

Posted: Tue Jan 21, 2025 9:53 pm
by ElectroMagnetic
I'm just starting modding(literally just read the tutorials) and have a question about the data.lua file.
When I look at GitHub code for mods and even Factorio's code documentation itself, it just says

Code: Select all

require "prototypes.thing.thing"
with a bunch of different Prototype types while the actual prototypes are defined in a separate folder. But in the modding tutorial, it says to make the prototypes in data.lua.
Maybe it's just how you're supposed to document mods on GitHub? I don't really know so thanks for any help!

Re: Data.lua question

Posted: Tue Jan 21, 2025 10:00 pm
by jodokus31
https://www.lua.org/pil/8.1.html

You can split prototypes to separate files, otherwise data.lua could get quite big and hard to maintain.

Re: Data.lua question

Posted: Wed Jan 22, 2025 2:19 pm
by ElectroMagnetic
Ok thanks!