Mirror is a simple mod that reflects most vanilla weapons, based on where they're installed on your ship. In general, weapons will be mirrored if they are to the left of the ship's centerline and facing forwards, or if they're to the right of the ship's centerline and facing backwards.
DecoLib is the library mod that contains the actual code for mirroring weapons, and is required for Mirror.
List of Mirrored Weapons
- light dual autocannon
- assault chaingun
- heavy autocannon
- heavy mortar
- hypervelocity driver
- thumper
- hellbore cannon
- mark IX autocannon
- mjolnir cannon
- mining laser
- ion beam
- autopulse laser
- annihilator rocket launcher
- atropos-class torpedo rack
- breach SRM
- gazer DEM SRM
- gorgon DEM SRM
- hammer-class torpedo
- harpoon MRM
- sabot SRM
- swarmer SRM
- annihilator rocket pod
- breach srm pod
- dragonfire DEM torpedo
- gazer SRM pod
- gorgon SRM pod
- harpoon MRM pod
- jackhammer
- pilum LRM launcher
- sabot SRM pod
- salamander MRM pod
- cyclone reaper launcher
- hammer barrage
- locust SRM launcher
- pilum LRM catapult
- squall MLRS
- shock repeater
- minipulser
- volatile particle driver
- cryoblaster
- cryoflamer
- antimatter SRM
- resonator MRM
F.A.Q.
Q: Why the frogwaffles is this distributed as two separate mods?
A: Separating out DecoLib into its own thing makes it easy for other modders to establish a dependency on it, using its code without mandating that the player use Mirror. (Also, I've got plans for DecoLib; it's supposed to be a lot more than it currently is. There's a reason its version number started at 0.1 and not 1.0. Presumably it'll get its own thread at some point.)
Q: So, uh, what about weapons that are on the centerline, or that are facing directly left or right?
A: In general, 'on the centerline' counts as 'right', and facing directly left/right counts as 'forward' - however, there are no guarantees. Sometimes a weapon mount might look as if it's on the centerline, but it isn't exactly. Similarly, weapons that appear to be facing directly left or right may not have the expected value for 'forwardsness'. I've added a 0.1 degree fudge factor to account for some ORA hulls having weapon mounts that look like they're facing directly to the side, but are actually pointed a tiny fraction of a degree backwards. If you've got a specific example of this code doing the 'wrong' thing, let me know, and I'll see what I can do about it.
Q: Why didn't you mirror vanilla weapon X?
A: Probably just forgot about it - I didn't mirror literally everything, just the weapons where I thought it might matter. If you think there's something I missed, let me know and I'll take a look.
Q: Why did you mirror weapons like the Mjolnir? That's already symmetrical!
A: It's subtle, but try putting two Mjolnir cannons on a Dominator with linked fire. Vanilla behavior has them firing their left barrels, then their right barrels, then left again, etc. With mirroring active, they instead fire outside barrels, then inside barrels, etc. (Of course, in actual combat, this can easily get out of sync. Still, I think it's a neat effect.)
Q: Why didn't you mirror mod-added weapon Y?
A: First, it's rude to make a mod that changes the behavior of other people's mods. Second, if I made this mirror weapons from some other mod, I'd need to also make this depend on that other mod, and that'd be extraordinarily inconvenient for anyone who doesn't run with that other mod. So, no, I will not be mirroring mod-added weaponry.
Q: So... how hard is it for someone else to mirror mod-added weaponry?
A: Nothing in Mirror is deliberately obfuscated. If you're a mod author and want to use DecoLib to mirror your own weaponry - it should be pretty easy to figure out how to do that, and you're welcome to ask me for help if you need it. If you're not a mod author, and want to create a personal mod to mirror specific weapons... well, that could be a bit trickier.
Q: Hey, I made this mod that mirrors someone else's mod-added weaponry! Could you put a link to it in your post?
A: No. See: it's rude to make a mod that changes the behavior of other people's mods. You are welcome to construct such mods for your own personal use (as long as you understand that you're basically voiding the warranty - mod authors will be understandably upset if you report a bug with 'their' mod and it turns out to be something you broke in your own personal tinkering), but you are not welcome to distribute such mods. (Unless, of course, you have explicit permission from the original mod's author, in which case distribute away.)
Changelog
- Mirror 1.4
- Added mirroring for ion beams and mining lasers
- Mirror 1.3
- Updated for Starsector 0.97a
- Fixed a bug where the Volatile Particle Driver's default WeaponEffectPlugin was accidentally overwritten
- DecoLib 0.3
- Updated for Starsector 0.97a
- Changed mod to work via included jar file instead of uncompiled scripts
- The source code is still included; you can find it inside the jar
- Mirror 1.2
- Added mirroring for most missile weapons
- Mirror 1.1
- Updated for Starsector 0.96a
- Added mirroring for Assault Chaingun and Thumper
- DecoLib 0.2
- Updated for Starsector 0.96a
- Implemented mirroring for animated weapons
- Added a 0.1 degree margin of error for deciding that a weapon counts as pointing forwards
- i.e. 'forwards' is considered to be turret angles from -90.1 to 90.1
- this is relevant for ORA hulls, whose turret layouts include subtle asymmetries to help address AI issues with broadside ships.
- Removed special handling intended for 0.95.1's buggy asymmetric missile turrets
- Mirror 1.0
- Initial release for Starsector 0.95.1a
- DecoLib 0.1
- Initial release for Starsector 0.95.1a
Credits:
• Tecrys and Xenoargh, whose
initial work on
weapon mirroring provided the prototype for being able to do this at all.
• Alex, who has repeatedly
added features and
fixed issues in order to make weapon mirroring work consistently across
all most* contexts.
* And the contexts where it doesn't work don't matter for Mirror, as they're situations where modular weapons don't display in the first place.