How to Build a Daylight Sensor in Stormworks: Build and Rescue

Stormworks has no real way to determine when night falls nor when morning comes. With a touch of creativity, ومع ذلك, a daylight sensor can be faked using one of the least useful components in the whole game, and I’m going to show you how.

Theory and Materials

In order to figure out how much light is in the environment, we need, حسنًا, something to measure. The problem here is that there is no way to directly measure light levels and there is only one component that is capable of varying something. The variance of that something cannot be measured directly. That something is electric. But perhaps we can still use this? نحن سوف, yes and no. Through testing, I have found that the electrical output of the solar panels isn’t very reliable; even with plenty of daylight left, they stop putting out usable charge fairly early in the evening, so we need to extend the amount of time thesensorstays active. في نفس الوقت, they begin producing power fairly early in the morning, so we may need to extend how long they’re inactive too.

The solution I came up with is quite simple. It starts with solar panels as they are the only object in-game that react with light levels, and an electric motor. The motor RPS drops as the power coming in drops and it goes back up as the power input goes back up, assuming the throttle level remains unchanged and available power is below the max consumption rate. This already somewhat solves the issue of delayed on/off due to the motor having rotational momentum, but it isn’t quite enough, so I threw a flywheel into the mix. More on that later, but for now, here is a list of components you will need.

  • 5 Solar Panels
  • 1 Microcontroller (2×2)
  • 1 Modular Engine Clutch (1×1)
  • 1 Modular Engine Flywheel (1×1)
  • 1 Dial or Numeric Display (خياري)

Component Layout

According to the description, the solar panel electric output is determined by angle and time of day. لهذا السبب, I placed one panel facing the sky and the other four on each horizontal face, pointing toward the horizon. These can be placed anywhere on the outside of the creation they’re being installed in.

The motor can also be placed anywhere, but know that it will need to connect to the clutch (output end) and the clutch to the flywheel. Note that in the screenshot above, I used a corner pipe to connect the motor to the clutch (output end) and then the flywheel is placed directly to the clutch (motor end).

Microcontroller

Create a microcontroller of 2×2 and give it four logic nodes: one number input, one logic output and two number outputs. The number input node measures the RPS of the flywheel and the logic output goes to whatever system you want to activate at night/day (أضواء, فمثلا). The two number outputs are for convenience. One is the motor throttle and the other is clutch pressure.

Edit the actual logic as described (image to follow):

A constant number block (set to 1) will connect to the number output node for the motor throttle.

Same as above for the clutch output node, but the constant number is 0.1.

Add a less-than block and a greater-than block. The number input node connect to the A input of both blocks just added. Now add two constant number blocks, one for each of the B inputs. The values to use will need to be tested for (will explain later). Now add a set-reset block. Use the less-than block to set the latch and the greater-than block to reset the latch. The latch output goes to the output logic node.

Logic and Electric

With the microcontroller set up, we need to set the logic up. Connect the microcontroller to the motor, clutch, flywheel RPS and whatever system you’re controlling as appropriate. Connect the RPS output to the optional dial/display mentioned earlier if you have one.

For the electric, connect the solar panels together and then to the motor. Do not connect anything to the power grid of your creation, else the system will not work since it relies completely on its own power generation to function. Note that in my screenshot, the battery bank is isolated from the system. It was used to power only the lamp and the dial backlights.

Testing For Values (Configuration)

The system should be fully installed, but in need of configuration. If the flywheel can be directly accessed/viewed, يمكنك استخدام ال “Page Up” button on your keyboard to read the RPS. آخر, you can use the previously-mentioned optional dial/number display. You can adjust them however you want but the same button can be used to read the exact value being sent to them.

While watching the RPS readout, pay attention to the outside light levels. As it transitions from night to day, the motor will start to spin up, causing the flywheel to spin up too. When the light outside reaches a level you want your lights/whatever to turn off, take note of the RPS. Do the same at night. نلاحظ أن “night RPSshould be lower than theday RPSdue to slow spin-down vs the relatively quick spin-up. Go back into the microcontroller and replace the values in the constant number blocks with the ones you just noted. يتذكر: less than the lower number and greater than the higher number. Test it to see how it works and readjust as needed.

Final Notes

Since the system actually uses solar panels as the main day/night detection method, this system should theoretically be usable on any server regardless of متى the day/night sliders are set. لكن, since it relies on the angular momentum of a flywheel for delaying the on/off triggers, the microcontroller’sconstant valueblocks will need to be updated whenever the server’s day length is changed. There are a handful of ways to go about doing this and I’ll leave it to you to figure out your own method.

هذا الدليل حول Stormworks: Build and Rescue كتب بواسطة Captain Oveur. يمكنك زيارة المنشور الأصلي من هذا حلقة الوصل. إذا كان لديك أي مخاوف بشأن هذا الدليل, من فضلك لا تتردد في الاتصال بنا هنا.

عن المؤلف