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

Post Reply
Rseding91
Factorio Staff
Factorio Staff
Posts: 8646
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 » Mon Jul 17, 2017 5:12 pm

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: 108
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 » Mon Jul 17, 2017 5:33 pm

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.

Mylon
Filter Inserter
Filter Inserter
Posts: 363
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 » Fri Jul 21, 2017 12:07 pm

What about combot time to live? I can't get the entity and then extend its lifetime.

User avatar
Earendel
Filter Inserter
Filter Inserter
Posts: 574
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 » Thu Jul 27, 2017 11:20 pm

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.

Mylon
Filter Inserter
Filter Inserter
Posts: 363
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 » Thu Nov 16, 2017 4:41 am

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 » Fri Nov 17, 2017 8:22 pm

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: 1937
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 » Sat Nov 18, 2017 12:52 am

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: 8646
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 » Sat Nov 18, 2017 1:04 pm

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: 8646
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 » Sat Nov 18, 2017 1:08 pm

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 » Sun Nov 19, 2017 12:08 pm

LuaEntity.products_finished - not currently writable, but I dont see why it couldnt be

Rseding91
Factorio Staff
Factorio Staff
Posts: 8646
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 » Sun Nov 19, 2017 2:03 pm

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: 1937
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 » Sun Nov 19, 2017 3:23 pm

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 » Mon Nov 20, 2017 11:56 pm

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: 3119
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 » Tue Nov 21, 2017 12:11 am

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 » Tue Nov 21, 2017 2:02 am

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: 78
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 » Sat Dec 16, 2017 10:45 pm

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: 8646
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 » Sun Dec 17, 2017 4:35 am

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: 78
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 » Mon Dec 18, 2017 10:56 pm

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: 8646
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 » Thu Dec 21, 2017 2:54 am

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: 113
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 » Sun Dec 31, 2017 11:56 pm

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).

Post Reply

Return to “Implemented mod requests”

Who is online

Users browsing this forum: No registered users and 0 guests