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

Rseding91
Factorio Staff
Factorio Staff
Posts: 14413
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

Since most of the posts are no longer "read/write access to things that already exist" but new mechanics/properties that require new backing C++ logic I'm going to un-sticky this post and call it good for now.
If you want to get ahold of me I'm almost always on Discord.
User avatar
kumpu
Fast Inserter
Fast Inserter
Posts: 111
Joined: Wed Jun 07, 2017 10:10 am
Contact:

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

Post by kumpu »

Rseding91 wrote:Since most of the posts are no longer "read/write access to things that already exist" but new mechanics/properties that require new backing C++ logic I'm going to un-sticky this post and call it good for now.
I think it's often difficult to judge wether something requires new logic behind it. From a players perspective, without having seen the code, it can easily seem like the game has stored information_x somewhere, but simply does not give api control over it - while in game code it's far more complicated.
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 525
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

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

Post by Mylon »

What about combot time to live? I can't get the entity and then extend its lifetime.
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 716
Joined: Sun Nov 23, 2014 11:57 am
Contact:

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

Post by Earendel »

Earendel wrote:Entity prototype: explosion
beam
rotate
Did this get missed?
If it's not clear which property I'm referring to:
game.entity_prototypes["large-explosion"].beam would return false.
game.entity_prototypes["railgun-beam"].beam would return true.
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 525
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

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

Post by Mylon »

LuaLogisticNetwork::unsatisfied_requesters --array of LuaEntity [Read-only]
An array of entities with unsatisfied logistic requests.

Desired use-case: Query if a logistic network has an unfilled demand for ore, and if so turn on logistic mining (a mod). Prevents case of logistic mining completely clogging storage without doing much more expensive checks.

LuaLogisticNetwork::satisfied_requester_points --Array of LuaLogisticPoint (Read-only]
(For completeness sake)
napu
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Nov 17, 2017 8:16 pm
Contact:

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

Post by napu »

Make stack_size writeable

Desired usage: In a mod where space is a factor and one has to mine a lot to expand ones base. This is instead of having to create new items to support higher stacks on not change the base item.

Edit:
Sorry, this was posted twice.
Last edited by napu on Sat Nov 18, 2017 6:17 am, edited 1 time in total.
Casual modder
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2173
Joined: Thu Jun 12, 2014 3:05 am
Contact:

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

Post by Ranakastrasz »

I still want access to however Regeneration delay is handled.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Rseding91
Factorio Staff
Factorio Staff
Posts: 14413
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

Ranakastrasz wrote:I still want access to however Regeneration delay is handled.
Added for 0.16.
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14413
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

Mylon wrote:LuaLogisticNetwork::unsatisfied_requesters --array of LuaEntity [Read-only]
An array of entities with unsatisfied logistic requests.

Desired use-case: Query if a logistic network has an unfilled demand for ore, and if so turn on logistic mining (a mod). Prevents case of logistic mining completely clogging storage without doing much more expensive checks.

LuaLogisticNetwork::satisfied_requester_points --Array of LuaLogisticPoint (Read-only]
(For completeness sake)
requester_points is the list of possibly unsatisfied requester points. full or satisfied points is the list of satisfied (or full) points.
If you want to get ahold of me I'm almost always on Discord.
LukeM
Inserter
Inserter
Posts: 26
Joined: Sun Mar 20, 2016 8:32 pm
Contact:

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

Post by LukeM »

LuaEntity.products_finished - not currently writable, but I dont see why it couldnt be
Rseding91
Factorio Staff
Factorio Staff
Posts: 14413
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

LukeM212 wrote:LuaEntity.products_finished - not currently writable, but I dont see why it couldnt be
Added for 0.16.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2173
Joined: Thu Jun 12, 2014 3:05 am
Contact:

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

Post by Ranakastrasz »

Rseding91 wrote:
Ranakastrasz wrote:I still want access to however Regeneration delay is handled.
Added for 0.16.
Awesome!
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Angamara
Inserter
Inserter
Posts: 39
Joined: Mon Oct 30, 2017 3:52 pm
Contact:

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

Post by Angamara »

LuaStyle.column_alignments [Read-only]

Klonan had told me the opposite on an old post, so I point out the impossibility of changing the value of this property.
posila
Factorio Staff
Factorio Staff
Posts: 5379
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post by posila »

Angamara wrote:LuaStyle.column_alignments [Read-only]

Klonan had told me the opposite on an old post, so I point out the impossibility of changing the value of this property.
Read-only here means you can't do style.column_alignments = { "top-left", "middle-center" }, but it returns array that you can modify: style.column_alignments[1] = "top-left"; style.column_alignments[2] = "middle-center"
LuaForce::technologies or LuaForce::recipes work the same way
Angamara
Inserter
Inserter
Posts: 39
Joined: Mon Oct 30, 2017 3:52 pm
Contact:

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

Post by Angamara »

Ok that's another explanation, or at least I understand it differently.

Here is the link of the subject on which I had spoken to continue the discussion and not overload this topic.
viewtopic.php?f=28&t=53943
dewiniaid
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Tue Mar 07, 2017 8:50 pm
Contact:

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

Post by dewiniaid »

Could we get a LuaControl.cursor_direction for reading the current orientation of the cursor? (i.e. the direction a belt/blueprint/whatnot would be placed)?

I'm writing a mod that snaps a blueprint to a specific edge to make it easier to place very large blueprints. The problem is I want it the 'snap' to be relative to the map, not the blueprint's current orientation -- which I can't do without knowing said orientation.

Thanks!
Rseding91
Factorio Staff
Factorio Staff
Posts: 14413
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

dewiniaid wrote:Could we get a LuaControl.cursor_direction for reading the current orientation of the cursor? (i.e. the direction a belt/blueprint/whatnot would be placed)?

I'm writing a mod that snaps a blueprint to a specific edge to make it easier to place very large blueprints. The problem is I want it the 'snap' to be relative to the map, not the blueprint's current orientation -- which I can't do without knowing said orientation.

Thanks!
No, that data isn't part of the game state and as such would cause desyncs if used in MP.
If you want to get ahold of me I'm almost always on Discord.
dewiniaid
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Tue Mar 07, 2017 8:50 pm
Contact:

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

Post by dewiniaid »

Can we get read-only access to the contents of core/data/backers.json, perhaps as game.backer_names?

I realize I could just duplicate that in Lua (and will for now), but that's a bit of a mess for maintainability down the road.

(My end goal here is to determine if a train stop name is automatically chosen or has been manually set via the player or via blueprint placement)
Rseding91
Factorio Staff
Factorio Staff
Posts: 14413
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

dewiniaid wrote:Can we get read-only access to the contents of core/data/backers.json, perhaps as game.backer_names?

I realize I could just duplicate that in Lua (and will for now), but that's a bit of a mess for maintainability down the road.

(My end goal here is to determine if a train stop name is automatically chosen or has been manually set via the player or via blueprint placement)
Sure, added for the next version of 0.16.
If you want to get ahold of me I'm almost always on Discord.
thelordodin
Fast Inserter
Fast Inserter
Posts: 153
Joined: Fri Jan 06, 2017 1:54 am
Contact:

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

Post by thelordodin »

An entity have circuit_connection_definitions, but ghost entity - doesn't.
An entity have connect_neighbour, but ghost entity - doesn't.
Same problem with get_inventory(1).getbar() and setbar

(This exists in game, but there is no way to write to it now).
Locked

Return to “Implemented mod requests”