-
Notifications
You must be signed in to change notification settings - Fork 0
Machine gun
The machine gun turret is a dual 12.7mm machine gun with a fire rate of 700 rounds per minute. For reference, the real world M2HB has a fire rate of 450 to 600 RPM. It can be used by both the marines (And other KAI humanoid) AND players. Each bullet does 25-40 damage, and a single machine gun can kill a Cyberdemon with 5-7 seconds of sustained fire.
Players and NPCs can go straight through the turret when it is not in use.
The turrets' behavior can be customized with a few available custom arguments. These arguments are:
If this argument is kept at -1, the turret just has infinite ammo. If it is not however, when a player uses the turret, they will only have as much ammo as specified by the variable. i.e if the ammo is set to 250, the player gets in, fires 50 bullets, and gets out, the turret will be left with 200 bullets.
Note: If you want to make ACS map scripts that change the amount of ammo on the turret, you can use the ThingSetSpecial() ACS function to change the amount of ammo on the turret. But keep in mind that the ammo argument field updates to match how match ammo is left only after the player leaves the turret. So changing the ammo amount WHILE the player is on the turret in question would be much less straightforward.
How much time, in tics, marines (And other humanoid NPCs) will spend on the turret while idle, before deciding to get off. Default is 700 tics/20 seconds. If set to -1, NPCs that get on will stay indefinitely unless something else forces them to get off.
If enabled, the turret will immediately take in whatever valid operator (Be it marines, other KAI humanoid, or players) is touching its' hitbox upon spawning. This allows for setting up marines (Or even players) to spawn already sitting on the turret.
The map setup for making a valid turret operator spawn manning it. The marine is spawned inside the turrets' hitbox with the custom arg enabled, making him immediately enter it upon spawning.
This section covers the mechanics when specific actors use the machine gun turret.
When any valid operator (Marines, other KAI_Humanoids, and players) are using the turret. The turret will absorb 20% of all incoming damage if hit from the front, allowing it to somewhat act like armor. When that happens, the operator will also not bleed and an alternate impact sound will play.
When a marine is manning the turret, in addition to just firing it normally (Including leading their shots) at enemies. They will:
- Get off of the turret if any danger is pointing their way or is around the turret. So if for example an MVP vehicle is aiming their way, they will run off to avoid dying. This basically works by checking for hazards so it generally only works for other fellow KAI NPCs that emit them.
- Get off of the turret if a particularly dangerous projectile is heading towards' the turrets' way. If a projectile is coming towards them and it will do over a quarter of the operators' health in damage, then they will get off.
- Marines will decide to zoom in from their turret to fire more accurately based on how likely they are to hit something, so if a target is too far away, they will generally zoom in to get better aim. When zoomed in the turrets' turn speed is significantly affected.
- Marines can be ordered to get out of the turret by going up to it and pressing use.
- When idle, they will get off the turret after a set amount of time, defined by the Idle time argument. If it's set to -1, they won't get off on their own unless the above conditions are met or they die or are erased.
- Also when idle, they will randomly rotate the turret around in front of them, looking for enemies.
Other KAI humanoid monsters can also use the turret. When other humanoids are using it, they can do all the things the marines can that are mentioned above, except for zooming in and out to improve their aim.
When a player is manning the turret, they have access to the following abilities:
- Players are the only operators subject to the turrets' ammo mode (So I won't have to code logic for making NPCs conserve ammunition lmao).
- Players can zoom in with the turret using the altfire button. Just like other marines can. And just like them, this gives the turret an accuracy buff at the expense of turn speed.
If the turret is not being used by a marine, but another KAI humanoid or a player (Who isn't just a stock DoomPlayer class). Then the turret will use the non-marine operators' sprite instead of the marines' sprites for making it appear that the current operator is using the gun.