aveBrian's Trailer Control Script V2.0
О материале
«aveBrian's Trailer Control Script V2.0» — материал мастерской Space Engineers. Моды, чертежи кораблей, скрипты и миры для Space Engineers. Для установки откройте оригинал в Steam Workshop, проверьте требования автора и подпишитесь. Совместимость с версией игры редакцией не проверена.
Описание автора
ATTENTION:
This is a massive update to the previous version of this script under the old title "TrailerControlScript(Thrusters)".
What Does It Do?
This script will allow you to control the lights, thrusters, brakes, and wheels on your trailer from your tractor. This unifies control of the trailer with the tractor so by pressing the lights key, all lights on your tractor and trailer will toggle. Pressing the crouch button will apply the brakes to the tractor and the trailer. If you want, you can even power your trailer tires to move when your tractor tires roll. Want to apply the parking brake to both the tractor and trailer? Just press "p".
Installation is easy peasy.
Installation Instructions
Step1: Install programmable block with this script on your tractor. Step2: Install a remote control block on the trailer(s) you want to tow. Step3: Put the word "brake" into the name of any light(s) you want to act like brake lights. Step4: Enjoy :)
What's New?
- Massively simplified installation.
- Backward compatible with the old setup.
- Improved performance by streamlining the setup and function.
- When the vehicle cockpit is not occupied, the script will be on "standby" mode and run only when there is a driver.
Thanks for reading :)
Technical Notes (Optional)
Finding the Block that Controls the Rig: This script functions by monitoring the cockpit or remote control used to pilot the vehicle. It finds the ship controller by looking for the first cockpit that is occupied, or a remote control block that is under the control of a player that it can find. The script prioritizes cockpits over remote control blocks. Meaning that if you're using a cockpit while someone else is using the remote control block, the cockpit will be chosen as the "signal controller". Once the script has assigned a "signal controller", this will not change unless your controller is destroyed, or you recompile the script and take control over another ship controller (ship controller = Cockpit or Remote Control).
Finding Thrusters:
It finds the first thruster pointing forward that shares the same grid as the "signal controller".
It does the same for the first thruster pointing backward.
These thrusters get assigned as the reference thrusters in which the thrusters on the trailer will base their thrust.
These will automatically get reassigned if they get destroyed. One draw back, however, is that if you ONLY have thrusters on your trailer, this script will not have anything to base their thrust on and so will not fire.
I will fix this in a future update soon :)
Trailer thrusters will behave properly whether or not you have thrusters on your tractor.
Finding the Lights The lights are controlled the same way as the thrusters. A "signal light" is assigned by looking for any spot light on the same grid as the "signal controller" and turning every other light on or off depending on the spot light. Adding the word "brake" into say, the name of red lights at the rear of your trailer and tractor, will cause those lights to become illuminated only when the brake key is pressed (default "c").
Thruster Inversion? When you hook up to a trailer with your tractor, you can view the thrusters in the terminal and can plainly see that thrusters on the trailer are (for some reason) assigned opposite directions from those on the tractor by the game. This isn't a problem as this script will take this into account and invert the thrusters by default. You can alter this behavior however, by setting the "InvertThrusters" varible to "false". This may be necessary if you're planning to land a ship on your trailer and don't have thrusters attached directly to the trailer but want to use the thrusters on your ship instead (ship thrusters get the proper direction relative to their ship controller).
Powered Trailer Wheels and Applying Braking Force Installing a remote control block on the trailer(s) allows the programmable block to activate the parking brakes. By monitoring the MoveIndicator from the "signal controller", this will activate when the jump button is pressed or the parking brakes are applied on the tractor. By default, this script wont power the trailer wheels. You can change that by setting the "PoweredTrailerWheels" varible to "true". There are also two additional settings you can use to tweak the behavior of these wheels, although this is not necessary and the default values work perfectly fine.
-
The first variable is the "Available Power" value. This will control the percentage of power available to the trailer tires. This can be useful if you find the trailer keeps swinging out of control. Of course, it is better to adjust the power on the suspension itself from the terminal.
-
The second value is the "Powered Interval" variable. This will determine how quickly the power is applied. I find that applying 1% of power per game tick is preferable for stability as opposed to dumping all that power at once.
Final Thoughts If you've made it this far, you have my thanks :)
This script was inspired by Splitsie's survival series on youtube in which he built the "Goose" semi truck that gave me this idea. Big thanks to him and if you haven't seen this series, I highly recommend it :)
Please feel free to let me know if you have any suggestions or request and I will answer them as soon as possible. Feedback is very helpful to getting my scripts just right :)
Как установить и запустить
Откройте оригинальную страницу в Steam Workshop, проверьте версию игры, зависимости и порядок загрузки в описании автора. Нажмите «Подписаться» и дождитесь загрузки Steam. Включите материал в меню модификаций или контента игры, если это требуется. Совместимость и запуск редакцией не проверены.