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

Theanderblast
Inserter
Inserter
Posts: 45
Joined: Fri Aug 19, 2016 2:48 pm
Contact:

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

Post by Theanderblast »

luaEntityPrototype.module_specification
luaEntityPrototype.energy_source (e.g. stone/steel furnace vs electric)


(also ditto on earlier luaEntityPrototype.distribution_effectivity - Beacon distribution effectivity)

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
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 »

Theanderblast wrote:luaEntityPrototype.module_specification
luaEntityPrototype.energy_source (e.g. stone/steel furnace vs electric)


(also ditto on earlier luaEntityPrototype.distribution_effectivity - Beacon distribution effectivity)
Module specification is provided through module_inventory_size since that's the only mod-relevant property that the specification provides. energy_source is provided through burner_prototype and electric_energy_source_prototype.
If you want to get ahold of me I'm almost always on Discord.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
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 »

Nexela wrote:I can find many uses for read on entity xxxx-box including not having to do weird things like offsetting to get get the correct position then having to decide if it needs to be rotated :)
http://lua-api.factorio.com/latest/LuaE ... unding_box
http://lua-api.factorio.com/latest/LuaE ... unding_box
If you want to get ahold of me I'm almost always on Discord.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

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

Post by Nexela »

Rseding91 wrote:
Nexela wrote:I can find many uses for read on entity xxxx-box including not having to do weird things like offsetting to get get the correct position then having to decide if it needs to be rotated :)
http://lua-api.factorio.com/latest/LuaE ... unding_box
http://lua-api.factorio.com/latest/LuaE ... unding_box

Thanks!!! Can the same thing be added for selection_box?

Theanderblast
Inserter
Inserter
Posts: 45
Joined: Fri Aug 19, 2016 2:48 pm
Contact:

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

Post by Theanderblast »

Rseding91 wrote:
Theanderblast wrote:luaEntityPrototype.module_specification
luaEntityPrototype.energy_source (e.g. stone/steel furnace vs electric)


(also ditto on earlier luaEntityPrototype.distribution_effectivity - Beacon distribution effectivity)
Module specification is provided through module_inventory_size since that's the only mod-relevant property that the specification provides. energy_source is provided through burner_prototype and electric_energy_source_prototype.
Then perhaps there's a bug?

Documentation says

Code: Select all

class LuaEntityPrototype - sort
   module_inventory_size :: uint [R]	The module inventory size or nil if this entity doesn't suport modules.
... but

Code: Select all

							
if game.entity_prototypes["stone-furnace"].module_inventory_size == nil
then
   game.print("nil")  
else
   game.print("not nil")
end
prints "not nil" for me.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
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 »

Stone furnaces support modules but have the module inventory size set to 0. By "support" it means the entity type can support modules. A tree for instance can't support modules and will give back "nil".
If you want to get ahold of me I'm almost always on Discord.

gheift
Fast Inserter
Fast Inserter
Posts: 188
Joined: Tue Mar 03, 2015 9:20 pm
Contact:

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

Post by gheift »

please support graphics_variation for ghost entities

Thanks,
Gerhard

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 »

Some flags are assumed, and cannot be disabled (as far as I can tell) for things like trees, e.g. not-repairable and not-blueprintable, I think these could be quite useful in some specific cases
Thanks :D

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
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:Some flags are assumed, and cannot be disabled (as far as I can tell) for things like trees, e.g. not-repairable and not-blueprintable, I think these could be quite useful in some specific cases
Thanks :D
Things with no health aren't repairable, things that aren't built or supported in blueprints simply can't be blueprinted because the game engine wasn't coded to support it.
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 »

Rseding91 wrote:Things with no health aren't repairable, things that aren't built or supported in blueprints simply can't be blueprinted because the game engine wasn't coded to support it.
So trees health is different to built entities health somehow?
And why wouldn't things like trees be supported in blueprints? If a new type of placeable tree was added by a mod, wouldn't it be almost the same as things like land-mines, which are supported?

Sorry if I'm missing something, but wouldn't all entities be treated similarly, or is it something to do with the random variations of trees or something?

Also, I think I saw a few other things in different entities a while ago, although I can't remember what atm, and they might have already been changed

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 »

LuaGuiElement.sprite [RW], for sprite type (currently its only for sprite-button).

Also, what about generic
LuaStyle.hovered_color, LuaStyle.border_color, LuaStyle.border_size (That way you would not have to resort to sprite workarounds to give an element a nice orange "selected" border.)
LuaStyle.[top|right|bottom|left]_margin
on_gui_mousewheel event
Map GuiElement type (like those train views)
?


As you may have guessed I'm currently doing gui stuff, and it's pretty cumbersome. Maybe I'm just spoiled by CSS which is in itself pretty fucked up messy.
But I think this could need a lot of work, which would benefit the entire modding community.
For example, what unit are LuaStyle width fields? It does not seem to be actual pixel size and I can't find any documentation on it. Relative % units would be nice.


Also, what about LuaEntity.collisionEnabled :: boolean [RW] ? :)

ichVII
Long Handed Inserter
Long Handed Inserter
Posts: 98
Joined: Mon Feb 27, 2017 10:16 pm
Contact:

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

Post by ichVII »

LuaRecipe.allowed_modules Returns an array of all modules allowed on this recipe.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
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 »

ichVII wrote:LuaRecipe.allowed_modules Returns an array of all modules allowed on this recipe.
Recipes don't define which modules can be used. The module defines which categories it can work against which is already readable: http://lua-api.factorio.com/latest/LuaI ... imitations
If you want to get ahold of me I'm almost always on Discord.

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
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 »

Entity prototype: explosion
beam
rotate

User avatar
mickael9
Fast Inserter
Fast Inserter
Posts: 112
Joined: Mon Mar 14, 2016 4:04 am
Contact:

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

Post by mickael9 »

LuaControl
opened :: LuaItemStack [read]

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
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 »

mickael9 wrote:LuaControl
opened :: LuaItemStack [read]
Due to engine limitations that's currently not possible. The game knows *an* item is opened but does not know in which entity or which slot it's located meaning it's not possible to create a LuaItemStack from it.
If you want to get ahold of me I'm almost always on Discord.

justarandomgeek
Filter Inserter
Filter Inserter
Posts: 300
Joined: Fri Mar 18, 2016 4:34 pm
Contact:

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

Post by justarandomgeek »

I'd like to be able to read mod info (which loaded mods modified/created the thing) from prototypes, like shows in the infoboxes when selecting items/signals.

Specifically I'd like it on LuaVirtualSignalPrototype, LuaFluidPrototype and LuaItemPrototype, but it seems worth having on all the prototype types.

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 »

LuaGuiElement - scroll_position [RW], for scroll-panes.

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1190
Joined: Wed May 18, 2016 4:55 pm
Contact:

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

Post by Mooncat »

LuaGUIElement::pie_progress : double [RW]

How much this button is filled. It is a value in range [0, 1].
Can only be used if this is button or sprite-button.


Because we have LuaStyle::pie_progress_color for buttons, but we can't set the progress.
I have tried setting LuaGuiElement::value for a button but it is not allowed.
So I guess there should be something missing.

Aidiakapi
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Fri Apr 14, 2017 6:13 pm
Contact:

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

Post by Aidiakapi »

Code: Select all

LuaGui:focused :: LuaGuiElement [RW]
    Read: Gets the currently focused GUI element, or nil if nothing is focused or the widget is not a lua widget.
    Write: Sets the currently focused GUI element, or clears focus when nil.
Would also solve: Function for focusing a GUI element

Locked

Return to “Implemented mod requests”