Data.lua question

Place to get help with not working mods / modding interface.
User avatar
ElectroMagnetic
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Jan 10, 2025 10:57 pm
Contact:

Data.lua question

Post 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!
User avatar
jodokus31
Smart Inserter
Smart Inserter
Posts: 1629
Joined: Sun Feb 26, 2017 4:13 pm
Contact:

Re: Data.lua question

Post 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.
User avatar
ElectroMagnetic
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Jan 10, 2025 10:57 pm
Contact:

Re: Data.lua question

Post by ElectroMagnetic »

Ok thanks!
Post Reply

Return to “Modding help”