initial confusion about entities, items and prototypes

Place to get help with not working mods / modding interface.
Post Reply
FoeNichts
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Jan 15, 2024 4:37 pm
Contact:

initial confusion about entities, items and prototypes

Post by FoeNichts »

Hey, I just started to get into the modding world and I think I'm still kinda confused. I followed Gangsir's Modding Tutorial and I was wondering why we only 'edited' the items.lua file and didn't do anything to the entities.lua file. What does it mean to add an item without adding and entity of the same name? What are the purposes of these two different files?

From what I've understood, prototypes are supposed to be templates for entities, recipes etc so that we can add new stuff without having access to the full game code right? And hence I conclude that the prototypes are the templates that you use if you want to add something to the game, providing you with methods and variables that you can use. Creating a new prototype is not possible as we don't have access to the entire game code, correct?

Also is there any documentation about what the purpose of the different files are? For now, I've only found documentation about the prototypes and a few modding/data lifecycle tutorials but I'm still not sure that I would know which files I would need to edit to implement something more complex.

I would be really grateful for any answers to these questions as I'm trying to understand where to start with implementing any given idea I might have. I know that these might be stupid questions for someone that is already familiar with the factorio modding world but I don't want my initial confusion to stop me from at least trying to do some modding of my own. If I did anything wrong when it comes to the forum etiquette just let me know :)

BraveCaperCat
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Re: initial confusion about entities, items and prototypes

Post by BraveCaperCat »

An ITEM is an item you can put in your inventory (like an iron gear wheel) A ENTITY is something which can be placed on the ground (like a furnace)
All ENTITIES require ITEMS otherwise they cannot be put on the ground, and if picked up off the ground, they will put nothing in your inventory. HOWEVER, Not all Items require an Entity, since not all items can be place on the ground (again, like an iron gear wheel)
Also, the only thing which matters (about mod structure) is that settings are defined in the settings stage, all other prototypes are defined in the data stage and all event handling, custom special stuff is handled in the control stage (only control.lua and anything you include within it)

Post Reply

Return to “Modding help”