Do we need NBT tags (entity.data) in Factorio?

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1194
Joined: Wed May 18, 2016 4:55 pm
Contact:

Do we need NBT tags (entity.data) in Factorio?

Post by Mooncat »

Questions:
Is there any way to copy modded data associated with an entity into blueprint and then paste the data when another entity is built based on the blueprint?
In other words, I have some data about an entity. The data is stored in the global table. The structure is like

Code: Select all

{ entity = event.created_entity, data = "we have some data here" }
When the entity is blueprinted and a new instance is built based on the blueprint, I want the same set of data is applied. But how to?

If no, do you think we need this feature?


I am thinking about something like the NBT tags from Minecraft, which associate custom data with each entity. Maybe it will be named LuaEntity::custom_data in Factorio.
It will be a table and work like the one in global. You can put any serialisable data inside it. But unlike data stored in global, LuaEntity::custom_data can be easily blueprinted.
It will be useful for complicated entities that have individual data and players are allowed to blueprint the data. e.g. the customised contents in the creative chests of my Creaetive Mode mod.

But I am not sure whether we really need this. The only use case I can think of so far is the creative chest which is not supposed to use in normal gameplay, and I have already implemented copy-and-paste as an alternative way to clone the contents.
I think this feature will require some work for the devs, so I want to make sure this is really worth to propose. :)

User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

Re: Do we need NBT tags (entity.data) in Factorio?

Post by DedlySpyder »

There is a modding interface request subforum btw. And IIRC this has been asked for before, but turned down.

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1194
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Do we need NBT tags (entity.data) in Factorio?

Post by Mooncat »

DedlySpyder wrote:There is a modding interface request subforum btw. And IIRC this has been asked for before, but turned down.
I know the forum, but I think there are already many requests waiting to be implemented. I just want to make sure we really need this feature before making another request, because I think its implementation will take noticeable time from the devs. Before giving them headache, let's discuss it here first. :lol:
So far I can think of only one not-so-critical use case for this feature. Therefore, I am not really sure.

I will try to find the old request and see why it was turned down. Thanks for the info. ;)

Post Reply

Return to “Modding discussion”