Stationeers

Stationeers

평점이 부족합니다.
Controllable 3-Harvie-Controller
   
어워드
즐겨찾기
즐겨찾기됨
즐겨찾기 해제
파일 크기
게시일
업데이트일
293.559 KB
2022년 8월 1일 오전 8시 28분
2022년 8월 1일 오전 10시 29분
업데이트 노트 2개 (보기)

다운로드 위해 구독하기
Controllable 3-Harvie-Controller

설명
Here I present you another 3-Harvie-Controller - but with a twist: You can control it at runtime.

This script has 3 configurable modes: Work mode, fertilizer mode and power mode.
Each mode can be set in the script to inital values, and they can be changed while the IC is running at any time without touching the script again, just by writing a command and a value into the Setting-value of the IC Housing.
The script can process one command per tick. After processing the Setting is set back to 0. So, after writing a command into the Setting you should watch the Setting until it is processed.
This way maybe a Greenhouse atmosphere controller can control the workmode if the gases are unfavorable and switch it back if all is right.
Or maybe if the player gets flooded with seeds he can change the work mode.

Changing the work mode while a plant is in Seed-stage the change cannot be taken into account.

And for those who likes to watch numbers on displays the script can be set into a debug mode. In this mode the current state of the three modes are written to the Setting - ofcourse only after processing any incomming command.

WorkMode - defines how Harvie behaves
Command: 1X - X can be one of the following values
0 - Extinguish life - Harvesting only
1 - Exploiting life - Sowing and harvesting, no seed collection
2 - Sustain life - Sowing, harvesting and collecting 1 seed
3 - Spread life - Sowing, harvesting and collecting all seeds

FertilizerMode - defines how Harvie reacts to fertilizer
Command: 2X - X can be one of the following values
0 - Everything counts - Sowing as soon as possible
1 - Only the Best - Sowing occurs only on fertilized devices

PowerMode - defines if Harvie can smile at you all the time
Command: 3X - X can be one of the following values
0 - The last switches lights off - Harvie is switch on and off as needed
1 - I like Smileys - Keeps Harvies powered

You can setup the controller with three Harvie - Hydroponic device - pairs.
d0-d3 - Pair 1 - Left Harvie, right Hydroponic device
d1-d4 - Pair 2 - Left Harvie, right Hydroponic device
d2-d5 - Pair 3 - Left Harvie, right Hydroponic device
If one device is missing the according pair is ignored. Types of divices aren't checked.

Before sowing the Hydroponic device and Harvie are checked.
There needs to be at least 10 moles of water and the water has to be between 6°C and 59°C.
If fertilizer mode is set to 1 then fertilizer needs to be in the hydroponic too.
And ofcourse Harvie need to have some seed in it's input slot to sow.

If debug mode is set to 1, the Setting shows a 4-digit number.
From left-to-right this number is build this way:
The 1st digit is always a 1 (needed to distinguish from commands).
The 2nd digit is the work mode.
The 3rd digit is the fertilizer mode.
The 4th digit is the power mode.
댓글 3
Squeaks 2022년 9월 25일 오후 1시 56분 
Thanks for the reply, I know what you mean regarding using a separate IC for control to increase efficiency but I quite like the idea of having a few different pairs of crops, potentially running on different settings.

I'll see if I can figure out how to copy a bit of code from another script that uses a rotary switch to get it to work.
GuyMonkey  [작성자] 2022년 9월 24일 오전 11시 19분 
Yes, I think you could swap out a harvie and a hydroponic for a rotary switch and a display in the code, even though the code is very close to the maximum number of lines. But you then lose one controlled Harvie per IC.
So I think it would be better to take an additional IC and use it to set and control the workmode of three Harvie ICs.

If you take out a Harvie pair in my code, then with 4 ICs you end up with 8 controlled Harvies.
But if you leave my code and take an extra IC, then you have 9 Harvies (3 ICs) and a 4th IC for control and control.
Squeaks 2022년 9월 24일 오전 6시 12분 
Many thanks for sharing this, just what I needed. Knowing nothing about IC code, is it possible to swap out one pair of Harvies for a rotary logic switch and a display so you can change the workmode and see what it's set to without a computer?