RimWorld

RimWorld

iflyBayonet
9 Comments
kifly6  [author] 14 Dec, 2022 @ 5:26pm 
Addendum. One easter egg I did include is that you can mount a bayonet on a revolver: https://collections.royalarmouries.org/first-world-war/type/rac-narrative-138.html .
kifly6  [author] 14 Dec, 2022 @ 5:23pm 
I'm not sure why I marked sniper rifles are un-mountable (the exclusion is actually explicit in the code https://github.com/ifly6/iflyBayonet/blob/master/Source/Utilities.cs#L90) . Ex post, I guess it could have been because I felt that snipers should inherently not be getting into melee combat (Soviet snipers during WW2, apparently, excepted).
Nox 13 Dec, 2022 @ 9:17pm 
Lovely mod, love it. Out of curiosity, why are sniper rifles not mountable? Are you going with things that you would expect had lugs already?
kifly6  [author] 1 Mar, 2022 @ 11:23am 
@Camalie Sorry for the late response!

But yea, there's a weapon tag set up to identify which guns are bayonet compatible. In the code, it identifies whether a tag is compatible, or in the sarcastic way I wrote the code itself, "__IsNotCrapWeapon(ThingDef weapon)", on number of conditions.

If the weapon has weaponTags == null, then no. If the weapon does not use projectiles, then no. If the weapon has any tags IndustrialGunAdvanced, SpacerGun, or BayonetGun, then yes. Actually, the BayonetGun tag is marked "tag for other modders? idk if it works", which I will update.

If the weapon defName is empty (which I don't remember why it's there), then yes. Then there are a few weapons which are hard-coded to be compatible: Gun_BoltActionRifle, Gun_PumpShotgun, and Gun_Revolver (next to a comment "pritchard bayonet reacts only"). If no condition is met, then it returns false.
Camalie 10 Feb, 2022 @ 8:47pm 
nevermind, I found out after some experimenting. For those who were curious, use your xml editor to open the file the gun is in and find the <weaponTags> section for the gun of your choice, then you add <li>BayonetGun</li> there. So for my example, I just placed it beneath <li>NeolithicRangedChief</li> for the musket for Vanilla Weapons Expanded
Camalie 10 Feb, 2022 @ 8:31pm 
So to answer PremierVader, this mod does affect modded weapons, it seems to affect all of the industrial level guns added by Vanilla Weapons Expanded.

With that said, I'm running into an issue and I'm curious about the author being able to help me with it. I'm currently trying to get this mod compatible with the musket added by that some mod and I think I sort of understand why it's not working. It's because it's tagged as a medieval ranged weapon instead of industrial or spacer. The thing is, I don't know how to patch it to make the musket count as a valid weapon. Could you offer some insight on that?
kifly6  [author] 27 Aug, 2021 @ 4:23pm 
I have no idea, I haven't used those. It should if the charge weapon is tagged properly
PremierVader 22 Aug, 2021 @ 2:05pm 
Nice would be nice to know everyones experience with this mod. Does it also affect mod weapons like the Charge Lee Enfield mod?
random roadblock 16 Aug, 2021 @ 3:50pm 
cool