[1.3] [KV] Weapon Storage [ModSync RW]

Started by Kiame, September 05, 2017, 05:46:47 PM

Previous topic - Next topic

Kiame

#135
Update:
Weapon Storage settings are now populated dynamically. This means items such as tusks (vanilla or modded) will be included in what can be stored.

Wood and Beer can be stored in the weapon storage but it's best not to as pawns will not be able to access them w/o manual intervention. By default these two items are disabled in the filter.

Canute

You are one of the fastest modder :-)
Much thanks !

Kiame

Heh i had tried doing this before and i finally figured out what i was doing wrong.  :)

BTW if you grabbed the version i posted and it does not include Wood Logs in the filters consider grabbing the version i just (re)posted. I thought it would be better to have Beer and Logs be able to be stored but be disabled by default.

J.BEAR

Quote from: Kiame on September 30, 2018, 04:50:02 PM
Heh i had tried doing this before and i finally figured out what i was doing wrong.  :)

BTW if you grabbed the version i posted and it does not include Wood Logs in the filters consider grabbing the version i just (re)posted. I thought it would be better to have Beer and Logs be able to be stored but be disabled by default.

dammn bro u fast :)
updates and efforts much appreciated

5thHorseman

Quote from: Kiame on September 30, 2018, 03:56:17 PM
I guess it is time for me to figure out how add those 'weapons' dynamically to the filters....

I wonder what a tust is
It was obviously a typo. He wants to put the elephant's TRUST in there.

Why he would want that is unclear. Possibly to blathe with it.
Toolboxifier - Soil Clarifier
I never got how pawns in the game could have such insanely bad reactions to such mundane things.
Then I came to the forums.

Amnesiac

Quote from: Kiame on September 30, 2018, 03:29:46 PM
Update:
Fixed the issue where the first weapon would disappear when picking up another weapon.

The current fix is not my preferred method but for some reason i can't get my preferred path to work.
This fix is currently: If a pawn tries to pick up a weapon, even if the original weapon is assigned to the pawn, the original weapon will be dropped on the floor. To assign weapons to a pawn the best way is to use the weapon storage's Assign Weapon to do that.

Just tested it out, no errors or disappearing weapons as far as I can tell!

It would be nice if the weapon just went back to the "pocket dimension", which I assume is your preferred option, but since that doesn't seem to be as simple as it sounds, its easy enough to just unassigned the weapon, and re-assign it to the pawn you want using the interface on the storage box. No disappearing weapons so I'm happy with it!

Thank you for the quick updates Kiame! ;D

Kiame

#141
Update:
Fixed an issue where when the game saved, if the storage was emptied (tons of weapons in a single stack) when the game loaded, all the weapons would be spread around the storage and destroy anything the items landed on. Now when a game is saved, all weapons piled in front of all storages are collected.

Kiame

Update:
Fixed and issue that was causing the Mod Options from closing if no game had started. Sorry about that!


Kiame

Update:
Fixing an issue where abandoning a map that had a Weapon Storage would cause errors

Kiame

Update:
Works again with the newest version of Mending

notfood

#146
Kiame, if you hardcode the dll I can't update it. You seek version 1.0.6903.39358, the next compile it will have a different version and you will have to update it.

Try using __instance.getType().FullName == "MendAndRecycle.JobDriver_DoBill"

I think the following works too because typeof doesn't hardcode the DLL __instance.getType() == typeof(MendAndRecycle.JobDriver_DoBill)

I already had to push a bugfix and it's throwing:
XXX threw exception in WorkGiver DoBillsMending: System.TypeLoadException: Could not load type 'MendAndRecycle.WorkGiver_DoBill' from assembly 'MendAndRecycle, Version=1.0.6903.39358, Culture=neutral, PublicKeyToken=null'.
at (wrapper dynamic-method) RimWorld.WorkGiver_DoBill.TryFindBestBillIngredients_Patch3 (RimWorld.Bill,Verse.Pawn,Verse.Thing,System.Collections.Generic.List`1<Verse.ThingCount>) <0x005e3>
at RimWorld.WorkGiver_DoBill.StartOrResumeBillJob (Verse.Pawn,RimWorld.IBillGiver) <0x00412>
at (wrapper dynamic-method) RimWorld.WorkGiver_DoBill.JobOnThing_Patch1 (object,Verse.Pawn,Verse.Thing,bool) <0x002fe>
at MendAndRecycle.WorkGiver_DoBill.JobOnThing (Verse.Pawn,Verse.Thing,bool) <0x00031>
at RimWorld.WorkGiver_Scanner.HasJobOnThing (Verse.Pawn,Verse.Thing,bool) <0x00030>
at RimWorld.JobGiver_Work/<TryIssueJobPackage>c__AnonStorey1.<>m__0 (Verse.Thing) <0x00053>
at Verse.GenClosest/<ClosestThingReachable>c__AnonStorey0.<>m__0 (Verse.Thing) <0x000ca>
at Verse.GenClosest.ClosestThing_Global (Verse.IntVec3,System.Collections.IEnumerable,single,System.Predicate`1<Verse.Thing>,System.Func`2<Verse.Thing, single>) <0x001fe>
at Verse.GenClosest.ClosestThingReachable (Verse.IntVec3,Verse.Map,Verse.ThingRequest,Verse.AI.PathEndMode,Verse.TraverseParms,single,System.Predicate`1<Verse.Thing>,System.Collections.Generic.IEnumerable`1<Verse.Thing>,int,int,bool,Verse.RegionType,bool) <0x004a8>
at (wrapper dynamic-method) RimWorld.JobGiver_Work.TryIssueJobPackage_Patch1 (object,Verse.Pawn,Verse.AI.JobIssueParams) <0x01194>

Verse.Log:Error(String, Boolean)
RimWorld.JobGiver_Work:TryIssueJobPackage_Patch1(Object, Pawn, JobIssueParams)
Verse.AI.ThinkNode_PrioritySorter:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Tagger:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Subtree:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Conditional:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.Pawn_JobTracker:DetermineNextJob_Patch1(Object, ThinkTreeDef&)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob()
Verse.AI.Pawn_JobTracker:EndCurrentJob_Patch2(Object, JobCondition, Boolean)
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick_Patch2(Object)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay_Patch1(Object)
Verse.Root_Play:Update()

Kiame

Thanks notfood. I realized i didnt even need that line.

With your changes i was able to remove the mending dll altogether as a reference too. Since the method I'm patching is the base game's you should be able to change anything in that mod and Change Dresser/Weapon Storage/Infinite Storage will not need to be updated  ;D

They've all been updated

crusader2010

I'm getting a strange error when trying to build a Weapon's Storage item.
Any ideas what could be wrong? Got the latest version from all of your mods and MendingAndRecycle.
Basically, the weapon storage never gets built even though resources are used up.


Exception in JobDriver tick for pawn Rennie driver=_JobDriver_ConstructFinishFrame (toilIndex=1) driver.job=(FinishFrame (Job_1361752) A=Thing_Frame_WeaponStorage443066) lastJobGiver=RimWorld.JobGiver_Work
System.ArgumentNullException: Argument cannot be null.
Parameter name: type
at System.Activator.CheckType (System.Type) <0x00095>
at System.Activator.CreateInstance (System.Type,bool) <0x00027>
at System.Activator.CreateInstance (System.Type) <0x0001e>
at Verse.ThingMaker.MakeThing (Verse.ThingDef,Verse.ThingDef) <0x0035e>
at RimWorld.Frame.CompleteConstruction (Verse.Pawn) <0x00309>
at RimWorld.JobDriver_ConstructFinishFrame/<MakeNewToils>c__Iterator0/<MakeNewToils>c__AnonStorey1.<>m__1 () <0x00396>
at (wrapper dynamic-method) Verse.AI.JobDriver.DriverTick_Patch1 (object) <0x004c8>

Verse.Log:Error(String, Boolean)
Verse.AI.JobUtility:TryStartErrorRecoverJob(Pawn, String, Exception, JobDriver)
Verse.AI.JobDriver:DriverTick_Patch1(Object)
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick_Patch1(Object)
Verse.TickList:Tick_Patch2(Object)
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()
My mod pack: {A13} Mod Mega Pack

Kiame

Haven't seen that one... Is the weapon storage being build using a modded material? I vaguely remember either fluffys blueprints or stuff mod was having problems with modded furniture