Auto Operate Toggle Turrets
Добавить в игру через Steam
Нажмите «Подписаться»
На странице Steam войдите в аккаунт, если потребуется.
Подписаться
О материале
«Auto Operate Toggle Turrets» — материал мастерской Barotrauma. Моды, подлодки, предметы и новые задания для экипажа. Данные Steam, описание автора и ссылка для установки через подписку. Совместимость редакцией не проверена.
Описание автора
AUTHOR'S NOTE: As of 1.5.7, this mod is basically outmoded - all functionality below should now be available in the vanilla game. Thank you for your prior support.
Basics
This mod replaces ALL subeditor and in-game turrets with versions that have two extra wiring pins: set_state and state_out. The set_state pin allows Auto Operate to be toggled on and off for each turret. state_out simply gives back whatever has been given to set_state. Even though this affects both pre-existing and new turrets in the subeditor and normal sessions, Auto Operate for a given turret will always be off by default and will not turn on until given an appropriate signal via wire or manual editing.
Auto Operate
Auto Operate is a dev-controlled feature, introduced in 1.0, being the devs' version of auto turrets. While Auto Operate is active on a turret, it will track and fire at targets by itself; however, it will still need power and ammo supplied as normal. Without this mod, the only way to activate Auto Operate on a turret is through the subeditor. This means that Auto Operate can only be used in-game on custom subs with turrets that have already had AO activated (and then it can't be turned off!). This mod allows Auto Operate to be toggled on and off at will with a simple lever and wire, manual input, or other, more complex setups.
In case the above didn't make it clear, let this be a more direct disclaimer: I have no control over how exactly Auto Operate works; that is controlled completely by the devs. This mod is ONLY for turning AO on and off as-is for individual, in-game turrets.
How to Use
In vanilla Barotrauma, Auto Operate for a given turret can be turned on and off only through the subeditor. Other values relevant to Auto Operate can also be adjusted here. Under a turret's options you will find a section that looks like this:
This mod adds the ability to toggle Auto Operate on any turret via a new wiring pin, set_state.
ORIGINAL TURRET WIRING PANEL:
MODDED TURRET WIRING PANEL:
As long as the turret's "state" is set to '1', Auto Operate will be on/active. If "state" is '0', Auto Operate will be off. state_out puts out whatever value was last given to set_state. The simplest way to set this up is to wire a lever or switch to set_state, but more complex setups are certainly possible.
Alternatively, interacting with a turret's wiring panel in-game will also bring up the edit panel; setting Value to 0 or 1 manually will have the exact same effect as if it had been transmitted via wire to set_state. However, this method will generally require you to be outside the sub, where the turret is.
Technical Notes
-
The turret's "state" will only accept values 0 or 1. If you try to set it to anything else like '13' or 'text', the turret will simply continue to use the last valid input. In other words, if AO is on and you give "state" an invalid input, AO will stay on.
-
Internally, what I've actually done is given every turret a Memory Component. Thus, the set_state pin will take pretty much anything you give it, but, once again, the modded code only does something with a 0 or 1. This is also why the turret shows a Value box alongside the wiring panel and lighting color options in-game.
-
Overall, the extra code for this mod is incredibly simple, but it does in fact override/replace the base code for each turret. Feel free to contact me over Steam or Discord (agentdelta.13) for help integrating this into other mods you might have if this doesn't work as-is.
-
This mod also overrides/replaces normal and large turret hardpoints, meaning any wiring you put in place on the two new pins, set_state and state_out, will stay in place even if you remove or install a new turret at an outpost. Wiring will also "stick" when you swap out a turret for a different one.
-
This mod can safely be added to any in-progress (vanilla, no guarantees otherwise) campaign or session. It alters ALL in-game turrets, but "state" will always be 0 by default, so Auto Operate will never be activated for any turret unless you manually turn it on. Furthermore, it should not mess up any wiring already present on pre-existing turrets; it's only adding two new pins. If you remove this mod from a campaign or session already using this mod, the two modded pins will simply disappear and any wires connected to them will be left hanging loose as though manually disconnected. (Any turrets that had AO active at the time you removed the mod will likely still have it on with no way of turning it off; I have not tested this edge case.)
-
Even if you turn Auto Operate on for a turret in the subeditor, this mod will always override that particular setting, first turning it off by default, then taking any values given to set_state or the Value prompt beside the wiring panel.
-
As previously shown, Auto Operate has other options and settings that can be changed via the subeditor. If you apply this mod and then alter the extra Auto Operate options for a turret, those settings will persist and this mod will not alter them. If you use this mod without changing any of those settings or add it to an in-progress campaign or session, Auto Operate will simply use its default parameters. There is currently no way to change these extra settings once in-game. Furthermore, these extra settings will NOT persist if you swap the edited turret for a new one or a hardpoint. This is another "feature" that is controlled by the devs; they may or may not change this soon.
Huge thanks to WorkingJoe over on the Barotrauma Discord for providing the base code for this mod.
Any and all constructive criticism, questions, and requests are welcome and appreciated.
Как установить и запустить
Откройте оригинальную страницу в Steam Workshop, проверьте версию игры, зависимости и порядок загрузки в описании автора. Нажмите «Подписаться» и дождитесь загрузки Steam. Включите материал в меню модификаций или контента игры, если это требуется. Совместимость и запуск редакцией не проверены.