Page 2 of 7

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

Posted: Mon May 15, 2017 6:54 pm
by sparr
Requests for LuaEntity properties needed for cloning via LuaSurface::create_entity:

flying-text
text :: string: The string to show.
color :: Color: Color of the displayed text.

entity-ghost
expires :: boolean (optional): If false the ghost entity will not expire. Default is true.

particle
movement :: Vector
height :: float
vertical_speed :: float
frame_speed :: float

projectile
speed :: double

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

Posted: Mon May 15, 2017 6:56 pm
by Ranakastrasz
equipment.burner.fuel_category.
Would like to be able to identify what kind of fuel a burner takes in general as well.

So, burner.prototype.fuel_category.

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

Posted: Tue May 16, 2017 8:00 pm
by Helfima
luaEntityPrototype.distribution_effectivity - Beacon distribution effectivity

luaEntityPrototype.energy_source.buffer_capacity - Accumulator buffer capacity
luaEntityPrototype.energy_source.input_flow_limit - Accumulator input flow limit
luaEntityPrototype.energy_source.output_flow_limit - Accumulator output flow limit
luaEntityPrototype.energy_source.effectivity - Generator or boiler effectivity
luaEntityPrototype.maximum_temperature - Generator maximum temperature
luaEntityPrototype.fluid_usage_per_tick - Generator fluid usage per tick
luaEntityPrototype.consumption - Boiler energy consumption
luaEntityPrototype.target_temperature - Boiler target temperature
luaEntityPrototype.production - Solar production

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

Posted: Wed May 17, 2017 3:54 am
by mickael9
item-request-proxy
proxy_target :: LuaEntity

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

Posted: Wed May 17, 2017 4:36 am
by Nexela
luaFluidPrototype.type -- This would of course just return "fluid"

Use case
I have a combined list of item and fluid prototypes and want to iterate the list and make a sprite button depending on what the prototype is, currently this results in an error trying to access type on fluid prototypes

Additionaly the remaning lua***Prototypes should have this as well

BurnerPrototype
DamagePrototype
DecorativePrototype
EquipmentGridPrototype
RecipePrototype
TechnologyPrototype
TilePrototype

Thanks!

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

Posted: Thu May 18, 2017 10:07 pm
by sparr
read/write access to LuaEntity.production for solar panels (docs say power_production is just for electricenergyinterface)

use case: lower power production based on pollution

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

Posted: Thu May 18, 2017 10:15 pm
by Rseding91
sparr wrote:read/write access to LuaEntity.production for solar panels (docs say power_production is just for electricenergyinterface)

use case: lower power production based on pollution
This isn't possible. Solar panels produced based off the prototype values multiplied by the current brightness * solar panel count in the network.

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

Posted: Sat May 20, 2017 10:02 am
by Mooncat
Not sure if it is the right place to ask:

- Read whether time is frozen on a surface. (Change LuaSurface.freeze_daytime to a read-write property?)
We can write LuaSurface.freeze_daytime, but no way to read its state currently. (The request)


- LuaTechnology.research_progress
We can set LuaTechnology.researched to false to reset the technology. But if the technology was researched for awhile and the player changed the research, its research progress was saved, setting researched=false won't reset its progress.


Edit: btw, setting LuaTechnology.researched to true won't reset the saved progress either. Is it a bug?
Steps to reproduce: research a technology for awhile but don't complete it -> set its LuaTechnology.researched to true -> open technology UI and observe

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

Posted: Sun May 21, 2017 10:38 pm
by Nexela
luaFluidPrototype.gas_temperature

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

Posted: Tue May 23, 2017 10:53 pm
by MightyMooquack
LuaEntityPrototype.resource_categories -- The list of resource categories that can be mined by a mining entity (burner miner, electric miner, pumpjack).
LuaEntityPrototype.fluid -- Only appears to be used by the offshore-pump. The fluid that the entity produces.
LuaEntityPrototype.pumping_speed -- Used by offshore-pump and pump. Fluid pumped per tick.

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

Posted: Wed May 24, 2017 8:53 am
by Choumiko
Unless i'm missing something:

LuaEntityPrototype.speed : According to the docs it's for robots only, should work for Locomotives, cars, tanks too (maybe even cargo wagons as in max speed they can tolerate)

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

Posted: Wed May 24, 2017 8:57 am
by Rseding91
Choumiko wrote:Unless i'm missing something:

LuaEntityPrototype.speed : According to the docs it's for robots only, should work for Locomotives, cars, tanks too (maybe even cargo wagons as in max speed they can tolerate)
Cars and tanks have no speed value - they're only limited by the energy they can transfer into motion each tick. Locomotives/cargo wagons I can add.

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

Posted: Mon May 29, 2017 7:37 am
by kikker450
MightyMooquack wrote:LuaEntityPrototype.resource_categories
Is this added for the next patch? (you're usually so quick :( ) I kinda of want this for finding and calculating miners and pumpjacks in RatioTree

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

Posted: Mon May 29, 2017 4:35 pm
by Mylon
Combat robot time to live: viewtopic.php?f=28&t=48878

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

Posted: Tue May 30, 2017 12:38 pm
by Helfima
Helfima wrote:....
luaEntityPrototype.production - Solar production
I don't see solar production, it's missing?
See my screen with properties of solar prototype
solar.entity_prototype.electric_energy_source_prototype

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

Posted: Tue May 30, 2017 3:12 pm
by sparr
Helfima wrote:
Helfima wrote:See my screen with properties of solar prototype
solar.entity_prototype.electric_energy_source_prototype
Is that property exploring mod published?

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

Posted: Tue May 30, 2017 6:12 pm
by Helfima
sparr wrote:Is that property exploring mod published?
yes it's a hidden tab by default in my mod Helmod :D
GAME_OPTION
sample

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

Posted: Thu Jun 01, 2017 4:44 pm
by mickael9
For curved rails:

LuaEntity::secondary_bounding_box
LuaEntityPrototype::secondary_collision_box

I'm also wondering why there is no secondary_selection_box in the curved rail's prototype since one can be seen with the debug view when "show-selection-rectangles" is checked

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

Posted: Thu Jun 01, 2017 6:42 pm
by Ranakastrasz
LuaEntityPrototype.ticks_to_stay_in_combat (R)
-----

LuaEntity.inCombat (Boolean) (R)

OR

LuaEntity.lastCombatTick (R/W)(int)


InCombat would let you know if the entity is regenerating or not.
lastCombatTick read/write would, with ticks_to_stay_in_combat would allow for you to both detect regeneration state, AND manipulate it.

Additionally, even if ticks_to_stay_in_combat is zero/undefined, setting lastCombatTick to CurrentTime+60 would delay regeneration for a full second, allowing regeneration suppressing.

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

Posted: Mon Jun 05, 2017 5:40 am
by evildogbot100
LuaSurface::createEntity

orientation :: float : only for car, tank, locomotive, and wagons.