Page 1 of 1

[2.0.x] LuaLampControlBehavior documentation is wrong

Posted: Tue Nov 12, 2024 8:19 am
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 362 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 362 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

Re: [2.0.x] LuaLampControlBehavior documentation is wrong

Posted: Tue Nov 12, 2024 11:32 am
by boskid
Given that CircuitConditionDefinition has a screaming TODOC item inside, i am moving this to documentation improvement requests.

Re: [2.0.x] LuaLampControlBehavior documentation is wrong

Posted: Wed Nov 13, 2024 1:26 am
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.