[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

Quote from: Madman666 on January 19, 2019, 07:24:00 AM
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.

There aren't any hard minimum levels, but dual wielding is (depending on the weapon) not worth it at very low levels due to the high accuracy and cooldown penalty. In my opinion, this is closer to real life. Give me two weapons, and I'll be able to wield them both at the same time, but I won't use them effectively at al, because I'm not a person that smashes or shoots other people at a regular basis (in fact, never at all :)). You can always increase the penalties in the settings if you don't think they are severe enough. I won't include a manipulation limit because it would give more annoyance than joy, but there is at least the requirement that pawns need both hands and arms to be able to dual wield.

Madman666

It would be pretty hilarious if you could actually give yourself injuries if you re a newbie trying to dual wield say longswords xD I'd definitely chopped something critically important off if i tried waving two swords around without trainin :P

Roolo

Update:
v1.0.3
- Updated to new version system.
- Fixed compatibility problem with Alpha animals and other mods that add ranged abilities to animals.
- Pawns now also use their off-hand weapon while hunting.
- Added compatibility with mods that add weapons with def names that cannot be saved as xml tag (for instance Dead Goats weapon pack). (those mods used to break the mod settings).
- Fixed issue causing pawns to not use their off-hand weapon optimally when auto-attacking.
- Fixed issue with info window when using this mod with Simple Sidearms.
- Facial stuff compatibility!
- Added new drawing option which can be used to set if dual wield weapons are drawn mirorred or not (by default they are).
- Added drawing option for vertical drawing offset.
- Added traditional Chinese translations (by Shiuanyue).
- Added simplified Chinese translations (by LingLuo).
- Added Japanese translations (by Proxyer).

Madman666

Aaaaawesome. I dread how much time it ll take for me to set all stuff up to look super nice, but still its darn nice.

temple_wing

Appears when I open an Inspect window of an axe of Survival Tools.



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&) <0x00025>
at (wrapper dynamic-method) Verse.VerbProperties.AdjustedCooldown_Patch1 (object,Verse.Tool,Verse.Pawn,Verse.Thing) <0x00105>
at RimWorld.StatWorker_MeleeAverageDPS/<GetValueUnfinalized>c__AnonStorey0.<>m__3 (Verse.VerbUtility/VerbPropertiesWithSource) <0x0003e>
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>) <0x00128>
at RimWorld.StatWorker_MeleeAverageDPS.GetValueUnfinalized (RimWorld.StatRequest,bool) <0x00375>
at RimWorld.StatWorker.GetValue (RimWorld.StatRequest,bool) <0x0014a>
at RimWorld.StatWorker.GetValue (Verse.Thing,bool) <0x00070>
at (wrapper dynamic-method) RimWorld.StatExtension.GetStatValue_Patch1 (Verse.Thing,RimWorld.StatDef,bool) <0x00066>
at RimWorld.StatsReportUtility/<StatsToDraw>c__Iterator1.MoveNext () <0x00393>
at System.Linq.Enumerable/<CreateWhereIterator>c__Iterator1D`1<RimWorld.StatDrawEntry>.MoveNext () <0x001c5>
at System.Collections.Generic.List`1<RimWorld.StatDrawEntry>.AddEnumerable (System.Collections.Generic.IEnumerable`1<RimWorld.StatDrawEntry>) <0x000d7>
at System.Collections.Generic.List`1<RimWorld.StatDrawEntry>.AddRange (System.Collections.Generic.IEnumerable`1<RimWorld.StatDrawEntry>) <0x000a1>
at RimWorld.StatsReportUtility.DrawStatsReport (UnityEngine.Rect,Verse.Thing) <0x0018f>
at Verse.Dialog_InfoCard.FillCard (UnityEngine.Rect) <0x000d3>
at Verse.Dialog_InfoCard.DoWindowContents (UnityEngine.Rect) <0x00869>
at Verse.Window/<WindowOnGUI>c__AnonStorey0.<>m__0 (int) <0x00882>

Verse.Log:Error(String, Boolean)
Verse.<WindowOnGUI>c__AnonStorey0:<>m__0(Int32)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle)



--------------------------------------------------------------------------------
Appears when I'm hit by an ikwa.



Exception in JobDriver tick for pawn Red driver=JobDriver_AttackMelee (toilIndex=2) driver.job=(AttackMelee (Job_28105) A=Thing_Human1764) lastJobGiver=RimWorld.JobGiver_AIFightEnemies
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&) <0x00025>
at (wrapper dynamic-method) Verse.VerbProperties.AdjustedCooldown_Patch1 (object,Verse.Tool,Verse.Pawn,Verse.Thing) <0x00105>
at RimWorld.StatWorker_MeleeAverageDPS/<GetValueUnfinalized>c__AnonStorey0.<>m__3 (Verse.VerbUtility/VerbPropertiesWithSource) <0x0003e>
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>) <0x00128>
at RimWorld.StatWorker_MeleeAverageDPS.GetValueUnfinalized (RimWorld.StatRequest,bool) <0x00375>
at RimWorld.StatWorker.GetValue (RimWorld.StatRequest,bool) <0x0014a>
at RimWorld.StatWorker.GetValue (Verse.Thing,bool) <0x00070>
at (wrapper dynamic-method) RimWorld.StatExtension.GetStatValue_Patch1 (Verse.Thing,RimWorld.StatDef,bool) <0x00066>
at SimpleSidearms.utilities.StatCalculator.MeleeDPS (Verse.Pawn,Verse.ThingWithComps,single,Verse.Pawn) <0x000c1>
at SimpleSidearms.utilities.GettersFilters.findBestMeleeWeapon (Verse.Pawn,bool,Verse.Pawn) <0x0028b>
at SimpleSidearms.utilities.WeaponAssingment.tryMeleeWeaponSwap (Verse.Pawn,bool,bool,bool,Verse.Pawn) <0x000e2>
at SimpleSidearms.utilities.WeaponAssingment.tryCQCWeaponSwapToMelee (Verse.Pawn,Verse.Pawn) <0x001fc>
at SimpleSidearms.utilities.WeaponAssingment.doCQC (Verse.Pawn,Verse.Pawn) <0x00318>
at SimpleSidearms.intercepts.Verb_MeleeAttack_TryCastShot_PostFix.TryCastShot (RimWorld.Verb_MeleeAttack) <0x002b1>
at (wrapper dynamic-method) CombatExtended.Verb_MeleeAttackCE.TryCastShot_Patch1 (object) <0x015a6>
at (wrapper dynamic-method) Verse.Verb.TryCastNextBurstShot_Patch0 (object) <0x0006c>
at Verse.Verb.WarmupComplete () <0x0003b>
at (wrapper dynamic-method) Verse.Verb.TryStartCastOn_Patch1 (object,Verse.LocalTargetInfo,bool,bool) <0x00528>
at (wrapper dynamic-method) RimWorld.Pawn_MeleeVerbs.TryMeleeAttack_Patch1 (object,Verse.Thing,Verse.Verb,bool) <0x002d6>
at Verse.AI.JobDriver_AttackMelee/<MakeNewToils>c__Iterator0.<>m__1 () <0x00085>
at Verse.AI.Toils_Combat/<FollowAndMeleeAttack>c__AnonStorey3.<>m__0 () <0x00340>
at Verse.AI.JobDriver.DriverTick () <0x004a8>

Verse.Log:Error(String, Boolean)
Verse.AI.JobUtility:TryStartErrorRecoverJob(Pawn, String, Exception, JobDriver)
Verse.AI.JobDriver:DriverTick()
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick_Patch2(Object)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()




-----------------------------------------------------------------------
Those 2 bugs is for 1.0.2.
I'll try 1.0.3 when I next time play RW.

Roolo

Quote from: temple_wing on January 22, 2019, 02:42:45 AM
[...]
Those 2 bugs is for 1.0.2.
I'll try 1.0.3 when I next time play RW.

1.0.3 addresses both those issues.

HSneak

Dunno if this has already been reported regarding compatibility with Simple Sidearms, but whenever a pawn dual-wielding switches to a "sidearm" (as in "Equip as sidearm"), one of the two dual wielded weapons disappears completely (not on ground or in the pawn inventory). I've tried your mod loaded before and after Simple Sidearms, the bug still persists.

However though, I have a gigantic list of loaded mods, so don't bother if this happens only to me (474 loaded mods so far, madness yeah :D ). I can lock pawns to use only the dual wielding weapons.

Roolo

Quote from: HSneak on January 22, 2019, 05:37:30 AM
Dunno if this has already been reported regarding compatibility with Simple Sidearms, but whenever a pawn dual-wielding switches to a "sidearm" (as in "Equip as sidearm"), one of the two dual wielded weapons disappears completely (not on ground or in the pawn inventory). I've tried your mod loaded before and after Simple Sidearms, the bug still persists.

However though, I have a gigantic list of loaded mods, so don't bother if this happens only to me (474 loaded mods so far, madness yeah :D ). I can lock pawns to use only the dual wielding weapons.

Hmm, this doesn't happen when I use it with Simple Sidearms. Could you post your log by pressing ctrl+f12 after the issue occurs, and by placing the link you'll get here?

Edit: and holy crap 474 mods XD. I've never heard about someone loading in that many mods. I'm surprised that even runs, and I really don't want to know how long it takes to start up your game.

Madman666

Jesus, and here i though i am a heavy mod user with just around 180. Dayum.

TheLunatic889

I've currently got 113 mods (just added this in... I want to try out dual wielding a lightsaber) God I hope my laptop doesn't die, I haven't even tried using a single lightsaber.

HSneak

Quoteand holy crap 474 mods XD. I've never heard about someone loading in that many mods. I'm surprised that even runs, and I really don't want to know how long it takes to start up your game.

Yeah now launching the game is a project I have to take in order to play x) it takes roughly 1 hours to start (a lil' less, but i'm getting there, 480ish mods now :') ).

About the issue, I get no errors when I switch weapons, but here's the link anyway : https://gist.github.com/HugsLibRecordKeeper/6c8808f6c043ce2bfe71b023a9172ad6
I selected a pawn that had 2x 2handed weapons as sidearms, and dual wielding 2 pistols (equipped), I switched to the other weapons and no error log, but one of the pistols just disappeared totally (that's when I generated the log).

Once again, don't bother too much if this happens only to me x) I don't expect compatibility with what I run. But thank you anyways :D

Roolo

Update:
v1.0.4
- Pawns no longer use their off-hand weapon when beating fires (so they also won't shoot at fires anymore :) ).
- The cooldown penalty is no longer applied for dual wielding pawns beating a fire.
- Pawns no longer use their off-hand weapon during mental breaks/social fights.


temple_wing

I don't know whether this is a CE bug, DualWield bug or SimpleSidearm bug.


Exception ticking Spud (at (137, 0, 143)): System.NullReferenceException: Object reference not set to an instance of an object
at SimpleSidearms.utilities.WeaponAssingment.SetPrimary (Verse.Pawn,Verse.Thing,bool,bool,bool,bool) <0x006d6>
at SimpleSidearms.utilities.WeaponAssingment.tryRangedWeaponSwap (Verse.Pawn,bool,bool) <0x001b6>
at SimpleSidearms.intercepts.Verb_ShootOneUse_SelfConsume_Postfix.SelfConsume (RimWorld.Verb_ShootOneUse) <0x00334>
at (wrapper dynamic-method) CombatExtended.Verb_ShootCEOneUse.SelfConsume_Patch1 (object) <0x001be>
at CombatExtended.Verb_ShootCEOneUse.TryCastShot () <0x0003e>
at (wrapper dynamic-method) Verse.Verb.TryCastNextBurstShot_Patch0 (object) <0x0006c>
at Verse.Verb.WarmupComplete () <0x0003b>
at CombatExtended.Verb_LaunchProjectileCE.WarmupComplete () <0x001a8>
at CombatExtended.Verb_ShootCE.WarmupComplete () <0x002fb>
at DualWield.Stances.Stance_Warmup_DW.Expire () <0x00022>
at Verse.Stance_Busy.StanceTick () <0x0002b>
at (wrapper dynamic-method) Verse.Stance_Warmup.StanceTick_Patch1 (object) <0x003bb>
at DualWield.Stances.Stance_Warmup_DW.StanceTick () <0x00021>
at Verse.Pawn_StanceTracker.StanceTrackerTick () <0x0005d>
at DualWield.Harmony.Pawn_Tick.Postfix (Verse.Pawn) <0x000ae>
at (wrapper dynamic-method) Verse.Pawn.Tick_Patch2 (object) <0x00581>
at Verse.TickList.Tick () <0x00487>

Verse.Log:Error(String, Boolean)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()


This error happens 10 times when a pawn named "spud" trying to attack me with an explosive sac.
He has a knife in his inventory.
Every this error happens, a Molotov cocktail is thrown out from his hand. So 10 Molotov cocktails fly out from his hand in a line to my base.
Then a 10 jobs in 10 ticks error thrown.
Then again another 10 errors thrown.
Then another 10 jobs in 10 ticks error.
......

Finally this "spud" just "fires" infinite Molotov cocktails like firing a machine gun, and he never ends until anything in his sight has been destroyed.

My version is : 1.0.3

I guess CE or DualWield or SimpleSidearm, one of this three mods has some problem with OneUse weapon.

Roolo

Quote from: temple_wing on January 26, 2019, 10:53:18 AM
I don't know whether this is a CE bug, DualWield bug or SimpleSidearm bug.


Exception ticking Spud (at (137, 0, 143)): System.NullReferenceException: Object reference not set to an instance of an object
at SimpleSidearms.utilities.WeaponAssingment.SetPrimary (Verse.Pawn,Verse.Thing,bool,bool,bool,bool) <0x006d6>
at SimpleSidearms.utilities.WeaponAssingment.tryRangedWeaponSwap (Verse.Pawn,bool,bool) <0x001b6>
at SimpleSidearms.intercepts.Verb_ShootOneUse_SelfConsume_Postfix.SelfConsume (RimWorld.Verb_ShootOneUse) <0x00334>
at (wrapper dynamic-method) CombatExtended.Verb_ShootCEOneUse.SelfConsume_Patch1 (object) <0x001be>
at CombatExtended.Verb_ShootCEOneUse.TryCastShot () <0x0003e>
at (wrapper dynamic-method) Verse.Verb.TryCastNextBurstShot_Patch0 (object) <0x0006c>
at Verse.Verb.WarmupComplete () <0x0003b>
at CombatExtended.Verb_LaunchProjectileCE.WarmupComplete () <0x001a8>
at CombatExtended.Verb_ShootCE.WarmupComplete () <0x002fb>
at DualWield.Stances.Stance_Warmup_DW.Expire () <0x00022>
at Verse.Stance_Busy.StanceTick () <0x0002b>
at (wrapper dynamic-method) Verse.Stance_Warmup.StanceTick_Patch1 (object) <0x003bb>
at DualWield.Stances.Stance_Warmup_DW.StanceTick () <0x00021>
at Verse.Pawn_StanceTracker.StanceTrackerTick () <0x0005d>
at DualWield.Harmony.Pawn_Tick.Postfix (Verse.Pawn) <0x000ae>
at (wrapper dynamic-method) Verse.Pawn.Tick_Patch2 (object) <0x00581>
at Verse.TickList.Tick () <0x00487>

Verse.Log:Error(String, Boolean)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()


This error happens 10 times when a pawn named "spud" trying to attack me with an explosive sac.
He has a knife in his inventory.
Every this error happens, a Molotov cocktail is thrown out from his hand. So 10 Molotov cocktails fly out from his hand in a line to my base.
Then a 10 jobs in 10 ticks error thrown.
Then again another 10 errors thrown.
Then another 10 jobs in 10 ticks error.
......

Finally this "spud" just "fires" infinite Molotov cocktails like firing a machine gun, and he never ends until anything in his sight has been destroyed.

My version is : 1.0.3

I guess CE or DualWield or SimpleSidearm, one of this three mods has some problem with OneUse weapon.

CE and Dual wield aren't compatible. You can better not use them together. I'll look into creating a patch in the future, but no promises that that'll work out.