Stationeers

Stationeers

View Stats:
IC10 Solar Tracking
Hello ! I seek a bit of help ( not a big problem to solve but ... )
Here is my code ( using only D0 as daylight sensor )
define HorizontalC 90 loop: yield l r0 d0 Horizontal # DaylightSensor.Horizontal (d0) stored into r0 add r0 r0 HorizontalC # Use to set the SolarPanel.Horizontal sb -539224550 Horizontal r0 l r0 d0 Vertical # DaylightSensor.Vertical (d0) stored into r0 sub r0 90 r0 # Use to set the SolarPanel.Vertical sb -539224550 Vertical r0 #sb HASH("StructureSolarPanel") Vertical r0 sleep 1 j loop
It work perfectly, my issue is about the Prefab Hash, i mean it work, but i tried to use hash to get all other solar panel but yeah of course it don't work as it create an integer for the string itself, meaning StructureSolarPanel is not equal to StructureSolarPanelDual wich is totally normal.

My question is, is it possible to do a string search, like any network component who's name containt "X" ? If not possible i will just write each solar panel but yeah i don't like that xD
< >
Showing 1-6 of 6 comments
* Or even a way to create a list and loop it ?
I'm still on the wiki but don't found anything yet

EDIT : Just found it, need to try but it should work with memory stacking
u can just check if device exist, look for "is set" at https://stationeers-wiki.com/IC10 more at bottom
u have to use correct name that matches to device
alias structureName r15 main: yield l r0 d0 Horizontal #do the math l r1 d0 Vertical #or do it here move structureName HASH("A") jal doSomething move structureName HASH("B") jal doSomething move structureName HASH("C") jal doSomething j main doSomething: yield sb structureName Horizontal r0 sb structureName Vertical r1 j ra
Originally posted by Secure by Design:
u can just check if device exist, look for "is set" at https://stationeers-wiki.com/IC10 more at bottom
u have to use correct name that matches to device
alias structureName r15 main: yield l r0 d0 Horizontal #do the math l r1 d0 Vertical #or do it here move structureName HASH("A") jal doSomething move structureName HASH("B") jal doSomething move structureName HASH("C") jal doSomething j main doSomething: yield sb structureName Horizontal r0 sb structureName Vertical r1 j ra
Hell no xD the objective is to optimise the code, not making it larger or heavier ^^
Originally posted by Kporal:
define HorizontalC 90 loop: yield l r0 d0 Horizontal # DaylightSensor.Horizontal (d0) stored into r0 add r0 r0 HorizontalC # Use to set the SolarPanel.Horizontal sb -539224550 Horizontal r0 l r0 d0 Vertical # DaylightSensor.Vertical (d0) stored into r0 sub r0 90 r0 # Use to set the SolarPanel.Vertical sb -539224550 Vertical r0 #sb HASH("StructureSolarPanel") Vertical r0 sleep 1 j loop

Not sure if it means anything but you have a letter C behind the word Horizontal on line five.
Also why do you have sleep and yield function? Should one be enough?
HorizontalC line 5 is a var define line 1.
I have both yield and sleep here but in this precise code yeah it's not usefull, but do not forget they do not the same, as yield pause for 1 tick and sleep pause for X seconds.
K, understood. thanks
< >
Showing 1-6 of 6 comments
Per page: 1530 50

Date Posted: Oct 31, 2024 @ 12:40pm
Posts: 6