SemlerPDX

Stationeers IC10 - S01E03 Solar Tracking & Power Control v2

Dec 26th, 2025
4,854
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | Gaming | 0 0
  1. #Early Game Power Systems Control v2
  2. # by SemlerPDX Dec2025
  3.  
  4. define ActiveVents -1129453144
  5. define SfcVentMars HASH("Active Vent SFC MARS") #Solid Fuel Chamber
  6. define SfcVentIn HASH("Active Vent SFC IN") #Solid Fuel Chamber
  7. define SfcVentOut HASH("Active Vent SFC OUT") #Solid Fuel Chamber
  8.  
  9. define PipeHeaters -419758574 #gas
  10. define Generators 813146305
  11. define Batteries -400115994
  12.  
  13. define SolarPanels -539224550 #basic
  14. #define SolarPanels -1545574413 #heavy
  15.  
  16. define DaylightSensors 1076425094
  17.  
  18. # Threshold for "dark"
  19. define IrradianceMin 1
  20.  
  21. define SensorOffset 90 # 0, 90, 180, 270
  22.  
  23. define DawnVertical 165
  24. define DawnHorizontal 180
  25.  
  26. define ChargeMin 0.10 # 10%
  27. define ChargeMax 0.50 # 50%
  28. define RatioMin 0.90 # 90%
  29.  
  30. #1-Second Flip-Flip display (Historic Production and Draw)
  31. define TopOfStack 2
  32.  
  33. alias Counter r15
  34.  
  35. #Reset Max Historic on Export
  36. push 0
  37. push 0
  38.  
  39. #Single-use instructions, uncommented and use-once as needed
  40. #sbn ActiveVents SfcVentMars Mode 1 # 1 == 1nward
  41. #sbn ActiveVents SfcVentIn Mode 1 # 1 == 1nward
  42. #sbn ActiveVents SfcVentOut Mode 0 # 0 == 0utward
  43. #yield
  44. #sbn ActiveVents SfcVentMars PressureInternal 1500 #kPa
  45. #sbn ActiveVents SfcVentIn PressureExternal 330 #kPa
  46. #sbn ActiveVents SfcVentOut PressureExternal 110 #kPa
  47. #yield
  48. #sbn ActiveVents SfcVentMars On 0
  49. #sbn ActiveVents SfcVentIn On 1
  50. #sbn ActiveVents SfcVentOut On 1
  51.  
  52. begin:
  53. move sp TopOfStack
  54. brgtz Counter 2
  55. move Counter 5
  56. start:
  57. beqz sp begin
  58. yield
  59.  
  60. #Gather Power Data
  61. lb r0 Batteries PowerPotential Maximum
  62. get r1 db 0
  63. brlt r0 r1 2
  64. put db 0 r0 #maximum historic production
  65. lb r0 Batteries PowerActual Maximum
  66. mul r1 r0 2
  67. sub r0 r0 r1 #Invert to Negative
  68. get r1 db 1
  69. brgt r0 r1 2
  70. put db 1 r0 #maximum historic power draw
  71.  
  72. #Display Data
  73. sub Counter Counter 1
  74. and r0 Counter 1
  75. breqz r0 3
  76. pop r0
  77. s db Setting r0
  78.  
  79. #Backup Power Toggle
  80. lb r0 Batteries Ratio Average
  81. lb r1 Generators On Maximum
  82. select r1 r1 ChargeMax ChargeMin
  83. slt r0 r0 r1
  84. sb Generators On r0
  85.  
  86. #Solar Pipe Heat when over N Ratio
  87. lb r0 Batteries Ratio Average
  88. sgt r0 r0 RatioMin
  89. sb PipeHeaters On r0
  90.  
  91. #Check Time of Day
  92. lb r0 DaylightSensors SolarIrradiance Maximum
  93. blt r0 IrradianceMin nightSleep
  94.  
  95. #Follow Sun (in daytime only)
  96. lb r0 DaylightSensors Vertical Maximum
  97. lb r1 DaylightSensors Horizontal Maximum
  98. add r0 r0 SensorOffset
  99. add r1 r1 SensorOffset
  100. sb SolarPanels Vertical r0
  101. sb SolarPanels Horizontal r1
  102. j start
  103.  
  104. nightSleep:
  105. #Point array at dawn sun
  106. sb SolarPanels Vertical DawnVertical
  107. sb SolarPanels Horizontal DawnHorizontal
  108. j start
Advertisement
Add Comment
Please, Sign In to add comment