Tagging prototypes

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Pi-C
Smart Inserter
Smart Inserter
Posts: 1650
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Tagging prototypes

Post by Pi-C »

WHAT?
I'd like to get a new property (ideally for all prototypes) that mods can use to pass on information from the data to the control stage. The property should be read-only in the control stage. It should be a table that can be filled with arbitrary data:

Code: Select all

data.raw[type][name].mod_tags = {
	"Added by " .. mod_name,
	42,
	[mod_name_1] = {x = 123, y = 0}, 
	[mod_name_2] = true,
	[…]
}
WHY?
Some mods make changes to prototypes they didn't create. They won't necessarily know in the control stage whether they changed it by just reading the prototype data. Adding tags in the data stage would make it easy to identify the prototypes they need.
USE CASE
One of my mods interfered with entities from another mod. I fixed that by blacklisting its prototypes, but other mods should be able to add things to my ignore list. In the next version, I will need the same list in the data stage as well. If there was a way to tag prototypes, other mods wouldn't have to pass on the same data twice.

We already have LuaItemStack.tags, LuaGuiElement.tags and LuaEntity.tag that can be read and written to in the control stage. What I'm asking for really is just read-only tags that can't be changed in the control stage! Also, I wouldn't mind if they come by any other name: "mod_data" or whatever else you see fitting. :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Post Reply

Return to “Modding interface requests”