Difference between revisions of "Kit (Satellite Dish)"
From Unofficial Stationeers Wiki
m (add commentary.) |
(→incorrectly labelled as a ContactTypeID. it's a hash specific to the instance of trader, not their type. pulling this value and comparing it to the table on the Trader page will show this) |
||
| (12 intermediate revisions by 3 users not shown) | |||
| Line 21: | Line 21: | ||
The Satellite Dish must be guided by [[Satellite Tracking]] onto a signal and communications may be established once the signal strength is greater than 94% | The Satellite Dish must be guided by [[Satellite Tracking]] onto a signal and communications may be established once the signal strength is greater than 94% | ||
| + | |||
| + | '''Important''': The Dish must not be obstructed, it needs direct line of sight and will be blocked by any obstacle. | ||
== Medium Satellite Dish == | == Medium Satellite Dish == | ||
| + | === Data Network Properties === | ||
| + | <div class="mw-customtoggle-datanetworkproperties" style="width:auto; overflow:auto; text-indent:10px; border: 2px solid #253C60; border-radius:10px;"><b>Click here to see/hide all the <span style="color:#E57125;">data network properties</span></b></div> | ||
| + | <div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-datanetworkproperties"><br>{{:Kit_(Satellite_Dish)/Data_Network}}</div> | ||
| + | |||
| + | == Stack Usage == | ||
After "Big Changes Coming: Terrain Preview, Melting Ice, Modding, & Localization" update, Medium Satellite Dish has internal stack like Autolathe, which user can utilize it to give instructions to. | After "Big Changes Coming: Terrain Preview, Melting Ice, Modding, & Localization" update, Medium Satellite Dish has internal stack like Autolathe, which user can utilize it to give instructions to. | ||
The Medium Satellite Dish currently have 256Bytes(32 Addresses) stack memory. | The Medium Satellite Dish currently have 256Bytes(32 Addresses) stack memory. | ||
| + | |||
| + | Pro tips: | ||
| + | * Everyday there will be only 3 vessels, one for each shuttle tier. | ||
| + | * Everyday the 3 vessels will be refreshed, the algorithm for which type of vessel to appear is random, but strictly 1 for each tier. | ||
| + | * It's best to use 500 watts if you are using medium satellite dish to scan, 500 watts is just large enough for the FAR tier to appear on the radar, but small enough for it's signal being masked by lower tier shuttles. | ||
<pre style="color: red"> | <pre style="color: red"> | ||
| Line 330: | Line 342: | ||
! Segment 1 | ! Segment 1 | ||
| All bits value in this section is the deplicate of bit 39. | | All bits value in this section is the deplicate of bit 39. | ||
| − | | | + | | TraderIdHash |
| OpCode of TraderInstruction.StrongestContactIdHash. | | OpCode of TraderInstruction.StrongestContactIdHash. | ||
|- | |- | ||
| Line 360: | Line 372: | ||
|} | |} | ||
</div> | </div> | ||
| − | |||
| − | |||
=== Buy/Sell Payloads === | === Buy/Sell Payloads === | ||
| Line 454: | Line 464: | ||
==Stack Programming Reference Implementation== | ==Stack Programming Reference Implementation== | ||
| + | |||
| + | <pre style="color: red"> | ||
| + | Warning: | ||
| + | The following code is a reference implementation, it only serve the purpose to | ||
| + | assist you to observe the possibility and help you write your own code. | ||
| + | You must write your own code to fully enjoy the game. | ||
| + | </pre> | ||
=== Shuttle Cargoes Looking Glasses === | === Shuttle Cargoes Looking Glasses === | ||
| Line 675: | Line 692: | ||
* Repurpose the IC Housing of the Looking Glass section, label it <code>Trader Filtration IC Housing</code> or a name you like. | * Repurpose the IC Housing of the Looking Glass section, label it <code>Trader Filtration IC Housing</code> or a name you like. | ||
| − | * 1 [[Kit_(Logic_Memory)|Logic Memory]], install it and label it <code>SLM_ITEM_FILTER</code> | + | * 1 [[Kit_(Logic_Memory)|Logic Memory]], install it and label it <code>SLM_ITEM_FILTER</code>. |
| + | * 1 [[Kit_(Switch)#Switch|Logic Switch]] for switching filter prefab/gas data, label it <code>FILTER_GAS_SWITCH</code>. | ||
* 1 [[Console|Console]], install it as Small LED and label it <code>LED_LOCKED_SIGID</code>. | * 1 [[Console|Console]], install it as Small LED and label it <code>LED_LOCKED_SIGID</code>. | ||
* 1 [[Kit_(IC_Housing)|Kit (IC Housing)]], install it and label it <code>Dish Control IC Housing</code> or a name you like. | * 1 [[Kit_(IC_Housing)|Kit (IC Housing)]], install it and label it <code>Dish Control IC Housing</code> or a name you like. | ||
| Line 685: | Line 703: | ||
Installation: | Installation: | ||
| − | Install all things above and power on. For the repurposed <code>Trader Filtration IC Housing</code> code, paste in following code, replacing Looking Glass code(the Lookging Glass's function is still in the code, plus the filtration function), change the <code>DishM</code>'s name as you like. | + | Install all things above and power on. For the repurposed <code>Trader Filtration IC Housing</code> code, paste in following code, replacing Looking Glass code(the Lookging Glass's function is still in the code, plus the filtration function), change the <code>DishM</code>'s name as you like. |
| + | |||
| + | <pre style="color: red"> | ||
| + | Warning: | ||
| + | If you use a brand new IC10 chip for the Trader Filtration IC Housing, | ||
| + | you still need to initialize the IC10 chip with the code of Shuttle Cargoes Looking Glasses IC Stack Initializer, | ||
| + | or the stack will be empty as a stack is an IC10 CHIP property. | ||
| + | </pre> | ||
{{ICCode| | {{ICCode| | ||
define DishM HASH("Medium Satellite Dish 1") | define DishM HASH("Medium Satellite Dish 1") | ||
alias dishMID r15 | alias dishMID r15 | ||
| − | alias | + | alias filterGas r14 |
alias prefabMemCount r13 | alias prefabMemCount r13 | ||
alias totalMemCount r12 | alias totalMemCount r12 | ||
| Line 696: | Line 721: | ||
alias gasMemCursor r10 | alias gasMemCursor r10 | ||
alias sellOrBuy r9 | alias sellOrBuy r9 | ||
| − | |||
alias filterItem r7 | alias filterItem r7 | ||
alias signalID r6 | alias signalID r6 | ||
| − | + | move r5 0 # lastSignalID | |
| − | |||
mainloop: | mainloop: | ||
| − | move nextAddress | + | move r8 0 # nextAddress |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
WriteStack: | WriteStack: | ||
lbn dishMID HASH("StructureSatelliteDish") DishM ReferenceId Average | lbn dishMID HASH("StructureSatelliteDish") DishM ReferenceId Average | ||
| − | bnan dishMID | + | bnan dishMID mainloop |
lbn r0 HASH("StructureLogicSwitch2") HASH("TRADER_SELL_BUY_SWITCH") Open Average | lbn r0 HASH("StructureLogicSwitch2") HASH("TRADER_SELL_BUY_SWITCH") Open Average | ||
brgtz r0 3 | brgtz r0 3 | ||
| Line 719: | Line 737: | ||
sll r0 1 8 | sll r0 1 8 | ||
or r0 r0 TraderInstruction.WriteTraderData | or r0 r0 TraderInstruction.WriteTraderData | ||
| − | putd dishMID | + | putd dishMID r8 r0 |
| − | add | + | add r8 r8 4 |
| + | lbn filterGas HASH("StructureLogicSwitch2") HASH("FILTER_GAS_SWITCH") Setting Average | ||
lbn filterItem HASH("StructureLogicMemory") HASH("SLM_ITEM_FILTER") Setting Average | lbn filterItem HASH("StructureLogicMemory") HASH("SLM_ITEM_FILTER") Setting Average | ||
| − | breqz filterItem | + | breqz filterItem 8 # skip if filter value is 0 |
sll r0 filterItem 8 | sll r0 filterItem 8 | ||
| + | breqz filterGas 3 | ||
| + | or r0 r0 TraderInstruction.FilterGasContains | ||
| + | jr 2 | ||
or r0 r0 TraderInstruction.FilterPrefabHashEquals | or r0 r0 TraderInstruction.FilterPrefabHashEquals | ||
| − | putd dishMID | + | putd dishMID r8 r0 |
| − | add | + | add r8 r8 1 |
sll r0 30 16 | sll r0 30 16 | ||
| − | add r1 | + | add r1 r8 1 |
sll r1 r1 8 | sll r1 r1 8 | ||
or r0 r0 r1 | or r0 r0 r1 | ||
or r0 r0 sellOrBuy | or r0 r0 sellOrBuy | ||
| − | putd dishMID | + | putd dishMID r8 r0 |
yield | yield | ||
| − | |||
Display: | Display: | ||
lbn signalID HASH("StructureSatelliteDish") DishM SignalID Average | lbn signalID HASH("StructureSatelliteDish") DishM SignalID Average | ||
sbn HASH("StructureConsoleLED5") HASH("LED_SIGID") Setting signalID | sbn HASH("StructureConsoleLED5") HASH("LED_SIGID") Setting signalID | ||
| − | move | + | move r0 0 |
move prefabMemCursor 0 | move prefabMemCursor 0 | ||
move gasMemCursor prefabMemCount | move gasMemCursor prefabMemCount | ||
DisplayLoop: | DisplayLoop: | ||
| − | beq | + | beq r0 31 ClearMem |
| − | add | + | add r0 r0 1 |
| − | getd r0 | + | getd r1 dishMID r0 |
| − | and r1 | + | and r2 r1 %11111111 |
| − | beq | + | beq r2 2 MetaData1 |
| − | beq | + | beq r2 3 MetaData2 |
| − | beq | + | beq r2 4 MetaData3 |
| − | beq | + | beq r2 7 ThingData |
| − | beq | + | beq r2 8 ThingData |
| − | beq | + | beq r2 9 GasData |
| − | beq | + | beq r2 10 ThingData |
| − | beq | + | beq r2 11 GasData |
| − | beq | + | beq r2 12 ThingData |
j DisplayLoop | j DisplayLoop | ||
MetaData1: | MetaData1: | ||
| − | sra r2 | + | sra r2 r1 8 # trader contact type id |
sbn HASH("StructureConsoleLED5") HASH("LED_CON_TYPE_ID") Setting r2 | sbn HASH("StructureConsoleLED5") HASH("LED_CON_TYPE_ID") Setting r2 | ||
j DisplayLoop | j DisplayLoop | ||
MetaData2: | MetaData2: | ||
| − | and r2 | + | and r2 r1 %11111111_00000000_00000000_00000000 |
sra r2 r2 24 # contacted | sra r2 r2 24 # contacted | ||
sbn HASH("StructureConsoleLED5") HASH("LED_CONTACTED") Setting r2 | sbn HASH("StructureConsoleLED5") HASH("LED_CONTACTED") Setting r2 | ||
| − | and r2 | + | and r2 r1 %11111111_00000000_00000000 |
sra r2 r2 16 # tier | sra r2 r2 16 # tier | ||
sbn HASH("StructureConsoleLED5") HASH("LED_TIER") Setting r2 | sbn HASH("StructureConsoleLED5") HASH("LED_TIER") Setting r2 | ||
| − | and r2 | + | and r2 r1 %11111111_00000000 |
sra r2 r2 8 # shuttle type | sra r2 r2 8 # shuttle type | ||
sbn HASH("StructureConsoleLED5") HASH("LED_SHUTTLE_TYPE") Setting r2 | sbn HASH("StructureConsoleLED5") HASH("LED_SHUTTLE_TYPE") Setting r2 | ||
j DisplayLoop | j DisplayLoop | ||
MetaData3: | MetaData3: | ||
| − | and r2 | + | and r2 r1 %11111111_11111111_00000000 |
sra r2 r2 8 # watts to resolve | sra r2 r2 8 # watts to resolve | ||
sbn HASH("StructureConsoleLED5") HASH("LED_WATT_TO_RESOLVE") Setting r2 | sbn HASH("StructureConsoleLED5") HASH("LED_WATT_TO_RESOLVE") Setting r2 | ||
| − | and r2 | + | and r2 r1 $FFFF_000000 |
sra r2 r2 24 # lifetime | sra r2 r2 24 # lifetime | ||
sbn HASH("StructureConsoleLED5") HASH("LED_LIFETIME") Setting r2 | sbn HASH("StructureConsoleLED5") HASH("LED_LIFETIME") Setting r2 | ||
| Line 781: | Line 802: | ||
ThingData: | ThingData: | ||
get r2 db prefabMemCursor # memory chip | get r2 db prefabMemCursor # memory chip | ||
| − | sra r3 | + | sra r3 r1 16 # prefab hash |
| + | breqz filterItem 3 | ||
| + | bne filterItem r3 DisplayLoop | ||
| + | jal LockSignalID | ||
sbn HASH("StructureLogicMemory") r2 Setting r3 | sbn HASH("StructureLogicMemory") r2 Setting r3 | ||
add prefabMemCursor prefabMemCursor 1 | add prefabMemCursor prefabMemCursor 1 | ||
| − | j | + | j DisplayLoop |
GasData: | GasData: | ||
get r2 db gasMemCursor # memory chip | get r2 db gasMemCursor # memory chip | ||
| − | sra r3 | + | sra r3 r1 16 |
| + | sgtz r4 filterItem | ||
| + | and r4 r4 filterGas | ||
| + | breqz r4 4 | ||
| + | and r4 filterItem r3 | ||
| + | beqz r4 DisplayLoop | ||
| + | jal LockSignalID | ||
sbn HASH("StructureLogicMemory") r2 Setting r3 | sbn HASH("StructureLogicMemory") r2 Setting r3 | ||
add gasMemCursor gasMemCursor 1 | add gasMemCursor gasMemCursor 1 | ||
| − | + | j DisplayLoop | |
| − | + | LockSignalID: | |
| − | |||
| − | |||
lbn r4 HASH("StructureConsoleLED5") HASH("LED_LOCKED_SIGID") Setting Average | lbn r4 HASH("StructureConsoleLED5") HASH("LED_LOCKED_SIGID") Setting Average | ||
| − | bgtz r4 | + | bgtz r4 ra |
| − | beq signalID | + | beq signalID r5 ra |
sbn HASH("StructureConsoleLED5") HASH("LED_LOCKED_SIGID") Setting signalID | sbn HASH("StructureConsoleLED5") HASH("LED_LOCKED_SIGID") Setting signalID | ||
| − | move | + | move r5 signalID |
| − | j | + | j ra |
| − | + | ClearMem: | |
move sp prefabMemCursor | move sp prefabMemCursor | ||
| − | + | brge sp prefabMemCount 5 | |
| − | |||
add sp sp 1 | add sp sp 1 | ||
peek r0 # memory chip | peek r0 # memory chip | ||
sbn HASH("StructureLogicMemory") r0 Setting -1 | sbn HASH("StructureLogicMemory") r0 Setting -1 | ||
| − | + | jr -4 | |
| − | |||
move sp gasMemCursor | move sp gasMemCursor | ||
| − | + | bge sp totalMemCount mainloop | |
| − | bge sp totalMemCount | ||
add sp sp 1 | add sp sp 1 | ||
peek r0 # memory chip | peek r0 # memory chip | ||
sbn HASH("StructureLogicMemory") r0 Setting -1 | sbn HASH("StructureLogicMemory") r0 Setting -1 | ||
| − | + | jr -4 | |
}} | }} | ||
| Line 837: | Line 862: | ||
move r6 DishM # scanDish | move r6 DishM # scanDish | ||
move r5 r7 # scanDishType | move r5 r7 # scanDishType | ||
| − | sbn r5 r6 Vertical | + | sbn r5 r6 Vertical 60 |
sbn r5 r6 BestContactFilter -1 | sbn r5 r6 BestContactFilter -1 | ||
| + | sbn r5 r6 Setting 500 | ||
mainloop: | mainloop: | ||
yield | yield | ||
| Line 879: | Line 905: | ||
j mainloop | j mainloop | ||
bnez r15 reset | bnez r15 reset | ||
| − | |||
breq r6 DishM 2 # enter roaming mode | breq r6 DishM 2 # enter roaming mode | ||
sbn r5 r6 On 0 | sbn r5 r6 On 0 | ||
| Line 951: | Line 976: | ||
}} | }} | ||
| − | + | The last step is to set the item prefab hash you want. First set the <code>FILTER_GAS_SWITCH</code> to indicate the type of the filter(<code>Open</code> is filtering Gas, <code>Close</code> is filtering Prefab), then set the content of [[Kit_(Logic_Memory)|Logic Memory]] named <code>SLM_ITEM_FILTER</code> using labeler or any other means, then power both IC Housing on. Then wait for the trader to arrive, there will be a notification send to your Hardsuit or your custom device. The codes will auto locate the shuttle and filter shuttle cargoes and interrogate with it and call it down to your default landing pad. | |
| − | |||
| − | The last step is to set the item prefab hash you want. | ||
Don't forget to reset the content of <code>SLM_ITEM_FILTER</code> to <code>0</code> or something else after trading. | Don't forget to reset the content of <code>SLM_ITEM_FILTER</code> to <code>0</code> or something else after trading. | ||
The logic behind the Dish Control is that it scan the signal edge of the filtered out SignalID, instead of inspecting signal strength, so it kind of fast and non-stop rotating. When no filter is specified, it enters roaming mode which rotate clock-wise until filter is specficied and matching shuttle is found. | The logic behind the Dish Control is that it scan the signal edge of the filtered out SignalID, instead of inspecting signal strength, so it kind of fast and non-stop rotating. When no filter is specified, it enters roaming mode which rotate clock-wise until filter is specficied and matching shuttle is found. | ||
Latest revision as of 20:17, 15 November 2025
![]() | |
| Properties | |
|---|---|
| Stacks | Yes (10) |
| Recipe | |
| Created With | Electronics Printer |
| Cost | 5g Gold, 10g Copper, 20g Steel, 5g Nickel, 10g Solder |
![]() | |
| Operation | |
|---|---|
| Power Usage | 200W |
| Construction | |
| Placed with | Kit (Satellite Dish) |
| Placed on | Small Grid |
| Stage 1 | |
| Deconstruction | |
| Deconstructed with | Hand Drill |
| Item received | Kit (Satellite Dish) |
Contents
Description[edit]
The Satellite Dish is used together with a Computer fitted with a Motherboard (Communications) to allow Interstellar Communications.
The Satellite Dish must be guided by Satellite Tracking onto a signal and communications may be established once the signal strength is greater than 94%
Important: The Dish must not be obstructed, it needs direct line of sight and will be blocked by any obstacle.
Medium Satellite Dish[edit]
Data Network Properties[edit]
Input Data (Write)[edit]
These are all parameters, that can be written to with different means of using logic.
| Parameter Name | Data Type | Value | Description |
|---|---|---|---|
| On | Boolean | 0 | Turns the device off. Also toggles the switch accordingly. |
| 1 | Turns the device on. Also toggles the switch accordingly. | ||
| Activate | Boolean | 0 | If the vessel's being interrogated, stop interrogating the vessel; or nothing. |
| 1 | If the vessel's has not been interrogated, start interrogating the vessel. If the vessel has been interrogated, call down the vessel to the TargetPadIndex. | ||
| Setting | Integer | 0 ~ Max watts of device. | Set output watts to the specified number. |
| Horizontal | Integer | 0 ~ 360 | Set dish's horizontal angle to the specified number. |
| Vertical | Integer | 0 ~ 90 | Set dish's vertical angle to the specified number. |
| TargetPadIndex | Integer | Sets the landing pad index for potential call down. | |
| BestContactFilter | Integer | Lock dish to track the specified ContactIDHash ONLY, set to -1 to unlock.
| |
| Update 0.2.5888.25957 - Sun 7/9/2025 /Data_Network | |||
Output Data (Read)[edit]
These are all parameters, that can be read by using different means of logic.
| Parameter Name | Data Type | Value | Description |
|---|---|---|---|
| On | Boolean | 0 | The Dish is not powered. This is the same as the physical red powerswitch located on the structure. |
| 1 | The Dish is powered. This is the same as the physical red powerswitch located on the structure. | ||
| Activate | Boolean | 0 | Read out current Activate value; if Activate == 1, it means the dish is either interrogating the vessel or the vessel is just coming down to landing pad. |
| Setting | Integer | Read out current dish's output watts. | |
| Horizontal | Integer | Read out current dish's horizontal angle. | |
| Vertical | Integer | Read out current dish's vertical angle. | |
| RequiredPower | Integer | Idle operating power quantity. Does not include extra power during actual usage. | |
| Idle | Boolean | Read out if the dish is not moving. | |
| Idle | Boolean | 0 | Dish not moving, and not interrogating. |
| 1 | Dish is either moving or interrogating. | ||
| Error | Boolean | 0 | 1 if device is in error state, otherwise 0. |
| 1 | 1 if device is in error state, otherwise 0. | ||
| SignalStrength | Integer | The signal strength of currently tracking signal, negative value, larger is better. If the dish is moving, this value always show -1.
| |
| SignalID | Integer | The signal IDHASH of currently tracking signal. | |
| InterrogationProcess | Integer | This value only has meaning if the dish has started interrogation to the vessel. Show's percentage on the process of the interrogation. | |
| TargetPadIndex | Integer | Read out current value of target landing pad index, useful if you want to call down the vessel by code. | |
| SizeX | Integer | The length on X axis of the vessel, see SHUTTLE_TYPE. | |
| SizeZ | Integer | The length on Z axis of the vessel, see SHUTTLE_TYPE. | |
| Reagents | Integer | Total number of reagents inside the device (e.g. 92g of iron = 92). | |
| MinimumWattsToContact | Integer | The minimum watts required reaching target vessel before one can initiate interrogation. This is the requirement imposed by the vessel. | |
| WattsReachingContact | Integer | The current effective watts reached target vessel due to angle setting and dish's watts output setting. | |
| ContactTypeId | Integer | The category of the vessel, see ContactTypeID. | |
| BestContactFilter | Integer | Currently locked ContactID, or -1 if not set.
| |
| StackSize | Integer | Read out the stack Byte count of the structure. | |
| NameHash | Integer | The hash of the custom name of the structure. | |
| PrefabHash | Integer | The hash of the structure. | |
| Referenceld | Integer | Unique Reference Identifier for this object. | |
| Update 0.2.5888.25957 - Sun 7/9/2025 /Data_Network | |||
Stack Usage[edit]
After "Big Changes Coming: Terrain Preview, Melting Ice, Modding, & Localization" update, Medium Satellite Dish has internal stack like Autolathe, which user can utilize it to give instructions to. The Medium Satellite Dish currently have 256Bytes(32 Addresses) stack memory.
Pro tips:
- Everyday there will be only 3 vessels, one for each shuttle tier.
- Everyday the 3 vessels will be refreshed, the algorithm for which type of vessel to appear is random, but strictly 1 for each tier.
- It's best to use 500 watts if you are using medium satellite dish to scan, 500 watts is just large enough for the FAR tier to appear on the radar, but small enough for it's signal being masked by lower tier shuttles.
Warning: Internally every tick the stack data will be cleared and regenerated, so don't OVERWRITE any TraderInstruction.Write* instructions when setting the WRITE_INDEX and WRITE_COUNT.
| Op_code | Name | Description | Valid Address | Bits | Bits Description |
|---|---|---|---|---|---|
| 1 | TraderInstruction.WriteTraderData | The dish will write out metadata(24 Bytes, in continuous of 3 addresses) to the specified starting index. E.g.: if set WRITE_INDEX to 1, then the metadata will span address 1-3. See Metadata Payloads. | 0-31 | 0-7 | Op_code |
| 8-15 | WRITE_INDEX | ||||
| 16-63 | Unused | ||||
| 2 | TraderInstruction.StrongestContactIdHash | This OpCode indicates the data generated by TraderInstruction.WriteTraderData payload segment 1. | 0-31 | 0-7 | Op_code |
| 8-39 | TRADER_ID_HASH | ||||
| 40-63 | Unused | ||||
| 3 | TraderInstruction.StrongestContactMetaData | This OpCode indicates the data generated by TraderInstruction.WriteTraderData payload segment 2. | 0-31 | 0-7 | Op_code |
| 8-15 | SHUTTLE_TYPE. | ||||
| 16-23 | CONTACT_TIER. | ||||
| 24-31 | CONTACTED. | ||||
| 32-63 | Unused | ||||
| 4 | TraderInstruction.StrongestContactSignalData | This OpCode indicates the data generated by TraderInstruction.WriteTraderData payload segment 3. | 0-31 | 0-7 | Op_code |
| 8-23 | WATTS_TO_RESOLVE See WattsToResolve. | ||||
| 24-39 | LIFETIME See LifeTime. | ||||
| 32-63 | Unused | ||||
| 5 | TraderInstruction.WriteTraderBuyData | The dish will write out trader buy metadatas from the starting address WRITE_INDEX, and write WRITE_COUNT continuous addresses total. If an item contains child items, then it will be expaned inplace. E.g.: <BuyPayload><BuyPayload><BuyChildPayload><BuyPayload>. See Buy/Sell Payloads, Buy/Sell Child Payloads. WRITE_COUNT=0 means WRITE_COUNT=1. |
0-31 | 0-7 | Op_code |
| 8-15 | WRITE_INDEX | ||||
| 16-23 | WRITE_COUNT | ||||
| 24-63 | Unused | ||||
| 6 | TraderInstruction.WriteTraderSellData | The dish will write out trader sell metadatas from the starting address WRITE_INDEX, and write WRITE_COUNT continuous addresses total. If an item contains child items, then it will be expaned inplace. E.g.: <SellPayload><SellPayload><SellChildPayload><SellPayload>. See Buy/Sell Payloads, Buy/Sell Child Payloads. WRITE_COUNT=0 means WRITE_COUNT=1. |
0-31 | 0-7 | Op_code |
| 8-15 | WRITE_INDEX | ||||
| 16-23 | WRITE_COUNT | ||||
| 24-63 | Unused | ||||
| 7 | TraderInstruction.TraderBuyThingData | This OpCode indicates the data generated by TraderInstruction.WriteTraderBuyData. | 0-31 | 0-7 | Op_code |
| 8-15 | QUANTITY | ||||
| 16-47 | PREFAB_HASH | ||||
| 48-63 | Unused | ||||
| 8 | TraderInstruction.TraderBuyThingChildData | This OpCode indicates the data generated by TraderInstruction.WriteTraderBuyData. | 0-31 | 0-7 | Op_code |
| 8-15 | QUANTITY | ||||
| 16-47 | PREFAB_HASH | ||||
| 48-63 | Unused | ||||
| 9 | TraderInstruction.TraderBuyGasData | This OpCode indicates the data generated by TraderInstruction.WriteTraderBuyData. | 0-31 | 0-7 | Op_code |
| 8-15 | QUANTITY | ||||
| 16-47 | GAS_TYPES_BITFLAG See Gas_Type_BitFlags. | ||||
| 48-63 | Unused | ||||
| 10 | TraderInstruction.TraderSellThingData | This OpCode indicates the data generated by TraderInstruction.WriteTraderSellData. | 0-31 | 0-7 | Op_code |
| 8-15 | QUANTITY | ||||
| 16-47 | PREFAB_HASH | ||||
| 48-63 | Unused | ||||
| 11 | TraderInstruction.TraderSellGasData | This OpCode indicates the data generated by TraderInstruction.WriteTraderSellData. | 0-31 | 0-7 | Op_code |
| 8-15 | QUANTITY | ||||
| 16-47 | GAS_TYPES_BIGFLAG See Gas_Type_BitFlags. | ||||
| 48-63 | Unused | ||||
| 12 | TraderInstruction.TraderSellThingChildData | This OpCode indicates the data generated by TraderInstruction.WriteTraderSellData. | 0-31 | 0-7 | Op_code |
| 8-15 | QUANTITY | ||||
| 16-47 | PREFAB_HASH | ||||
| 48-63 | Unused | ||||
| 13 | TraderInstruction.FilterPrefabHashEquals | Filter Operation. User can prepend this OP before any TraderInstruction.Write* OP to filter writer's output. Multple filter OP can be written to the addresses before a Write* OP to group as a "AND" condition. This Filter narrows Write* OP's output to only matching PrefabHash. |
1-30 | 0-7 | Op_code |
| 8-39 | PREFAB_HASH | ||||
| 40-63 | Unused | ||||
| 14 | TraderInstruction.FilterPrefabHashNotEquals | Filter Operation. User can prepend this OP before any TraderInstruction.Write* OP to filter writer's output. Multple filter OP can be written to the addresses before a Write* OP to group as a "AND" condition. This Filter narrows Write* OP's output to only not matching PrefabHash. |
1-30 | 0-7 | Op_code |
| 8-39 | PREFAB_HASH | ||||
| 40-63 | Unused | ||||
| 15 | TraderInstruction.FilterSortingClassCompare | Filter Operation. User can prepend this OP before any TraderInstruction.Write* OP to filter writer's output. Multple filter OP can be written to the addresses before a Write* OP to group as a "AND" condition. This Filter narrows Write* OP's output to only matching SortingClass. |
1-30 | 0-7 | Op_code |
| 8-15 | CONDITION_OPERATION 0: Equals 1: Greater 2: Less 3: Not Equals | ||||
| 16-31 | SORTING_CLASS See Sorting_Class. | ||||
| 32-63 | Unused | ||||
| 16 | TraderInstruction.FilterQuantityCompare | Filter Operation. User can prepend this OP before any TraderInstruction.Write* OP to filter writer's output. Multple filter OP can be written to the addresses before a Write* OP to group as a "AND" condition. This Filter narrows Write* OP's output to only matching Quantity Condition. |
1-30 | 0-7 | Op_code |
| 8-15 | CONDITION_OPERATION 0: Equals 1: Greater 2: Less 3: Not Equals | ||||
| 16-31 | QUANTITY | ||||
| 32-63 | Unused | ||||
| 17 | TraderInstruction.FilterGasContains | Filter Operation. User can prepend this OP before any TraderInstruction.Write* OP to filter writer's output. Multple filter OP can be written to the addresses before a Write* OP to group as a "AND" condition. This Filter narrows Write* OP's output to only matching Gases. |
1-30 | 0-7 | Op_code |
| 8-39 | GAS_TYPES_BITFLAG See Gas_Type_BitFlags. | ||||
| 40-63 | Unused | ||||
| 18 | TraderInstruction.FilterGasNotContains | Filter Operation. User can prepend this OP before any TraderInstruction.Write* OP to filter writer's output. Multple filter OP can be written to the addresses before a Write* OP to group as a "AND" condition. This Filter narrows Write* OP's output to only not matching Gases. |
1-30 | 0-7 | Op_code |
| 8-39 | GAS_TYPES_BITFLAG See Gas_Type_BitFlags. | ||||
| 40-63 | Unused |
Metadata Payloads[edit]
Since Metadata has 3 addresses, so it's referenced here as a 24 bytes(192 bits) payload.
| BitsOffset | 63-40 | 39-8 | 7-0 | ||
|---|---|---|---|---|---|
| Segment 1 | All bits value in this section is the deplicate of bit 39. | TraderIdHash | OpCode of TraderInstruction.StrongestContactIdHash. | ||
| BitsOffset | 63-32 | 31-24 | 23-16 | 15-8 | 7-0 |
| Segment 2 | All bits 0. | Contacted 0: false 1: true |
Contact Tier: 0: Close 1: Medium 2: Far |
Shuttle Type: 0:None 1: Small(3x3) 2: SmallGas(3x3) 3: Medium(5x5) 4: MediumGas(5x5) 5: Large(6x6) 6: LargeGas(6x6) 7: MediumPlane(7x7, runway:15) 8: LargePlane(9x9, runway:20) |
OpCode of TraderInstruction.StrongestContactMetaData. |
| BitsOffset | 63-40 | 39-24 | 23-8 | 7-0 | |
| Segment 3 | ALl bits 0. | LifeTime | WattsToResolve | OpCode of TraderInstruction.StrongestContactSignalData. |
Buy/Sell Payloads[edit]
Buy/Sell Payloads are 1 address each, so it's referenced here as a 8 bytes(64 bit) payload.
| BitsOffset | 63-48 | 47-16 | 15-8 | 7-0 |
|---|---|---|---|---|
| Contents | Every bit's value is the same as bit 47. | PrefabHash/GasTypeBitFlag | Quantity This value is truncated so it won't be greater than 255 although the trader's Request/Stock is more than 255. |
OpCode Data type represented as OpCode, one of the OpCode 7, 9, 10, 11. |
Buy/Sell Child Payloads[edit]
Buy/Sell Payloads are 1 address each, so it's referenced here as a 8 bytes(64 bit) payload.
| BitsOffset | 63-48 | 47-16 | 15-8 | 7-0 |
|---|---|---|---|---|
| Contents | Every bit's value is the same as bit 47. | PrefabHash/GasTypeBitFlag | ChildCount Counts how many instances of this item appeared as a child item. Beware it's not quantity, it's just a prefab type count. |
OpCode If this data is requested by TraderInstruction.WriteTraderBuyData, then it's value is the OpCode of TraderInstruction.TraderBuyThingChildData. If this data is requested by TraderInstruction.WriteTraderSellData, then it's value is the OpCode of TraderInstruction.TraderSellThingChildData. |
Gas Type BitFlags[edit]
If the BitFlag equals 0, it's undefined. If the bit at specific offset is 1, it means the gas contains that component.
| BitsOffset | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Contents | PollutedWater | LiquidHydrogen | Hydrogen | LiquidNitrousOxide | LiquidPollutant | LiquidCarbonDioxide | Steam | LiquidVolatiles | LiquidOxygen | LiquidNitrogen | NitrousOxide | Water | Pollutant | Volatiles | CarbonDioxide | Nitrogen | Oxygen |
Special Gas:
- Bit 0,1 both set to 1, which is Air.
- Bit 0,3 both set to 1, which is Fuel.
Stack Programming Reference Implementation[edit]
Warning: The following code is a reference implementation, it only serve the purpose to assist you to observe the possibility and help you write your own code. You must write your own code to fully enjoy the game.
Shuttle Cargoes Looking Glasses[edit]
The Looking Glasses are purely for cargo inspection, no filter, no auto negotiate and call-down.
Materials to prepare:
- A Medium Satellite Dish.
- Any number of Logic Memories for Prefab Console display (if there are more Prefabs to display than your number of Logic Memories, they will be ignored).
- Corresponding number of Hash Displays and Consoles.
- Any number of Logic Memories for Gas Console display, (if there are more GasLiquid to display than your number of Logic Memories, they will be ignored).
- Corresponding number of Hash Displays and Consoles.
- 1 Logic Switch for switch trader's sell/buy data.
- 6 Console for Small LED installation (all will show metadata).
- 1 Kit (IC Housing) and 1 Integrated Circuit (IC10).
Installation:
- Install all of the Logic Memories.
- Install corresponding Prefab Consoles, insert Hash Displays, and make sure the Hash Displays are set to Prefab display mode:
Mode=0 - Install corresponding Gas Consoles, insert Hash Displays, and make sure the Hash Displays are set to GasLiquid display mode:
Mode=1
# example for setup GasLiquid mode ss d0 0 Mode 1 # d0 is console pin # or configure all the Consoles in the IcHousing's subnetwork sbs StructureConsole 0 Mode 1
- Naming each Logic Memory sequentially for two display types, for example:
SLMP1,SLMP2for Prefab display, andSLMG1,SLMG2for GasLiquid display. - Manually configure all Consoles to link to their corresponding Logic Memories with Data Disk.
- Install 1 Logic Switch for switch trader's sell/buy data,
Openshows trader's Buy data,Closeshows trader's Sell data. Label itTRADER_SELL_BUY_SWITCH. - Install 1 Kit (IC Housing) in the same subnetwork and label it
Cargo LG IC Housing, insert a Integrated Circuit (IC10). - Install 6 LED and labeling them:
LED_SIGID,LED_CON_TYPE_ID,LED_TIER,LED_SHUTTLE_TYPE,LED_WATT_TO_RESOLVE,LED_CONTACTED.
Reference Implementation:
Next are the code snippets for a setup of 20 Prefab Console and 11 GasLiquid Console looking glass.
First snippet is the initialization/configuration code, which should be write to the Integrated Circuit (IC10) for the first time, add/remove the Logic Memories stack entries that you actually used in your setup, then install the chip to housing.
# Shuttle Cargoes Looking Glasses IC Stack Initializer
clr db
move sp 0
# Prefab display Logic Memories, add/remove according to your setup.
push HASH("SLMP1")
push HASH("SLMP2")
push HASH("SLMP3")
push HASH("SLMP4")
push HASH("SLMP5")
push HASH("SLMP6")
push HASH("SLMP7")
push HASH("SLMP8")
push HASH("SLMP9")
push HASH("SLMP10")
push HASH("SLMP11")
push HASH("SLMP12")
push HASH("SLMP13")
push HASH("SLMP14")
push HASH("SLMP15")
push HASH("SLMP16")
push HASH("SLMP17")
push HASH("SLMP18")
push HASH("SLMP19")
push HASH("SLMP20")
move r13 sp
# GasLiquid display Logic Memories, add/remove according to your setup.
push HASH("SLMG1")
push HASH("SLMG2")
push HASH("SLMG3")
push HASH("SLMG4")
push HASH("SLMG5")
push HASH("SLMG6")
push HASH("SLMG7")
push HASH("SLMG8")
push HASH("SLMG9")
push HASH("SLMG10")
push HASH("SLMG11")
move r12 sp
Second snippet is for the same Integrated Circuit (IC10), take your IC10 chip out re-put it into the laptop, clear and paste in the new second code snippet.
There are a few user variables need to modify, please check the in-line comments. Mostly that's for LEDs to display metadata. Change the variables accordingly then insert the IC10 chip into the housing.
# Shuttle Cargoes Looking Glasses Runtime IC10
#
# User variable:
#
# DishM: The Medium Dish hash.
# LED_SIGID: The LED name, show SignalID.
# LED_CON_TYPE_ID: The LED name, show ContactTypeID.
# LED_TIER: The LED name, show Tier.
# LED_SHUTTLE_TYPE: The LED name, show Shuttle Type.
# LED_CONTACTED: The LED name, show if the shuttle has been contacted already.
define DishM HASH("Medium Satellite Dish 1")
define LED_SIGID HASH("LED_SIGID")
define LED_CON_TYPE_ID HASH("LED_CON_TYPE_ID")
define LED_TIER HASH("LED_TIER")
define LED_SHUTTLE_TYPE HASH("LED_SHUTTLE_TYPE")
define LED_WATT_TO_RESOLVE HASH("LED_WATT_TO_RESOLVE")
define LED_CONTACTED HASH("LED_CONTACTED")
define TRADER_BUY_SEEL_SWITCH HASH("TRADER_SELL_BUY_SWITCH")
###############################################################################
define SSD HASH("StructureSatelliteDish")
define SLM HASH("StructureLogicMemory")
define OpcodeMask %11111111
alias dishMID r15
alias dishEntryCount r14
alias prefabMemCount r13
alias totalMemCount r12
alias prefabMemCursor r11
alias gasMemCursor r10
alias sellOrBuy r9
mainloop:
jal WriteStack
jal Display
jal ClearPrefabMem
jal ClearGasMem
sleep 1
j mainloop
WriteStack:
lbn dishMID SSD DishM ReferenceId Average
bnan dishMID ra
lbn r0 HASH("StructureLogicSwitch2") TRADER_BUY_SEEL_SWITCH Open Average
brgtz r0 3
move sellOrBuy TraderInstruction.WriteTraderSellData
jr 2
move sellOrBuy TraderInstruction.WriteTraderBuyData
clrd dishMID
sll r0 1 8
or r0 r0 TraderInstruction.WriteTraderData
putd dishMID 0 r0
sll r0 30 16
sll r1 5 8
or r0 r0 r1
or r0 r0 sellOrBuy
putd dishMID 4 r0
sleep 1
j ra
Display:
lbn r1 SSD DishM SignalID Average
sbn HASH("StructureConsoleLED5") LED_SIGID Setting r1
move dishEntryCount 0
move prefabMemCursor 0
move gasMemCursor prefabMemCount
DisplayLoop:
beq dishEntryCount 31 ra
add dishEntryCount dishEntryCount 1
getd r0 dishMID dishEntryCount
and r1 r0 OpcodeMask
beq r1 2 MetaData1
beq r1 3 MetaData2
beq r1 4 MetaData3
beq r1 7 ThingData
beq r1 8 ThingData
beq r1 9 GasData
beq r1 10 ThingData
beq r1 11 GasData
beq r1 12 ThingData
j DisplayLoop
MetaData1:
sra r2 r0 8 # trader contact type id
sbn HASH("StructureConsoleLED5") LED_CON_TYPE_ID Setting r2
j DisplayLoop
MetaData2:
and r2 r0 %11111111_00000000_00000000_00000000
sra r2 r2 24 # contacted
sbn HASH("StructureConsoleLED5") LED_CONTACTED Setting r2
and r2 r0 %11111111_00000000_00000000
sra r2 r2 16 # tier
sbn HASH("StructureConsoleLED5") LED_TIER Setting r2
and r2 r0 %11111111_00000000
sra r2 r2 8 # shuttle type
sbn HASH("StructureConsoleLED5") LED_SHUTTLE_TYPE Setting r2
j DisplayLoop
MetaData3:
and r2 r0 %11111111_11111111_00000000
sra r2 r2 8 # watts to resolve
sbn HASH("StructureConsoleLED5") LED_WATT_TO_RESOLVE Setting r2
j DisplayLoop
ThingData:
get r2 db prefabMemCursor # memory chip
sra r3 r0 16 # prefab hash
sbn SLM r2 Setting r3
add prefabMemCursor prefabMemCursor 1
j DisplayLoop
GasData:
get r2 db gasMemCursor # memory chip
sra r3 r0 16
sbn SLM r2 Setting r3
add gasMemCursor gasMemCursor 1
j DisplayLoop
ClearPrefabMem:
move sp prefabMemCursor
ClearPrefabMemLoop:
bge sp prefabMemCount ra
add sp sp 1
peek r0 # memory chip
sbn SLM r0 Setting -1
j ClearPrefabMemLoop
ClearGasMem:
move sp gasMemCursor
ClearGasMemLoop:
bge sp totalMemCount ra
add sp sp 1
peek r0 # memory chip
sbn SLM r0 Setting -1
j ClearGasMemLoop
Final: Now enable the Medium Satellite Dish, enable the Cargo LG IC Housing(the 2nd script should be running), add some power to the dish and rotate it somehow, then check the monitors and LEDs, you will see the items you can shop(trader will sell) from this trader if the logic switch is closed, and you will see the items you can sell(trader will buy) from the best trader if the logic switch is open.
The total setup feels like this
Shuttle Cargoes Auto Filtration/Interrogation and Call Down[edit]
To add Auto Filtration/Interrogation ability, prepare following materials in advance. It's build on top of Looking Glass structure of the previous section, take caution.
- Repurpose the IC Housing of the Looking Glass section, label it
Trader Filtration IC Housingor a name you like. - 1 Logic Memory, install it and label it
SLM_ITEM_FILTER. - 1 Logic Switch for switching filter prefab/gas data, label it
FILTER_GAS_SWITCH. - 1 Console, install it as Small LED and label it
LED_LOCKED_SIGID. - 1 Kit (IC Housing), install it and label it
Dish Control IC Housingor a name you like. - 1 Integrated Circuit (IC10) ready for use.
- 1 Logic Transmitter for sending audio message to your Hardsuit when trader is landing, label it
Hardsuit LT 1, pair it with your hardsuit in passive mode. - 1 Small Satellite Dish for faster Close/Medium shuttle scanning, optional. If you set it up, the power port must face the same direction as the Medium Dish. If you don't, it just take a few more time to scan with the default Medium Satellite Dish for Close/Medium tier shuttles.
- 1 Large Satellite Dish for faster Far tier shuttle interrogation, optional. If you set it up, the power port must face the same direction as the Medium Dish. If you don't, it just take a few more time to interrogate with the default Medium Satellite Dish for Far tier shuttles.
Installation:
Install all things above and power on. For the repurposed Trader Filtration IC Housing code, paste in following code, replacing Looking Glass code(the Lookging Glass's function is still in the code, plus the filtration function), change the DishM's name as you like.
Warning: If you use a brand new IC10 chip for the Trader Filtration IC Housing, you still need to initialize the IC10 chip with the code of Shuttle Cargoes Looking Glasses IC Stack Initializer, or the stack will be empty as a stack is an IC10 CHIP property.
define DishM HASH("Medium Satellite Dish 1")
alias dishMID r15
alias filterGas r14
alias prefabMemCount r13
alias totalMemCount r12
alias prefabMemCursor r11
alias gasMemCursor r10
alias sellOrBuy r9
alias filterItem r7
alias signalID r6
move r5 0 # lastSignalID
mainloop:
move r8 0 # nextAddress
WriteStack:
lbn dishMID HASH("StructureSatelliteDish") DishM ReferenceId Average
bnan dishMID mainloop
lbn r0 HASH("StructureLogicSwitch2") HASH("TRADER_SELL_BUY_SWITCH") Open Average
brgtz r0 3
move sellOrBuy TraderInstruction.WriteTraderSellData
jr 2
move sellOrBuy TraderInstruction.WriteTraderBuyData
clrd dishMID
sll r0 1 8
or r0 r0 TraderInstruction.WriteTraderData
putd dishMID r8 r0
add r8 r8 4
lbn filterGas HASH("StructureLogicSwitch2") HASH("FILTER_GAS_SWITCH") Setting Average
lbn filterItem HASH("StructureLogicMemory") HASH("SLM_ITEM_FILTER") Setting Average
breqz filterItem 8 # skip if filter value is 0
sll r0 filterItem 8
breqz filterGas 3
or r0 r0 TraderInstruction.FilterGasContains
jr 2
or r0 r0 TraderInstruction.FilterPrefabHashEquals
putd dishMID r8 r0
add r8 r8 1
sll r0 30 16
add r1 r8 1
sll r1 r1 8
or r0 r0 r1
or r0 r0 sellOrBuy
putd dishMID r8 r0
yield
Display:
lbn signalID HASH("StructureSatelliteDish") DishM SignalID Average
sbn HASH("StructureConsoleLED5") HASH("LED_SIGID") Setting signalID
move r0 0
move prefabMemCursor 0
move gasMemCursor prefabMemCount
DisplayLoop:
beq r0 31 ClearMem
add r0 r0 1
getd r1 dishMID r0
and r2 r1 %11111111
beq r2 2 MetaData1
beq r2 3 MetaData2
beq r2 4 MetaData3
beq r2 7 ThingData
beq r2 8 ThingData
beq r2 9 GasData
beq r2 10 ThingData
beq r2 11 GasData
beq r2 12 ThingData
j DisplayLoop
MetaData1:
sra r2 r1 8 # trader contact type id
sbn HASH("StructureConsoleLED5") HASH("LED_CON_TYPE_ID") Setting r2
j DisplayLoop
MetaData2:
and r2 r1 %11111111_00000000_00000000_00000000
sra r2 r2 24 # contacted
sbn HASH("StructureConsoleLED5") HASH("LED_CONTACTED") Setting r2
and r2 r1 %11111111_00000000_00000000
sra r2 r2 16 # tier
sbn HASH("StructureConsoleLED5") HASH("LED_TIER") Setting r2
and r2 r1 %11111111_00000000
sra r2 r2 8 # shuttle type
sbn HASH("StructureConsoleLED5") HASH("LED_SHUTTLE_TYPE") Setting r2
j DisplayLoop
MetaData3:
and r2 r1 %11111111_11111111_00000000
sra r2 r2 8 # watts to resolve
sbn HASH("StructureConsoleLED5") HASH("LED_WATT_TO_RESOLVE") Setting r2
and r2 r1 $FFFF_000000
sra r2 r2 24 # lifetime
sbn HASH("StructureConsoleLED5") HASH("LED_LIFETIME") Setting r2
j DisplayLoop
ThingData:
get r2 db prefabMemCursor # memory chip
sra r3 r1 16 # prefab hash
breqz filterItem 3
bne filterItem r3 DisplayLoop
jal LockSignalID
sbn HASH("StructureLogicMemory") r2 Setting r3
add prefabMemCursor prefabMemCursor 1
j DisplayLoop
GasData:
get r2 db gasMemCursor # memory chip
sra r3 r1 16
sgtz r4 filterItem
and r4 r4 filterGas
breqz r4 4
and r4 filterItem r3
beqz r4 DisplayLoop
jal LockSignalID
sbn HASH("StructureLogicMemory") r2 Setting r3
add gasMemCursor gasMemCursor 1
j DisplayLoop
LockSignalID:
lbn r4 HASH("StructureConsoleLED5") HASH("LED_LOCKED_SIGID") Setting Average
bgtz r4 ra
beq signalID r5 ra
sbn HASH("StructureConsoleLED5") HASH("LED_LOCKED_SIGID") Setting signalID
move r5 signalID
j ra
ClearMem:
move sp prefabMemCursor
brge sp prefabMemCount 5
add sp sp 1
peek r0 # memory chip
sbn HASH("StructureLogicMemory") r0 Setting -1
jr -4
move sp gasMemCursor
bge sp totalMemCount mainloop
add sp sp 1
peek r0 # memory chip
sbn HASH("StructureLogicMemory") r0 Setting -1
jr -4
For the Dish Control IC Housing code, paste in following code, change the hash of DishS and DishL names as you have then setted up or not. Search and change the name of Hardsuit LT 1 line if you want to send notification to other devices.
define DishM HASH("Medium Satellite Dish 1")
define DishS 0 # if you have small dish, set hash to HASH("NAME")
define DishL 0 # if you have large dish, set hash to HASH("NAME")
move r0 0
reset:
move r15 r0 # lockedSigID
move r14 0 # horizontal
move r13 0 # vertical
move r12 0 # horizontalEdge1
move r11 0 # horizontalEdge2
move r10 0 # verticalEdge1
move r9 0 # verticalEdge2
move r8 DishM # commDish
move r7 HASH("StructureSatelliteDish") # commDishType
move r6 DishM # scanDish
move r5 r7 # scanDishType
sbn r5 r6 Vertical 60
sbn r5 r6 BestContactFilter -1
sbn r5 r6 Setting 500
mainloop:
yield
lbn r0 HASH("StructureConsoleLED5") HASH("LED_LOCKED_SIGID") Setting Average
lbn r1 r5 r6 SignalID Average
lbn r2 r5 r6 Horizontal Average
lbn r3 r5 r6 Vertical Average
breqz r0 34
bne r0 r15 reset
lbn r4 HASH("StructureConsoleLED5") HASH("LED_TIER") Setting Average
brnez r14 10
brge r4 2 5
breqz DishS 4
move r6 DishS
move r5 HASH("StructureSmallSatelliteDish")
sbn r5 r6 Setting 200
breqz DishL 3
move r8 DishL
move r7 HASH("StructureLargeSatelliteDish")
sbn r5 r6 BestContactFilter r15
sbn r5 r6 On 1
beqz r12 ScanHorizontal
beqz r11 ScanReverseHorizontal
beqz r10 ScanVertical
beqz r9 ScanReverseVertical
brne r1 -1 3
sbn HASH("StructureConsoleLED5") HASH("LED_LOCKED_SIGID") Setting 0
j reset
yield
lbn r0 r7 r8 Idle Average
breqz r0 -2
sbn r7 r8 BestContactFilter r15
sbn r7 r8 Setting 50000
sbn r7 r8 Activate 1
lbn r0 r7 r8 InterrogationProgress Average
brlt r0 1 4
sleep 2
sbn HASH("StructureLogicTransmitter") HASH("Hardsuit LT 1") SoundAlert 37
sbn HASH("StructureConsoleLED5") HASH("LED_LOCKED_SIGID") Setting 0
j mainloop
bnez r15 reset
breq r6 DishM 2 # enter roaming mode
sbn r5 r6 On 0
breq r8 DishM 2
sbn r7 r8 On 0
sbn HASH("StructureSatelliteDish") DishM On 1
add r2 r2 2
mod r2 r2 360
sbn HASH("StructureSatelliteDish") DishM Horizontal r2
j mainloop
ScanHorizontal:
brne r1 -1 4
move r12 r14
sbn r5 r6 Horizontal r14
j mainloop
move r14 r2
sub r4 r2 5
mod r4 r4 360
sbn r5 r6 Horizontal r4
j mainloop
ScanReverseHorizontal:
brne r1 -1 14
beq r14 r12 13
move r11 r14
slt r4 r11 r12
breqz r4 2
add r11 r11 360
add r4 r11 r12
div r4 r4 2
mod r4 r4 360
sbn r5 r6 Horizontal r4
sbn r7 r8 On 1
sbn r7 r8 Horizontal r4
jal 124
j mainloop
move r14 r2
add r4 r2 5
mod r4 r4 360
sbn r5 r6 Horizontal r4
j mainloop
ScanVertical:
brne r1 -1 4
move r10 r13
sbn r5 r6 Vertical r13
j mainloop
move r13 r3
brge r3 89.9 -4
add r4 r3 5
sbn r5 r6 Vertical r4
j mainloop
ScanReverseVertical:
brne r1 -1 10
beq r13 r10 9
move r9 r13
select r9 r9 r9 0.01
add r4 r9 r10
div r4 r4 2
sbn r5 r6 Vertical r4
sbn r7 r8 Vertical r4
jal 124
j mainloop
move r13 r3
brle r3 0.1 -8
sub r4 r3 5
sbn r5 r6 Vertical r4
j mainloop
yield
lbn r0 r5 r6 Idle Average
breqz r0 -2
j ra
The last step is to set the item prefab hash you want. First set the FILTER_GAS_SWITCH to indicate the type of the filter(Open is filtering Gas, Close is filtering Prefab), then set the content of Logic Memory named SLM_ITEM_FILTER using labeler or any other means, then power both IC Housing on. Then wait for the trader to arrive, there will be a notification send to your Hardsuit or your custom device. The codes will auto locate the shuttle and filter shuttle cargoes and interrogate with it and call it down to your default landing pad.
Don't forget to reset the content of SLM_ITEM_FILTER to 0 or something else after trading.
The logic behind the Dish Control is that it scan the signal edge of the filtered out SignalID, instead of inspecting signal strength, so it kind of fast and non-stop rotating. When no filter is specified, it enters roaming mode which rotate clock-wise until filter is specficied and matching shuttle is found.


