Page 5 of 7

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

Posted: Mon Jul 17, 2017 5:12 pm
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.

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

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

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

Posted: Fri Jul 21, 2017 12:07 pm
by Mylon
What about combot time to live? I can't get the entity and then extend its lifetime.

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

Posted: Thu Jul 27, 2017 11:20 pm
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.

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

Posted: Thu Nov 16, 2017 4:41 am
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)

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

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

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

Posted: Sat Nov 18, 2017 12:52 am
by Ranakastrasz
I still want access to however Regeneration delay is handled.

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

Posted: Sat Nov 18, 2017 1:04 pm
by Rseding91
Ranakastrasz wrote:I still want access to however Regeneration delay is handled.
Added for 0.16.

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

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

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

Posted: Sun Nov 19, 2017 12:08 pm
by LukeM
LuaEntity.products_finished - not currently writable, but I dont see why it couldnt be

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

Posted: Sun Nov 19, 2017 2:03 pm
by Rseding91
LukeM212 wrote:LuaEntity.products_finished - not currently writable, but I dont see why it couldnt be
Added for 0.16.

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

Posted: Sun Nov 19, 2017 3:23 pm
by Ranakastrasz
Rseding91 wrote:
Ranakastrasz wrote:I still want access to however Regeneration delay is handled.
Added for 0.16.
Awesome!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Posted: Sun Dec 31, 2017 11:56 pm
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).