[1.0] Dual Wield - True dual wielding for any weapon (you allow)

Started by Roolo, January 17, 2019, 04:20:07 PM

Previous topic - Next topic

Roolo




Description
Pistols are boring? Not when you dual wield them like Lara Croft!
This mod allows your colonists to dual wield any weapon you allow in the mod options, including weapons added by other mods.
Dual wielding does come with accuracy and firing rate penalties which are affected by the shooting/melee level of the pawns.

Maybe it's better explained by a Chicken Plucker creation:



Features
- Dual wielding support for any weapon, including modded ones. What weapons can be dual wielded can be configured completely in the mod settings.
- Weapons are dual-wieldable, two-handed or normal.
    - Dual-wieldable weapons can be placed in either hand.
    - Two-handed weapons prevent dual-wieldable weapons to be used alongside them.
    - Normal weapons can have a dual-wieldable weapon alongside it, but isn't a dual-wieldable weapon by itself.
    - Which weapon falls in each category can be configured in the mod settings.
- NPCs/enemies can also dual wield! The chance they do can be configured in the mod settings.
- Dual wielding comes with both a cooldown penalty, and an accuracy penalty. Pawn melee/shooting skills lower these penalties. Like anything, these penalties are configurable in the mod settings.
- How each weapon is drawn in dual wielding stance is also configurable in the mod settings. 

Download

-->Download on Steam
-->Download on GitHub
Also make sure to install Hugslib, and place Hugslib above Dual Wield in the load order

Important notes
- Make sure to take a look at the mod settings. This mod is very configurable, and if you don't like something, you can likely tweak it.
- Also make sure RunAndGun and Giddy-up! Core are updated to their latest version, if you use any of those mods.
- Don't forget to install hugslib!
- Please report any issues you're having with this mod by clearly explaining what happens, and please, please add a Hugslib log by pressing ctrl+f12 and placing the link you'll get on this forum. A report with a log is 100x more valuable.

Compatibility
- Works fine with existing saves.
- not compatible with Combat Extended. I've looked into CE compatibility, but it's just not feasible.
- Should work fine with other mods (even with simple sidearms). Though please report any issues you find.

Permissions
Feel free to add the mods to modpacks or to use parts of the code or icons for other projects, though please credit me. Do however not release exact copies of my project, or exact copies with minor adjustments without my consent.

Credits
- Chicken Plucker for creating the amazing preview art and GIF. Thanks a lot!
- Pardeike a.k.a. Brainzz for creating Harmony.
- UnlimitedHugs for creating Hugslib.

Contributing
- Translations are very welcome. You can make a pull request on github if you want to add in translations, or you can contact me by sending a friend request.

If you really like my mods, please consider buying me a coffee. It would mean a lot to me!



Kori

That's another awesome mod by Roolo.  :o
I didn't know I need this until now! I hope there won't be any trouble with simple sidearms and CE.

NatsuDragneell

Quote- Should work fine with other mods (even with simple sidearms).

Kori

I read this, that's why I said "simple sidearms and CE" because as far as I know simple sidearms adapts some of its mechanics to CE when both mods are active and CE needs to handle ammunition when both guns are using different calibers.
Also Roolo said
QuoteShould work fine... Though please report any issues you find.
and I hope there is nothing to find.

Roolo

Oh yeah, Combat Extended, didn't think about that when I wrote that down, CE will likely have some compatibility problems. I'll take a look at compatibility when CE releases officially.  All other mods should work fine.

I'll update the notes for now.

Kirby23590

Does that mean i could make someone dual wield assault rifles like Salvador the Gunzerker, or even more ridiculous, dual miniguns or dual bolt-action rifles? ;D

Another great excellent mod made by Roolo!

I'll test out Simple Sidearms if it works fine and is compatible to this mod... ;)

One "happy family" in the rims...
Custom font made by Marnador.



Roolo

Quote from: Kirby23590 on January 18, 2019, 02:25:03 AM
Does that mean i could make someone dual wield assault rifles like Salvador the Gunzerker, or even more ridiculous, dual miniguns or dual bolt-action rifles? ;D

Another great excellent mod made by Roolo!

I'll test out Simple Sidearms if it works fine and is compatible to this mod... ;)

Yes, certainly. You can make it as crazy as you want in the mod settings! Also think about dual wield snipers or greatbows. How would that even work XD. Luckily, in modded Rimworld everything is possible. Don't worry though,  the defauls are pretty conservative.

Madman666

Congrats on the release Roolo! I quite enjoyed testing it. This ll be heaps of fun. Sorry for lack of feedback, i got a bit too engrossed in it.

Roolo

Thanks!

Important note. I totally forgot that I made changes to RunAndGun and Giddy-up for better compatibility with this mod. I just released those changes, so make sure to update both RunAndGun and Giddy-up! (if you use those mods).  If you use Steam, you should get them automatically.

Roolo

I released the mod on Steam now as well.

Also, I released as small update:
v1.0.1
- Ensured the default settings for custom weapon rotations are set properly when new weapon-adding mods are added.
- Added Preview image for in the mod page.


This update may prevent errors when installing new weapons mods in games where you have Dual Wield running, so while it's not a high priority thing, it's not a bad idea to download it.

Kori

Quote from: Roolo on January 18, 2019, 02:18:41 AM
Oh yeah, Combat Extended, didn't think about that when I wrote that down, CE will likely have some compatibility problems. I'll take a look at compatibility when CE releases officially.

Thank you!
Combat Extended 1.0 is beta now.
https://ludeon.com/forums/index.php?topic=33461.msg451357#msg451357

2.71828

Firstly, I just had a pirate raid, all of them carried some kind of grenade, molotov, etc., and a lot of them dual-wielded their grenades... That was both terrifying and hilarious at the same time.

I got the following two (kinds of) exception(s) though, that seem to be related to this mod:

Exception filling tab RimWorld.ITab_Bills: System.NullReferenceException: Object reference not set to an instance of an object
at DualWield.Harmony.VerbProperties_AdjustedCooldown.Postfix (Verse.VerbProperties,Verse.Thing,Verse.Pawn,single&) <0x00033>
at (wrapper dynamic-method) Verse.VerbProperties.AdjustedCooldown_Patch1 (object,Verse.Tool,Verse.Pawn,Verse.Thing) <0x000fd>
at RimWorld.StatWorker_MeleeAverageDPS/<GetValueUnfinalized>c__AnonStorey0.<>m__3 (Verse.VerbUtility/VerbPropertiesWithSource) <0x0003b>
at Verse.GenCollection.AverageWeighted<Verse.VerbUtility/VerbPropertiesWithSource> (System.Collections.Generic.IEnumerable`1<Verse.VerbUtility/VerbPropertiesWithSource>,System.Func`2<Verse.VerbUtility/VerbPropertiesWithSource, single>,System.Func`2<Verse.VerbUtility/VerbPropertiesWithSource, single>) <0x0010a>
at RimWorld.StatWorker_MeleeAverageDPS.GetValueUnfinalized (RimWorld.StatRequest,bool) <0x00322>
at RimWorld.StatWorker.GetValue (RimWorld.StatRequest,bool) <0x0012d>
at RimWorld.StatWorker.GetValueAbstract (Verse.BuildableDef,Verse.ThingDef) <0x0006d>
at RimWorld.StatExtension.GetStatValueAbstract (Verse.BuildableDef,RimWorld.StatDef,Verse.ThingDef) <0x00045>
at DubsMintMenus.Mint_StatsReportUtility/<StatsToDraw>d__8.MoveNext () <0x00361>
at System.Linq.Enumerable/<CreateWhereIterator>c__Iterator1D`1<RimWorld.StatDrawEntry>.MoveNext () <0x00191>
at System.Collections.Generic.List`1<RimWorld.StatDrawEntry>.AddEnumerable (System.Collections.Generic.IEnumerable`1<RimWorld.StatDrawEntry>) <0x000ab>
at System.Collections.Generic.List`1<RimWorld.StatDrawEntry>.AddRange (System.Collections.Generic.IEnumerable`1<RimWorld.StatDrawEntry>) <0x00084>
at DubsMintMenus.Mint_StatsReportUtility.DrawStatsReport (UnityEngine.Rect,Verse.RecipeDef) <0x0027d>
at DubsMintMenus.Patch_BillStack_DoListing.Prefix (UnityEngine.Rect&,RimWorld.Bill&) <0x012f9>
at (wrapper dynamic-method) RimWorld.BillStack.DoListing_Patch3 (object,UnityEngine.Rect,System.Func`1<System.Collections.Generic.List`1<Verse.FloatMenuOption>>,UnityEngine.Vector2&,single&) <0x000b7>
at (wrapper dynamic-method) RimWorld.ITab_Bills.FillTab_Patch1 (object) <0x00902>
at Verse.InspectTabBase/<DoTabGUI>c__AnonStorey0.<>m__0 () <0x000d2>


and

Exception filling window for Verse.Dialog_InfoCard: System.NullReferenceException: Object reference not set to an instance of an object
at DualWield.Harmony.VerbProperties_AdjustedCooldown.Postfix (Verse.VerbProperties,Verse.Thing,Verse.Pawn,single&) <0x00033>
at (wrapper dynamic-method) Verse.VerbProperties.AdjustedCooldown_Patch1 (object,Verse.Tool,Verse.Pawn,Verse.Thing) <0x000fd>
at RimWorld.StatWorker_MeleeAverageDPS/<GetValueUnfinalized>c__AnonStorey0.<>m__3 (Verse.VerbUtility/VerbPropertiesWithSource) <0x0003b>
at Verse.GenCollection.AverageWeighted<Verse.VerbUtility/VerbPropertiesWithSource> (System.Collections.Generic.IEnumerable`1<Verse.VerbUtility/VerbPropertiesWithSource>,System.Func`2<Verse.VerbUtility/VerbPropertiesWithSource, single>,System.Func`2<Verse.VerbUtility/VerbPropertiesWithSource, single>) <0x0010a>
at RimWorld.StatWorker_MeleeAverageDPS.GetValueUnfinalized (RimWorld.StatRequest,bool) <0x00322>
at RimWorld.StatWorker.GetValue (RimWorld.StatRequest,bool) <0x0012d>
at RimWorld.StatWorker.GetValue (Verse.Thing,bool) <0x00060>
at (wrapper dynamic-method) RimWorld.StatExtension.GetStatValue_Patch1 (Verse.Thing,RimWorld.StatDef,bool) <0x00067>
at RimWorld.StatsReportUtility/<StatsToDraw>c__Iterator1.MoveNext () <0x00361>
at System.Linq.Enumerable/<CreateWhereIterator>c__Iterator1D`1<RimWorld.StatDrawEntry>.MoveNext () <0x00191>
at System.Collections.Generic.List`1<RimWorld.StatDrawEntry>.AddEnumerable (System.Collections.Generic.IEnumerable`1<RimWorld.StatDrawEntry>) <0x000ab>
at System.Collections.Generic.List`1<RimWorld.StatDrawEntry>.AddRange (System.Collections.Generic.IEnumerable`1<RimWorld.StatDrawEntry>) <0x00084>
at RimWorld.StatsReportUtility.DrawStatsReport (UnityEngine.Rect,Verse.Thing) <0x00178>
at Verse.Dialog_InfoCard.FillCard (UnityEngine.Rect) <0x000e3>
at Verse.Dialog_InfoCard.DoWindowContents (UnityEngine.Rect) <0x0079b>
at Verse.Window/<WindowOnGUI>c__AnonStorey0.<>m__0 (int) <0x006a5>


Are these log entries already useful to you? I didn't actually notice any actual problems, to be honest, but I thought I'd report the errors nonetheless.

Madman666

Terrifying and hilarious is the right word for it lol! I just gotta try dual-wielding grenades xD

Naji

You add that only pawns with melee above a certain level could wield two melee weapons, and the same for shooting two. You could also add a manipulation limit too.

Madman666

Quote from: Naji on January 19, 2019, 07:15:01 AM
You add that only pawns with melee above a certain level could wield two melee weapons, and the same for shooting two. You could also add a manipulation limit too.

Agreed for melee skill treshold, definitely. Manipulation limit sounds fair, but its also ain't really plausible to add without being major annoyance. I mean any guy that goes full melee WILL get injured. And that potentially will lead to weapons being dropped left and right, after getting a bruise or two to the hand\spine\arm\shoulder. Unless those weapons will get dropped to person's inventory slot instead of on the ground. Still annoying though.