Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Weapons can optionally have the weapon attribute "firing arc" with a
number between 0 and 180, and can swivel that many degrees left or right
of forward. This can allow for swivel cannons (can set up using a gun
mount as normal, and choose a "firing arc" that's fairly low) or for turrets
with a blind spot at the back. By default, anything taking a turret mount
will swivel the full 180, as before.
Missile boat AI will trigger somewhere between 1000 and 2000 range
depending on the swivel angle: as before, fixed guns at 2000 and normal
turrets at 1000, but e.g. a 90° swivel turret will trigger missile boat
AI at 1500 range.
This can also be used on anti-missile weapons. Lastly, if you try to fire
while outside of the firing arc, the gun will try to far as far toward the
target as it can: in practice, this is more playable than not firing at all,
or reverting to fire straight forward.
Context: though this is generally useful, I wrote it for my Trin Mobulas. They're stocky battlecruisers which rely on fixed firepower, and have serious convergence problems if they use normal fixed guns. I wanted to create some swivel cannons for them modelled on Escape Velocity Override's swivel phase cannons (used by Azdaras) and EV Nova's Fusion Pulse Batteries.
Notes: this isn't about limiting the turning rate of a turret, though it's compatible with such a feature. Also, the 'forward' point of any weapon is always forward, so this doesn't allow for broadsides and rear weapons. That'd be a great enhancement, but would require additional AI work. (Note that by 'forward' I mean the ship's facing + the convergence angle.)