[2.0.x] LuaLampControlBehavior documentation is wrong

Place to report issues and suggest improvements to the API documentation.
User avatar
hgschmie
Inserter
Inserter
Posts: 33
Joined: Tue Feb 06, 2024 5:18 am
Contact:

[2.0.x] LuaLampControlBehavior documentation is wrong

Post by hgschmie »

The 2.0.16 docs state for e.g. LuaLampControlBehavior for the circuit condition field:
circuit_condition :: Read|Write CircuitConditionDefinition

The circuit condition. Writing nil clears the circuit condition.

However, the debugger says something else:

Screenshot 2024-11-12 at 00.16.37.png
Screenshot 2024-11-12 at 00.16.37.png (105.75 KiB) Viewed 156 times

So the value of the "circuit_condition" field is not a CircuitConditionDefinition but a CircuitCondition. And lo and behold, doing this:

Screenshot 2024-11-12 at 00.17.52.png
Screenshot 2024-11-12 at 00.17.52.png (47.83 KiB) Viewed 156 times

works fine in spite of the angry yellow lines in VSCode (and using a CircuitConditionDefinition does not).


This may apply to everything that extends LuaGenericOnOffControlBehavior
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2964
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.x] LuaLampControlBehavior documentation is wrong

Post by boskid »

Given that CircuitConditionDefinition has a screaming TODOC item inside, i am moving this to documentation improvement requests.
User avatar
hgschmie
Inserter
Inserter
Posts: 33
Joined: Tue Feb 06, 2024 5:18 am
Contact:

Re: [2.0.x] LuaLampControlBehavior documentation is wrong

Post by hgschmie »

boskid wrote: Tue Nov 12, 2024 11:32 am Given that CircuitConditionDefinition has a screaming TODOC item inside, i am moving this to documentation improvement requests.
Agreed but as this not only affects CIrcuitConditionDefinition but everything that uses LuaGenericOnOffControlBehavior (which seems to be a number of things such as LuaAgriculturalTowerControlBehavior, LuaArtilleryTurretControlBehavior, LuaAssemblingMachineControlBehavior, LuaAsteroidCollectorControlBehavior, LuaInserterControlBehavior besides LuaLampControlBehavior to just name a few), I think updating the docs is important as IDEs etc. rely on them to show possible code errors.
Post Reply

Return to “Documentation Improvement Requests”