Simple property requests (something that exists but has no way to read/write it)
-
- Inserter
- Posts: 46
- Joined: Fri Aug 19, 2016 2:48 pm
- Contact:
Re: Simple property requests (something that exists but has no way to read/write it)
luaEntityPrototype.module_specification
luaEntityPrototype.energy_source (e.g. stone/steel furnace vs electric)
(also ditto on earlier luaEntityPrototype.distribution_effectivity - Beacon distribution effectivity)
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)
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.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)
If you want to get ahold of me I'm almost always on Discord.
Re: Simple property requests (something that exists but has no way to read/write it)
http://lua-api.factorio.com/latest/LuaE ... unding_boxNexela 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
If you want to get ahold of me I'm almost always on Discord.
Re: Simple property requests (something that exists but has no way to read/write it)
Rseding91 wrote:http://lua-api.factorio.com/latest/LuaE ... unding_boxNexela 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
Thanks!!! Can the same thing be added for selection_box?
-
- Inserter
- Posts: 46
- Joined: Fri Aug 19, 2016 2:48 pm
- Contact:
Re: Simple property requests (something that exists but has no way to read/write it)
Then perhaps there's a bug?Rseding91 wrote: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.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)
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.
Code: Select all
if game.entity_prototypes["stone-furnace"].module_inventory_size == nil
then
game.print("nil")
else
game.print("not nil")
end
Re: Simple property requests (something that exists but has no way to read/write it)
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.
Re: Simple property requests (something that exists but has no way to read/write it)
please support graphics_variation for ghost entities
Thanks,
Gerhard
Thanks,
Gerhard
Re: Simple property requests (something that exists but has no way to read/write it)
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
Thanks
Re: Simple property requests (something that exists but has no way to read/write it)
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.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
If you want to get ahold of me I'm almost always on Discord.
Re: Simple property requests (something that exists but has no way to read/write it)
So trees health is different to built entities health somehow?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.
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)
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 prettyfucked 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] ?
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
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)
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)
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 ... imitationsichVII wrote:LuaRecipe.allowed_modules Returns an array of all modules allowed on this recipe.
If you want to get ahold of me I'm almost always on Discord.
Re: Simple property requests (something that exists but has no way to read/write it)
Entity prototype: explosion
beam
rotate
beam
rotate
Re: Simple property requests (something that exists but has no way to read/write it)
LuaControl
opened :: LuaItemStack [read]
opened :: LuaItemStack [read]
Factorio Mod Portal Notifier - https://fac-notify.ml/
Cut and paste tools - https://mods.factorio.com/mods/mickael9/cut-and-paste
Portable Chests - https://mods.factorio.com/mods/mickael9/portable-chests
Cut and paste tools - https://mods.factorio.com/mods/mickael9/cut-and-paste
Portable Chests - https://mods.factorio.com/mods/mickael9/portable-chests
Re: Simple property requests (something that exists but has no way to read/write it)
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.mickael9 wrote:LuaControl
opened :: LuaItemStack [read]
If you want to get ahold of me I'm almost always on Discord.
-
- Filter Inserter
- Posts: 302
- Joined: Fri Mar 18, 2016 4:34 pm
- Contact:
Re: Simple property requests (something that exists but has no way to read/write it)
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.
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)
LuaGuiElement - scroll_position [RW], for scroll-panes.
Re: Simple property requests (something that exists but has no way to read/write it)
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.
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)
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.