ItemEntity from TransportLine
ItemEntity from TransportLine
Currently TransportLine only gives item name and counts, I need to access the health too. Trying to find entities also skip the items on transport lines. So I can't get this info in any way, however the health exists, and is available if an inserter or player picks up the item from the belt.
Re: ItemEntity from TransportLine
TransportLines don't carry ItemEntities (or they haven't since 0.11), as I understand it's an emulated facsimile that is not really an entity. It sounds like the health field does need to be exposed somehow though.Neel wrote:Currently TransportLine only gives item name and counts, I need to access the health too. Trying to find entities also skip the items on transport lines. So I can't get this info in any way, however the health exists, and is available if an inserter or player picks up the item from the belt.
Re: ItemEntity from TransportLine
Ah yes, there was a bug fix in one of the recent versions of 0.14 that means I can now make a wrapper around LuaItemStack that will point at a item on belt. Or, at least I think I can
So, perhaps for 0.15 that will be added in.
So, perhaps for 0.15 that will be added in.
If you want to get ahold of me I'm almost always on Discord.
Re: ItemEntity from TransportLine
Looking forward to it! <3Rseding91 wrote:So, perhaps for 0.15 that will be added in.
Re: ItemEntity from TransportLine
Any possibility this might come out in a 14.x version soon? I wanted to try some experimental ideas with stacks on belt.
The nice thing about health is that it's a double, so, can be used as an additional kind of type, or ID, or all kinds of crazy things.
The nice thing about health is that it's a double, so, can be used as an additional kind of type, or ID, or all kinds of crazy things.
Re: ItemEntity from TransportLine
No, also health isn't unique to an item. If 2 items have the same health the game will stack them. Also health is not a double: it's a float.Neel wrote:Any possibility this might come out in a 14.x version soon? I wanted to try some experimental ideas with stacks on belt.
The nice thing about health is that it's a double, so, can be used as an additional kind of type, or ID, or all kinds of crazy things.
If you want to get ahold of me I'm almost always on Discord.
Re: ItemEntity from TransportLine
Sorry didn't phrase that right. I am aware that items with same health stack, and that's fine for my use case. Factorissimo uses it as id in a creative way, and I want to do something similar. Thanks for the correction on float vs double. 32 bits good enough for me.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: ItemEntity from TransportLine
There are plans to change the way it works in 0.15 according to the recent #FF: viewtopic.php?f=38&t=34319
It would be better to use some alternate approach, for example...
When the entity is mind, use the pre_mined events to swap it with a different entity (not sure if this is feasible if a robot is mining, although there's prototype flag to prevent robots mining a specific kind of entity)... Anyway, maybe a blueprint or something, that you can give a custom name or value to. I've not tried, but it should be possible to create custom blueprint prototype in your data.lua, so you can give it proper icon, name and description - the user will not be aware that it's a blueprint if done properly.
It would be better to use some alternate approach, for example...
When the entity is mind, use the pre_mined events to swap it with a different entity (not sure if this is feasible if a robot is mining, although there's prototype flag to prevent robots mining a specific kind of entity)... Anyway, maybe a blueprint or something, that you can give a custom name or value to. I've not tried, but it should be possible to create custom blueprint prototype in your data.lua, so you can give it proper icon, name and description - the user will not be aware that it's a blueprint if done properly.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.