About Mountable Turrets
This plugin adds 2 new deployable turrets and IR-traps.
Overview
Anti-Aerial turret
This turret can be accessed via computer station.
It has several modes
- Automatic - shoots multiple homing rockets, which will follow the target
- Manual (single) - shoots a single rocket
- Manual (burst) - shoots multiple
If the turret is in automatic mode it waits for target.
To acquire target player needs to place the crosshair on it and wait some time, which is configured here -> ([AA Turret] Target acquiring time (seconds)).
After that the turret will follow the target and player can shoot by pressing Middle Mouse Button.
Manual modes just shoot regular rockets.
Machine gun Turret
This turret can be mounted by pressing E on any of its parts (such as pipes etc.).
Players can just aim and shoot.
Ammo type can be configured here -> [Machine Gun Turret] Ammo type (short prefab name, must be one of 5.56 Rifle ammo).
IR-Traps
IR-traps (or flares) are used as a counter-measure to the anti-aerial turret.
They can be loaded in the fuel storage of minicopter or scrap heli and can be deployed by pressing E.
Stack sizes, amount per use and cooldown are configurable.
IR-Traps can also affect SAM sites, this option can be enabled here -> [IR Trap] Affects SAM Sites (true/false)
Commands
Chat Commands
- /aaturret - buy anti-aerial turret (requires mountableturrets.aaturret.give permission)
- /mgturret - buy machine gun turret (requires mountableturrets.machinegun.give permission)
Admin Chat Commands
Following commands require mountableturrets.admin permission to work. See "Permissions" chapter for more info.
/mt command must be ran a monument you want to modify.
Positions are saved relative to the monument and persist even after a wipe or a map change.
/mt (requires mountableturrets.admin permission)
- /mt add aa - spawns anti-aerial turret on a monument
- /mt add mg - spawns machine gun turret on a monument
- /mt add comp - spawns computer station on a monument, which gets automatically linked to anti-aerial turrets
- /mt remove - removes turret/computer station from the monument
- /mt reset - clears all data for a monument
Admin Console Commands
- giveaaturret <player name> - gives anti-aerial turret to specified player
- givemgturret <player name> - gives machine gun turret to specified player
Permissions
- mountableturrets.admin - allows usage of giveaaturret, givemgturret and /mg commands
- mountableturrets.aaturret.give - allows players to buy AA turret using /aaturret
- mountableturrets.aaturret.free - allows players to get AA turret for free using /aaturret (give permission is still needed)
- mountableturrets.machinegun.give - allows players to buy machine gun turret using /mgturret
- mountableturrets.machinegun.free - allows players to get machine gun turret for free using /mgturret (give permission is still needed)
Localization
This plugin has built-in support for the following languages -
- English
- Russian
Configuration
Example of MountableTurrets.json (some parts are shortened)
{ "PVE Mode (true/false)": false, "[AA Turret] Price (set value to 0 to make it free, use ServerRewards as a key to use RP points)": { "Key": "scrap", "Value": 500 }, "[AA Turret] Item Skin ID (Workshop ID)": 2849176835, "[AA Turret] Item Name": "Anti-Aerial Turret", "[AA Turret] Cooldown between shots (seconds)": 10.0, "[AA Turret] Rocket fuse length (seconds)": 10.0, "[AA Turret] Rocket fuse length (meters)": 450.0, "[AA Turret] Entities that turret is able to lock on to (short prefab name)": [ "minicopter.entity", "scraptransporthelicopter", "hotairballoon" ], "[AA Turret] Target acquiring time (seconds)": 0.6, "[AA Turret] Rocket initial velocity (meters per second)": 30.0, "[AA Turret] Interval between shots in Burst mode (seconds)": 0.4, "[AA Turret] Rocket explosion radius (meters)": 5.0, "[AA Turret] Movement Speed Fast": 3.7, "[AA Turret] Movement Speed Normal": 2.0, "[AA Turret] Movement Speed Slow": 1.0, "[Machine Gun Turret] Price (set value to 0 to make it free, use ServerRewards as a key to use RP points)": { "Key": "ServerRewards", "Value": 250 }, "[Machine Gun Turret] Item Skin ID (Workshop ID)": 2849176974, "[Machine Gun Turret] Item Name": "Machine Gun Turret", "[Machine Gun Turret] Ammo type (short prefab name, must be one of 5.56 Rifle ammo)": "ammo.rifle", "[IR Trap] Stack size": 12, "[IR Trap] Amount per use": 2, "[IR Trap] Cooldown (seconds)": 3.0, "[IR Trap] Initial velocity (meters per seconds)": 20.0, "[IR Trap] Fuse length (seconds)": 10.0, "[IR Trap] Affects SAM Sites (true/false)": true, "[IR Trap] SAM Site blind time (seconds)": 5.0, "[IR Trap] Show IR-Trap hint UI (true/false)": true, "[IR Trap] Deploy positions": { "minicopter.entity": [ { <..> } <..> ] }, "[Misc] Spawn positions on other entities (full prefab name)": { "assets/content/vehicles/modularcar/module_entities/2module_flatbed.prefab": [ { "Type": "MachinegunTurret", "Position": { <..> }, "Rotation": { <..> } } ], "assets/content/vehicles/train/trainwagonb.entity.prefab": [ <..> }, "[Misc] UI Images (leave names intact)": { <...> } }
API
BaseEntity SpawnAATurret(Vector3 position, Quaternion rotation) // spawns anti-aerial turret BaseEntity SpawnMachinegunTurret(Vector3 position, Quaternion rotation) // spawns machinegun turret void DestroyTurret(BaseEntity turret) // destroys the turret
Credits
Thanks to Vitek & Nikitos for helping me with this plugin!