海盗狗 发表于 2024-8-31 03:33:05

[0.97a-RC11] 镜像武器 丨 Mirror 1.4 & DecoLib 0.3

本帖最后由 海盗狗 于 2024-9-6 02:35 编辑

原帖链接: Mirror 1.4 & DecoLib 0.3 (fractalsoftworks.com)
原作者:Wyvern
一个挺有意思的小体量功能性mod

效果是根据槽位的不同,镜像化一部分武器让舰船整体看起来更加的对称
具体来说的效果是:右半边的朝前的武器会被镜像,左半边朝后的武器也会被镜像
实际效果可以参考原作者的这张图↓




然后这个Mod被作者分成了两个部分,Mirror和DecoLib,
其中前者实现对原版武器的镜像,后者提供镜像特定武器的代码和脚本(因此也是前者不可或缺的前置部分)


顺带一提,DecoLib是可以对其他mod生效的,如果mod作者想的话也可以利用其中的代码来做个子mod实现自己mod中武器的对称化!
原话是( 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. )
太伟大了!


下载分流:






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.

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.)


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














海盗狗 发表于 2024-8-31 21:47:11

真的发出来了吗。。。
咋没人呢(

3dian 发表于 2024-8-31 21:51:33

{:tieba_43:}

彩虹exe. 发表于 2024-8-31 22:36:15

共鸣体!我的共鸣体和炼狱炮!
胜利身上的东西终于对称了(
好东西

相位船爱好者 发表于 2024-8-31 23:09:18

谢天谢地,终于可以用高打了

相位自走洗衣机 发表于 2024-9-1 00:24:11

强迫症福音{:5_124:}

BloodyRozen 发表于 2024-9-1 23:29:53

我的强迫症终于能治好了

海盗狗 发表于 2024-9-6 02:31:44

相位自走洗衣机 发表于 2024-9-1 00:24
强迫症福音

对称万岁!
顺带一提作者的DecoLib是可以给其他mod用的,如果mod作者想的话也可以利用其中的代码来做个子mod实现自己mod中武器的对称化,太伟大了{:5_118:}

相位自走洗衣机 发表于 2024-9-6 07:40:10

海盗狗 发表于 2024-9-6 02:31
对称万岁!
顺带一提作者的DecoLib是可以给其他mod用的,如果mod作者想的话也可以利用其中的代码来做个子 ...

看起来很高级的样子,不过确实是很棒的功能{:5_124:}

叶影MASCARA 发表于 2024-9-11 12:18:36

好诶

黑雾 发表于 2024-9-24 06:33:12

强迫症狂喜{:5_118:}

Colt_SCW 发表于 2024-9-24 07:48:45

好起来了

只是账号 发表于 2024-9-26 19:06:01

可惜是97的,不过,有就是棒{:5_124:}

竹林 发表于 2024-9-29 22:15:08

神!
页: [1]
查看完整版本: [0.97a-RC11] 镜像武器 丨 Mirror 1.4 & DecoLib 0.3