Page 4 of 7

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

Posted: Tue Jun 27, 2017 2:44 pm
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)

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

Posted: Tue Jun 27, 2017 7:49 pm
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.

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

Posted: Tue Jun 27, 2017 7:53 pm
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

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

Posted: Wed Jun 28, 2017 4:21 am
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?

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

Posted: Wed Jun 28, 2017 11:54 am
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.

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

Posted: Wed Jun 28, 2017 12:02 pm
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".

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

Posted: Fri Jun 30, 2017 12:36 am
by gheift
please support graphics_variation for ghost entities

Thanks,
Gerhard

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

Posted: Fri Jun 30, 2017 9:56 pm
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

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

Posted: Fri Jun 30, 2017 10:22 pm
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.

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

Posted: Fri Jun 30, 2017 11:15 pm
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

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

Posted: Sat Jul 01, 2017 5:43 pm
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] ? :)

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

Posted: Sun Jul 02, 2017 2:19 pm
by ichVII
LuaRecipe.allowed_modules Returns an array of all modules allowed on this recipe.

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

Posted: Sun Jul 02, 2017 2:40 pm
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

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

Posted: Sun Jul 02, 2017 4:19 pm
by Earendel
Entity prototype: explosion
beam
rotate

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

Posted: Sun Jul 02, 2017 8:32 pm
by mickael9
LuaControl
opened :: LuaItemStack [read]

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

Posted: Sun Jul 02, 2017 9:39 pm
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.

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

Posted: Wed Jul 05, 2017 2:42 am
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.

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

Posted: Thu Jul 06, 2017 2:40 am
by kumpu
LuaGuiElement - scroll_position [RW], for scroll-panes.

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

Posted: Sun Jul 09, 2017 6:40 pm
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.

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

Posted: Mon Jul 17, 2017 3:14 pm
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