Page 6 of 7

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Mon Jan 01, 2018 2:26 am
by Reika
Rock (the simple-entity type used for decorations) variant, akin to tree_color_index. Both setter and getter. That way moving them can preserve the shape.

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Wed Jan 03, 2018 9:48 pm
by IngoKnieto
entity.neighbour_bonus
and maybe
entity.heat_buffer

I would love to be able to control the performance of a nuclear reactor by accessing and modifying it's produced heat, and I suppose these properties would allow to do that...

EDIT: After taking a closer look, I think entity.consumption and entity.burner.effectivity is what I would need to accomplish this.

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Fri Jan 12, 2018 9:16 pm
by Reika
"Max speed" of cargo wagon, locomotive (and maybe car if applicable/inherited)" on the LuaEntityPrototype, in my case for distinguishing "technical" trains (ie ones only used because the entity needs to be of train type) and "real" ones; max speed for the former is likely to be zero.

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Mon Jan 15, 2018 2:06 am
by Nexela
Reika wrote:"Max speed" of cargo wagon, locomotive (and maybe car if applicable/inherited)" on the LuaEntityPrototype, in my case for distinguishing "technical" trains (ie ones only used because the entity needs to be of train type) and "real" ones; max speed for the former is likely to be zero.
luaentityprototype.speed will return the max speed for rolling stock prototypes
http://lua-api.factorio.com/latest/LuaE ... type.speed

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Mon Jan 15, 2018 4:14 am
by Rseding91
Reika wrote:Rock (the simple-entity type used for decorations) variant, akin to tree_color_index. Both setter and getter. That way moving them can preserve the shape.
They use graphics_variation which is already read/write.

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Fri Jan 19, 2018 3:11 pm
by Mylon
LuaEntity.electric_input_flow_limit write access for EEI entity please.

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Fri Jan 19, 2018 6:39 pm
by Rseding91
Mylon wrote:LuaEntity.electric_input_flow_limit write access for EEI entity please.
Due to the electric network update optimization that's not possible anymore and isn't likely to ever change.

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Tue Jan 23, 2018 10:26 pm
by VortiK
Hello,

I made the deep core mining mod (https://mods.factorio.com/mod/vtk-deep-core-mining) with high level miner and during balance and feedback from fellow engineers I figured beacon and effect can make things go over the top.

I checked to see how I could limit effects and module usage on my entities and found the allowed effets property : https://wiki.factorio.com/Prototype/Cra ... ed_effects

This works to limit the modules you can insert, but not the effets it can receive from beacon.

Would it be possible to have either :
- and "allowed_effets_transmission" property that would define what remote effect the entity can receive
- a way to turn off any beacon effets on an entity like "allow_transmission" as a boolean

I dunno how hard it would be from the factorio code, but it seems there is already something hardcoded to prevent some entities to get beacon effets applied on them (like beacon themselves).

Also the entity applied effets property is Read only (http://lua-api.factorio.com/latest/LuaE ... ty.effects), any reason for that ? Maybe we could hack into it to remove effets from beacons, but I dunno how they are applied and if it would be feasible / performant to change them by control.lua.

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Tue Jan 23, 2018 11:38 pm
by Rseding91
The entire effect system is not adjustable runtime because it's not included in the save file. Every time the game is loaded all of the effects are re-calculated based off the beacons with modules and modules in a given machine. That means you can't change the effects runtime outside of adding/removing modules/beacons (which are in the save file).

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Wed Jan 24, 2018 11:31 pm
by steinio
There is a placeable_by straight rails for curved rails.

Can we get a LuaEntity.consists_of or something to detect this?

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Wed Jan 24, 2018 11:56 pm
by Rseding91
steinio wrote:There is a placeable_by straight rails for curved rails.

Can we get a LuaEntity.consists_of or something to detect this?
You mean http://lua-api.factorio.com/latest/LuaE ... place_this

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Thu Jan 25, 2018 6:04 am
by steinio
Rseding91 wrote:
steinio wrote:There is a placeable_by straight rails for curved rails.

Can we get a LuaEntity.consists_of or something to detect this?
You mean http://lua-api.factorio.com/latest/LuaE ... place_this
Nice. Thanks for implementing so fast :p

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Thu Jan 25, 2018 5:31 pm
by Earendel
Hi Rseding91,
Can you add LuaEntityPrototye.energy_per_hit_point read access for car entities please.
Thanks.

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Thu Jan 25, 2018 7:01 pm
by Aprillion
.icon is listed on 1st page of this thread, some problem implementing please?

I wanted to export icon path or at least filename for an external tool, e.g. when mods modify or add icons, but also in the base mod some icons do not match item name (acumulator.png vs name=accumulator)...

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Thu Jan 25, 2018 10:38 pm
by Rseding91
Aprillion wrote:.icon is listed on 1st page of this thread, some problem implementing please?

I wanted to export icon path or at least filename for an external tool, e.g. when mods modify or add icons, but also in the base mod some icons do not match item name (acumulator.png vs name=accumulator)...
Having read access to the icon data provides nothing useful runtime. You can't do anything with that data.

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Fri Jan 26, 2018 4:47 pm
by Aprillion
Rseding91 wrote:Having read access to the icon data provides nothing useful runtime. You can't do anything with that data.
To export the correct value after the enabled mods are applied - like http://aprillion.github.io/recipe_explorer/#accumulator but html page inside scripts_output/ directory - which is currently not feasible without manual mapping (like accumulator => acumulator.png with single c), which is not possible for arbitrary mods and/or versions (when/if you fix typo) and/or installation folders (not relative to scripts_output)...

I wanted to check if there are complications, or if there are just a lot of higher priorities than my use case.

But the "data provides NOTHING useful" argument might be very rare when you have a million users with access to modding api :) perhaps it's only NOT ENOUGH useful.

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Fri Jan 26, 2018 9:00 pm
by eradicator
Aprillion wrote:
Rseding91 wrote:Having read access to the icon data provides nothing useful runtime. You can't do anything with that data.
To export the correct value after the enabled mods are applied - like http://aprillion.github.io/recipe_explorer/#accumulator but html page inside scripts_output/ directory - which is currently not feasible without manual mapping (like accumulator => acumulator.png with single c), which is not possible for arbitrary mods and/or versions (when/if you fix typo) and/or installation folders (not relative to scripts_output)...

I wanted to check if there are complications, or if there are just a lot of higher priorities than my use case.

But the "data provides NOTHING useful" argument might be very rare when you have a million users with access to modding api :) perhaps it's only NOT ENOUGH useful.
If you just want to export the icon paths once why don't you do it at the end of the data stage?

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Sat Jan 27, 2018 12:04 pm
by Aprillion
eradicator wrote:If you just want to export the icon paths once why don't you do it at the end of the data stage?
I am also exporting the current state of technology research and I hoped to have it all in 1 place, but I guess I could combine exports from multiple stages, thanks for the reminder.

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Mon Jan 29, 2018 9:09 pm
by VortiK
Rseding91 wrote:The entire effect system is not adjustable runtime because it's not included in the save file. Every time the game is loaded all of the effects are re-calculated based off the beacons with modules and modules in a given machine. That means you can't change the effects runtime outside of adding/removing modules/beacons (which are in the save file).
Thanks for your reply. I understand if the effects system can't be interacted with. However would it be possible to have a flag to allow or prevent remote effects on an entity ?

It seems to be already the case on some entities. It seems to work on furnace entity type where you can set "allowed_effects= nil" and beacons won't work on it (exemple mod : https://mods.factorio.com/mod/DeadlockStacking). However when I set the same on a "mining-drill" entity, it will always get effects applied.

Re: Simple property requests (something that exists but has no way to read/write it)

Posted: Mon Jan 29, 2018 9:15 pm
by Rseding91
VortiK wrote:
Rseding91 wrote:The entire effect system is not adjustable runtime because it's not included in the save file. Every time the game is loaded all of the effects are re-calculated based off the beacons with modules and modules in a given machine. That means you can't change the effects runtime outside of adding/removing modules/beacons (which are in the save file).
Thanks for your reply. I understand if the effects system can't be interacted with. However would it be possible to have a flag to allow or prevent remote effects on an entity ?

It seems to be already the case on some entities. It seems to work on furnace entity type where you can set "allowed_effects= nil" and beacons won't work on it (exemple mod : https://mods.factorio.com/mod/DeadlockStacking). However when I set the same on a "mining-drill" entity, it will always get effects applied.
Since 0.16.0 that should work for mining drills as well. If not, please make a bug report with an example mod showing it not working.