Stationeers-ic / stationeers-code-simulator

MIT License
13 stars 3 forks source link

Logic types set in a register do not change the appropriate value on a property #33

Open QuinnMcKown opened 3 months ago

QuinnMcKown commented 3 months ago

TLDR: when using a batch instruction like sbn with a logic type stored in a register, the prop of a device shows the r2: 1 as opposed to Mode: 1

When using a instruction like sbn it is possible to store the logic type into a register as an integer, rather than using the named value. It looks like

move r0 LogicType.On
sb d0 r0 1

rather than

sb d0 On 1

I was using this method to set the logic values of an array of structures, specifically all door types for an airlock script. When running the script in this simulator the name of the property is taken as the exact name provided in the instruction. Whereas in the actual game if a register is provided it will use the value of the register in place of a named constant.

Traineratwot commented 3 months ago

Wow, I didn't know it worked like that :) I will fix it but not soon