Ludeon Forums

RimWorld => Mods => Releases => Topic started by: Kiame on September 05, 2017, 05:46:47 PM

Title: [1.3] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on September 05, 2017, 05:46:47 PM
Stores weapons and allows weapons to be assigned to pawns for use in the field.

Weapon Storage
-Build Menu: Furniture
-Size: 1x1
-Cost: 40 steel + 40 wood/stone/steel
-Stores: Weapons (ranges and melee)

Repair Attachment
-Build Menu: Misc
-Size: 1x1
-Cost: 250 steel + 6 components + 20 wood/stone/steel
-Energy: 10 W (not in use) or 1000 W (in use)
-Place within 6 squares of a Weapon Storage to have weapons automatically repaired
-Research Required: Mending & Multi-Analyzer
-Mending (http://steamcommunity.com/sharedfiles/filedetails/?id=735241897) Mod not required (highly recommended though)]

Using Grenades:
To assign grenades select any Weapon Storage then Manage Shared Weapons
-From the new window create a new filter and call it something like "emp frag"
-In the list select the grenades you want available to colonists, like "frag grenade" and " EMP grenade"
-Close the Filter window
-Assign colonists to the "emp frag" group

Now when you select a colonist that's assigned "emp frag" they can equip either frag or emp grenades (if there are any stored in Weapon Storage)

Load Order
-Combat Extended
-Weapon Storage
-Weapon Storage Combat Extended Patch



Compatible with:
Save Storage & Outfit Settings - https://ludeon.com/forums/index.php?topic=34075.0
Change Dresser - https://ludeon.com/forums/index.php?topic=30973.0


Direct Download:
1.3 (https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.3/WeaponStorage.zip)

A17 (https://github.com/KiameV/rimworld-weaponstorage/releases/download/20171010/WeaponStorage.zip)
B18 (https://github.com/KiameV/rimworld-weaponstorage/releases/download/A18/WeaponStorage.zip)
B19 (https://github.com/KiameV/rimworld-weaponstorage/releases/download/B19/WeaponStorage.zip)
1.0 (https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.0/WeaponStorage.zip)
1.2 (https://github.com/KiameV/rimworld-weaponstorage/releases/download/current/WeaponStorage.zip)

Use ModSync RW (https://ludeon.com/forums/index.php?topic=41634.0) to know if/when there's an update


Steam (http://steamcommunity.com/sharedfiles/filedetails/?id=1180720427)

GitHub: https://github.com/KiameV/rimworld-weaponstorage


If the storage crate is destroyed all stored weapons will drop on the floor. Assigned weapons will not drop on the floor though and will still be usable by the pawns the weapons are assigned to. To change or access the assigned weapons, use any other weapon storage crate.

Items stored in a weapon storage will not show up in merchant screens. To make them available for sale use the "Empty" button to cause all the items to fall on the floor.

Instructions for assigning weapons:

When a weapon is assigned to a pawn, that weapon is no longer stored in that container. Instead the weapon will exist in a pocket dimension (think bag of holding  ;) ) that is accessible by any other Weapon Storage and by the assigned pawn

The pawn can, when drafted, switch to any assigned weapon by reaching into their pocket of holding and place whatever weapon they were holding into the other dimension.

Some cases/behaviors to consider - these are not hard coded but just how the mod works. If there's strong feedback regarding any of these I will consider changing them.


Forming Caravans
Stored weapons will be available for caravans. Until the pawns in the caravan either exit the map or are told to cancel the caravan, the weapons will remain scattered around the storages. If something goes wrong and the items are not collected, let me know and click the "Collect" button on the weapon storages.

As of now if the Cancel button is used from the Form Caravan window, the weapons will not be collected. This will likely remain the case for the time being due to limitations in modding tools.

This can be fixed by either using the Collect button or forming another caravan and either allow it to leave the map or cancel the caravan

Repair Attachment
Will detect if weapons within attached Weapon Storages need to be repaired.
Each Repair Attachment can only repair one weapon at a time.
More than one Repair Attachment can be attached to one or more Weapon Storages (many-to-many relationship)

(https://steamuserimages-a.akamaihd.net/ugc/921416084910822520/259C3B661B25E153B2D42B6E47B3C1AE41E1E8E8/)


Like my mods? Consider supporting me!
(http://www.travistygames.com/private/kofi3.png) (https://ko-fi.com/kiamev)
Title: Re: [A17] Weapon Storage
Post by: faltonico on September 05, 2017, 11:43:35 PM
So, this would be effectively an option to simple sidearms?
Sometimes i want my pawns to shoot things to the face and not punch it (an orassan LMG is that good!), nor i want them to look for their weapons as soon as the can walk again.
I'm getting this! thanks!
Title: Re: [A17] Weapon Storage
Post by: SpaceDorf on September 06, 2017, 07:17:38 AM
Good Question.

Does this mod enable pawns to carry multiple weapons or are they required to exchange their weapons from the box ?
Title: Re: [A17] Weapon Storage
Post by: Kiame on September 06, 2017, 12:39:07 PM
<I was looking for something like the side arms mod but i hadn't found it and so i made this  ;D >

The main difference between the side arms mod and this mod is the pawn does not need to carry the weapons they are assigned with. This mod also adds a place to store all those weapons from that last raid!

Pawns never have to interact with the storage box except when they put a weapon into it for storage.

There is no limit (that i've set in the code) to how many weapons a pawn can be assigned with. In my testing I had a pawn assigned with 10 assault rifles, a few bows, and a few long swords. Pointless? Yes. It work though  :P

Steps:
Some cases/behaviors to consider - these are not hard coded but just how the mod works. If there's strong feedback regarding any of these I will consider changing them.
Title: Re: [A17] Weapon Storage
Post by: Kiame on September 06, 2017, 01:25:08 PM
Quote from: faltonico on September 05, 2017, 11:43:35 PM
...nor i want them to look for their weapons as soon as the can walk again.
I'm getting this! thanks!

This is one thing i didn't consider. Maybe I'll add some code to have assigned weapons go back to the pocket dimension when the pawn either dies or is disabled.
I'll play around with this in my game. Maybe have this as a Mod Setting.
Title: Re: [A17] Weapon Storage
Post by: SpaceDorf on September 07, 2017, 03:41:40 AM
It's Hammerspace !

Awesome :)

Final and most important question : Do Caravans have access to the Gunstorage ?
Title: Re: [A17] Weapon Storage
Post by: Canute on September 07, 2017, 06:47:54 AM
Extra dimensional pocket space, TARDIS, why not create a caravan storage box.

The idea is neat, but the result is not very satisfying in my point of view.
Some hauler put into the weapon storage at the homebase, and the soldier 200 tiles away can swap it.
Title: Re: [A17] Weapon Storage
Post by: SpaceDorf on September 07, 2017, 08:02:33 AM
A Transporter as endgame tech would be a nice addition :)

That is what I like about the simple side arms mod ..
a fully equipped pawn struts arround with 125kg ..

Title: Re: [A17] Weapon Storage
Post by: Kiame on September 07, 2017, 01:35:14 PM
Quote from: Canute on September 07, 2017, 06:47:54 AM
Extra dimensional pocket space, TARDIS, why not create a caravan storage box.

The idea is neat, but the result is not very satisfying in my point of view.
Some hauler put into the weapon storage at the homebase, and the soldier 200 tiles away can swap it.

Basically. I like it as it's less micro management or if I forget to have one pawn grab one weapon before they leave i can correct that mistake. This is the same functionality as the Change Dresser (https://ludeon.com/forums/index.php?topic=30973.0) mod. This is the nice thing about mods, if someone thinks it's OP or doesn't fit in their world/sand box they don't need to use it  :D

Quote from: SpaceDorf on September 07, 2017, 03:41:40 AMFinal and most important question : Do Caravans have access to the Gunstorage ?

Yes. From any map a pawn will have access to assigned weapons. There is no access from the wold map though.
Title: Re: [A17] Weapon Storage
Post by: Kiame on September 09, 2017, 02:37:50 PM
Update:
-When assigning weapons to pawns the pawn's equipped weapon is now displayed
-The Assign Weapon window will now list the contained weapons before selecting a pawn
Title: Re: [A17] Weapon Storage
Post by: Kiame on September 11, 2017, 03:13:45 AM
Sep 10, 2017
-Fixed an issue where the first weapon in the lsit was not showing up.
-General code cleanup for better support in the future.
Title: Re: [A17] Weapon Storage
Post by: Expresso on September 12, 2017, 02:36:34 PM
Your mod is compatible with ?
https://ludeon.com/forums/index.php?topic=32497.0
Title: Re: [A17] Weapon Storage
Post by: Kiame on September 14, 2017, 02:52:31 AM
Quote from: Expresso on September 12, 2017, 02:36:34 PM
Your mod is compatible with ?
https://ludeon.com/forums/index.php?topic=32497.0

Not sure, haven't tried. They both do more or less the same thing though.

WeaponStorage (this mod) stores the weapons for the pawns so the pawns don't have to carry them around though.

Title: Re: [A17] Weapon Storage
Post by: Expresso on September 14, 2017, 03:34:21 AM
It is a pity of course, if they do not perceive each other.

Weapons of vinyl used perfectly, but how about CE. Storage and use of cartridges?
Title: Re: [A17] Weapon Storage
Post by: Kiame on September 14, 2017, 05:54:10 PM
This will support any modded weapons. No idea regarding cartridges (didn't even know there were mods w/ cartridges tbh)
Title: Re: [A17] Weapon Storage
Post by: Kiame on September 18, 2017, 04:17:13 PM
Added the ability to drop one weapon at a time.

Steam and direct download updated
Title: Re: [A17] Weapon Storage
Post by: Kiame on October 01, 2017, 03:24:06 PM
Update: If a pawn has one or more weapons assigned to them, when they are downed, the currently equipped weapon will go back into storage instead of being dropped on the ground. When the pawn is drafted again they will need to re-equip the weapon.

Steam and direct download updated
Title: Re: [A17] Weapon Storage
Post by: Kiame on October 01, 2017, 07:55:50 PM
If anyone downloaded this earlier today (October 1st) please download it again. There was a bug in the code which prevented player-owned animals from becoming 'downed' which meant they'd stay up until they were killed. Direct download and steam have been updated with the fix.
Title: Re: [A17] Weapon Storage
Post by: Canute on October 02, 2017, 03:50:45 AM
What do you think about to add this feature to Raiders too ?
All weapons from downed/killed entities teleport back to the faction storage.
I think this is just fair ! :-)
Title: Re: [A17] Weapon Storage
Post by: Kiame on October 02, 2017, 12:54:51 PM
They'll have to build their own Weapon Storage first then assign weapons to each of their raiders. I don't think savages will take the time to do that but you never know  :P
Title: Re: [A17] Weapon Storage
Post by: Kiame on October 08, 2017, 12:14:47 AM
Update:
Weapons in the GUI are now sorted by type.
Cleaning up the buttons for selecting weapons when pawns are drafted.
Title: Re: [A17] Weapon Storage
Post by: Kiame on October 11, 2017, 01:26:57 AM
Update:
Added an option in Mod Settings to display weapon buttons even when a pawn is not drafted.
Title: Re: [A18] Weapon Storage
Post by: Kiame on October 25, 2017, 03:29:53 AM
A18.1700 version can be downloaded here: https://github.com/KiameV/rimworld-weaponstorage/releases/download/20171025/WeaponStorage.zip
Title: Re: [A18] Weapon Storage
Post by: NemesisN on October 31, 2017, 11:14:26 PM
Every time I draft my colonist he drops all of his clothes, anything to do with this mod ?
Title: Re: [A18] Weapon Storage
Post by: Kiame on November 01, 2017, 01:54:58 AM
This mod does not touch what a pawn is wearing

Do you have the Change Dresser mod - https://ludeon.com/forums/index.php?topic=35632.0 ?

That's probably what's causing the issue. I'll assume you're playing A17 at this point. There were two version of Change Dresser for A17, the original version and the BETA version. I'm going to guess if all yes so far that you're using the BETA version.

More than likely what's happening is the pawn has a battle outfit assigned to them. When they become drafted, the worn apparel tries to be placed into a Change Dresser, no applicable Change Dressers are found (due to filters) and are dropped on the ground. To fix this build another Change Dresser that accepts all apparel but set its Priority to Low (default value) so that no pawns intentionally store apparel in it.

If I'm completely off base let me know!
Title: Re: [A18] Weapon Storage
Post by: NemesisN on November 01, 2017, 05:27:54 PM
Quote from: Kiame on November 01, 2017, 01:54:58 AM
This mod does not touch what a pawn is wearing

Do you have the Change Dresser mod - https://ludeon.com/forums/index.php?topic=35632.0 ?

That's probably what's causing the issue. I'll assume you're playing A17 at this point. There were two version of Change Dresser for A17, the original version and the BETA version. I'm going to guess if all yes so far that you're using the BETA version.

More than likely what's happening is the pawn has a battle outfit assigned to them. When they become drafted, the worn apparel tries to be placed into a Change Dresser, no applicable Change Dressers are found (due to filters) and are dropped on the ground. To fix this build another Change Dresser that accepts all apparel but set its Priority to Low (default value) so that no pawns intentionally store apparel in it.

If I'm completely off base let me know!

yup just had to enabled all clothes as check mark and he does not strip down....I had them disabled because I did not want to store clothes currently there
Title: Re: [A18] Weapon Storage
Post by: Kiame on November 01, 2017, 05:48:31 PM
Great glad that fixed it  :)

My thought on this is: as long as the priority is Low stuff that's not being used shouldn't end up in the dressers.

I know it can be annoying as the apparel does not show up in land-based trades. I still want to get this working. At least orbital trading should have the dresser's contents listed.
Title: Re: [A18] Weapon Storage
Post by: Kiame on November 04, 2017, 05:54:50 PM
Fixed for the latest A18 unstable build. Steam and direct download updated
Title: Re: [A18] Weapon Storage
Post by: Kiame on November 19, 2017, 05:43:32 PM
Update:
Added "Repair Attachment"
See mod description for more details
Stored Weapons will now show up in trade windows
Title: Re: [B18] Weapon Storage
Post by: Kiame on November 19, 2017, 11:01:49 PM
Update B18:
-Repair Attachment can now repair assigned equipped weapons as long as the pawn is not drafted and using them
-Repair Attachment will prioritize repairs in the following way: Assigned Weapons (starting with currently equipped) then weapons stored in the crates from highest priority to lowest

Update A17:
-Updated with all the features of A18
Title: Re: [B18] Weapon Storage
Post by: Kiame on November 21, 2017, 12:46:11 AM
Update:
I've found a strange and hard to reproduce bug when trading with caravans. If a saved game is loaded twice and then a trade is initiated, the weapons will fail to spawn and be lost.
I've spent the last two hours trying to find the root of the issue and as of yet have had no success. Due to the severity of this bug I've disabled trading with weapons in storage.

If you want to sell stored weapons use the "Empty" button to dump the weapons, trade, then use the "Collect" button to pickup the dropped weapons.

For those that do not want to download this interim update, you can select the Weapon Storages and toggle the Sell Weapons button which will prevent the weapons from failing to drop.
Title: Re: [B18] Weapon Storage
Post by: Kiame on November 21, 2017, 02:19:34 PM
I think i've figure out what the problem is. I'm going to put it through some extended testing now. For anyone that wants to grab it feel free to via direct download. I have not pushed it to steam yet.
Title: Re: [B18] Weapon Storage
Post by: kaptain_kavern on November 21, 2017, 02:33:08 PM
Woa this looks like a very tricky bug. Props for even finding it ^^
Title: Re: [B18] Weapon Storage
Post by: Kiame on November 21, 2017, 03:12:16 PM
Turned out to be a dumb oversight on my part. It will happen when creating/loading multiple games, after the second loading of a game with weapon storages, opening a trade window will cause this bug to rear its ugly head

For those who know programming, it was me not clearing a static list of all current weapon storages with new game/load   :-\
Garbage/Memory management FTL
Title: Re: [B18] Weapon Storage
Post by: Kiame on November 26, 2017, 01:16:35 AM
Fixed an issue where Include in Sale button selection was not persisting between saves
Title: Re: [B18] Weapon Storage
Post by: Athanatos154 on November 30, 2017, 03:45:32 PM
I think there is a bug concerning the do until you have X.
I am crafting charge rifles and want to always have one extra so I have set it to do until you have 1, but the ones in the weapon storage don't count.
Title: Re: [B18] Weapon Storage
Post by: Kiame on November 30, 2017, 03:50:06 PM
Yes 'make until x' is a known issue for Change Dresser, Weapon Storage, and Body Part Storage

I think i'll finally sit down and figure it out this weekend
Title: Re: [B18] Weapon Storage
Post by: Kiame on November 30, 2017, 05:01:57 PM
"Do until X" is now supported. Stored weapons will be counted
Title: Re: [B18] Weapon Storage
Post by: Canute on December 01, 2017, 04:14:39 AM
Do you own a timemanipulator or got a genius-inspiration, this was a fast weekend ! :-))
Reply #36 on: November 30, 2017, 03:50:06 PM
Reply #37 on: November 30, 2017, 05:01:57 PM
Title: Re: [B18] Weapon Storage
Post by: SpaceDorf on December 01, 2017, 05:23:46 AM
For balance reasons I think the Storages are to cheap.
Especially with the auto-repair option.

And how does the repair addon work in detail ?
Is it over time or instantly ?
Could you expand it so it requires Mending Kits as fuel ?
Title: Re: [B18] Weapon Storage
Post by: Questops on December 01, 2017, 06:17:03 AM
I unassigned a pawn from a thrumbo horn and the weapon storage ate my thrumbo horn..  :'(
Title: Re: [B18] Weapon Storage
Post by: Canute on December 01, 2017, 06:38:43 AM
Quote from: SpaceDorf on December 01, 2017, 05:23:46 AM
For balance reasons I think the Storages are to cheap.
Especially with the auto-repair option.

And how does the repair addon work in detail ?
Is it over time or instantly ?
Could you expand it so it requires Mending Kits as fuel ?
It should work like the one for Change dresser.
Need 1000W power , and slowly repair 1 item each attachment.
Title: Re: [B18] Weapon Storage
Post by: SpaceDorf on December 01, 2017, 06:47:08 AM
Okay .. I have build one for change dresser but not filled it yet.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on December 03, 2017, 08:06:02 PM
Adding ModSync.ninja (http://www.modsync.ninja/) support
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on December 14, 2017, 04:19:52 PM
Fixing an issue where this mod would cause Mac and Linux to crash
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: frenchiveruti on December 17, 2017, 03:54:42 PM
Hey Kiame can I ask that the "mending" patch also works for this mod?
Maybe use modCheck to see if your own mod is installed and activated and run the patch for the Weapon Storage.
As right now, I need to "take the weapons out" in order to repair them in the mending table. So it would be nice to have them directly out of the gun storage.
Thanks!
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Canute on December 17, 2017, 04:01:12 PM
frenchiveruti,
did you allready build a
QuoteRepair Attachment
-Build Menu: Misc
-Size: 1x1
-Cost: 250 steel + 6 components + 20 wood/stone/steel
-Energy: 10 W (not in use) or 1000 W (in use)
-Place within 6 squares of a Weapon Storage to have weapons automatically repaired
-Research Required: Mending & Multi-Analyzer
-Mending Mod not required (highly recommended though)
??
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: frenchiveruti on December 17, 2017, 04:03:48 PM
Quote from: Canute on December 17, 2017, 04:01:12 PM
frenchiveruti,
did you allready build a
QuoteRepair Attachment
-Build Menu: Misc
-Size: 1x1
-Cost: 250 steel + 6 components + 20 wood/stone/steel
-Energy: 10 W (not in use) or 1000 W (in use)
-Place within 6 squares of a Weapon Storage to have weapons automatically repaired
-Research Required: Mending & Multi-Analyzer
-Mending Mod not required (highly recommended though)
??
Ah yes I know that there's a repair attachment, but those buggers consume 1k of power and I'm not anywhere near that!
As the Change Dresser includes the ability to take out the clothing automatically for mending I thought it could be the same for this Mod.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on December 17, 2017, 04:24:10 PM
here's my newbness... i thought mending was only for apparel!

Let me double check and i'll get that function added over to this
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on December 21, 2017, 10:17:13 PM
Update:
-When a pawn is downed, the weapon in use will be remembered and re-equipped when the pawn is healed.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: frenchiveruti on December 22, 2017, 02:21:59 PM
Quote from: Kiame on December 21, 2017, 10:17:13 PM
Update:
-When a pawn is downed, the weapon in use will be remembered and re-equipped when the pawn is healed.
Yay! Thanks! This is awesome.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on December 22, 2017, 11:31:34 PM
Update:
-Stored weapons will now be available when forming caravans

Note: Until the pawns in the caravan either exit the map or are told to cancel the caravan, the weapons will remain scattered around the storage.
If something goes wrong and the items are not collected, let me know and click the "Collect" button on the storage.

As of now if the Cancel button is used from the Form Caravan window, the weapons will not be collected. This will likely remain the case for the time being due to limitations in modding tools. This can be fixed by either using the Collect button or forming another caravan and either allow it to leave the map or cancel the caravan
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on December 29, 2017, 03:01:35 AM
Update:
-Stored Weapons can now be used in bills
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: frenchiveruti on December 29, 2017, 06:11:28 AM
Quote from: Kiame on December 29, 2017, 03:01:35 AM
Update:
-Stored Weapons can now be used in bills
YEESHHH.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on December 29, 2017, 11:56:28 PM
New mod added to add mending support: https://ludeon.com/forums/index.php?topic=37942.msg388564#msg388564
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on January 02, 2018, 10:32:05 PM
Update:
-Fixed an issue where Reset on a trade window would cause stored items to no longer be shown
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Harry_Dicks on January 05, 2018, 05:00:20 PM
What does the mod option "Show weapon when not drafted" do? I thought it meant show the weapon on the pawn, but that didn't work for me. Am I misinterpreting it, or do I need to restart once the option is enabled? One more thing, if it was meant to show the weapon on the pawn when not drafted, do you think we could have a list of what weapons to show and not show, like how Simple Sidearms has the list in mod options for what will be defined as a sidearm and what isn't? The reason I ask, is because I'm using Right Tool for the Job with Simple Sidearms, and was hoping to only have tools show up when a pawn had them equipped and undrafted. So my miners you could see the pickaxe, constructors with a hammer, etc. I understand that if that was not your intention of the mod, but when I saw the option, it got me very excited, as I was just thinking about how it could show their tools earlier today!
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on January 05, 2018, 05:15:34 PM
The option, when checked, will allow you to switch between weapons when the pawn is not drafted via the buttons at the bottom of the screen. For some mods this is helpful as the pawns switch between different civilian 'weapons' (pickaxes, shovels, etc).

For base game this doesn't do anything else but let you switch between assigned weapons for when the pawn is drafted.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Harry_Dicks on January 05, 2018, 07:10:38 PM
Quote from: Kiame on January 05, 2018, 05:15:34 PM
The option, when checked, will allow you to switch between weapons when the pawn is not drafted via the buttons at the bottom of the screen. For some mods this is helpful as the pawns switch between different civilian 'weapons' (pickaxes, shovels, etc).

For base game this doesn't do anything else but let you switch between assigned weapons for when the pawn is drafted.

Ahh sweet, I understand now, thanks! It would be really, really cool if someone could come up with a way to let pawns auto-swap to certain tools for specific jobs, if they are available in weapon storage or as a sidearm. I don't mind doing it manually, but would be fantastic if it could happen automatically!
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Harry_Dicks on January 12, 2018, 11:21:08 PM
On the mod options, there is the option to "Show weapon while not drafted." Do you think there could be a way you could choose what weapons to show? It would be really cool I think, and that way I could have my tools showing, mining pick axe, hammer, axe, batons, non-lethal shotgun (for wardens watching prisoners work the mine) would be really great! I just don't want all weapons to show. Though I suppose with Simple Sidearms, I could just add another slot, and unequip main weapon, or swap weapon into your storage.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on January 12, 2018, 11:23:19 PM
Quote from: Harry_Dicks on January 12, 2018, 11:21:08 PM
On the mod options, there is the option to "Show weapon while not drafted." Do you think there could be a way you could choose what weapons to show? It would be really cool I think, and that way I could have my tools showing, mining pick axe, hammer, axe, batons, non-lethal shotgun (for wardens watching prisoners work the mine) would be really great! I just don't want all weapons to show. Though I suppose with Simple Sidearms, I could just add another slot, and unequip main weapon, or swap weapon into your storage.

I could look into an option to only show tools and the currently equipped weapon. Are the tools from Right Tool For The Job: Rebalanced? https://ludeon.com/forums/index.php?topic=33092.0
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Harry_Dicks on January 13, 2018, 03:06:07 AM
Quote from: Kiame on January 12, 2018, 11:23:19 PM
Quote from: Harry_Dicks on January 12, 2018, 11:21:08 PM
On the mod options, there is the option to "Show weapon while not drafted." Do you think there could be a way you could choose what weapons to show? It would be really cool I think, and that way I could have my tools showing, mining pick axe, hammer, axe, batons, non-lethal shotgun (for wardens watching prisoners work the mine) would be really great! I just don't want all weapons to show. Though I suppose with Simple Sidearms, I could just add another slot, and unequip main weapon, or swap weapon into your storage.

I could look into an option to only show tools and the currently equipped weapon. Are the tools from Right Tool For The Job: Rebalanced? https://ludeon.com/forums/index.php?topic=33092.0

Yes, yes they are! Holy crap if you could do that, I think it would be so freaking awesome! One final question: could there be anyway to make pawns automatically swap tools (weapons) that are in their weapon storage, based upon what job they are going to do next? For example say they are going to do a tree cut job, so it checks if they have a wood ax and then automatically swaps. Or the pick ax for mining jobs, etc. Would something like that be possible, or is that beyond the scope of this mod? Either way, even if it is only just display weapons/tools, I think it would be great! Finally, the reason I think it would be cool to have in the mod options where you could choose what items to display or not display, would make it easier for if you add anything in with mods. Similar to how Simple Sidearms let's you decide what will or won't be a sidearm, ya'know?

PS - I also just started using Facial Stuff. This mod seems great, and I think I might continue to use it. However, the default options will show a pawns hands (looks like Prison Architect) and I enabled your mod option to show weapon, and it did not work. I did have your mods loaded before them, though. I believe this could be the culprit as to why weapons did not show, because I believe I read on a separate mod that added only hands, saying something about pawns display. I'm thinking it could still work if I maybe disable the hands on that mod, but forgot to test it before I closed down RimWorld. Was curious if you might know a solution, if that is the case. I'll check some more tomorrow after I'm up.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on January 13, 2018, 04:35:14 PM
Update:

Adding better support for Right Tool For The Job (https://ludeon.com/forums/index.php?topic=33092.0)
-Tracks last tool used (when undrafted) and last weapon used (when drafted) so switching back and forth will re-equip the last tool/weapon
-No longer need to select the Mod Option to Show Weapons to show tools - tools will always be displayed.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Harry_Dicks on January 13, 2018, 06:05:44 PM
Quote from: Kiame on January 13, 2018, 04:35:14 PM
Update:

Adding better support for Right Tool For The Job (https://ludeon.com/forums/index.php?topic=33092.0)
-Tracks last tool used (when undrafted) and last weapon used (when drafted) so switching back and forth will re-equip the last tool/weapon
-No longer need to select the Mod Option to Show Weapons to show tools - tools will always be displayed.

Dude, dude... you're making my dreams come true, man! It's so great to see stuff like this happening. Thank you, Kiame!

EDIT: OMG. If anyone wants to see a prime example of me being a fucking idiot, and maybe I post here too much and forget too many things, look at page 4 of this thread. I ask Kiame something on Jan 5th, and then he answers me. I guess I forget that I even had this idea or asked him in the first place, because on Jan 12th I ask him THE SAME FUCKING QUESTION! Too much smokeleaf.. ::)
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on January 13, 2018, 09:28:23 PM
Glad you forgot. I was overwhelmed with getting Infinite Storage working that this request got lost in the mix.

As for automatically changing tools for jobs I don't think I want to include that in this mod as it's somewhat out of scope. I may consider a patch-mod like i've done with Change Dresser and this mod with mending wherein both RTftJ and WS need to be included prior to the new mod. No promises at this point though
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Harry_Dicks on January 14, 2018, 12:56:17 AM
Quote from: Kiame on January 13, 2018, 09:28:23 PM
Glad you forgot. I was overwhelmed with getting Infinite Storage working that this request got lost in the mix.

Haha, did you forget that I had already asked it, though? Or did you see my post 5 days later, again, and think maybe this guy isn't right in the head? :P Also don't tell me the request got lost, now you make me think it is best if I always repeat my horrible ideas at least once! ::)

Quote from: Kiame on January 13, 2018, 09:28:23 PM
As for automatically changing tools for jobs I don't think I want to include that in this mod as it's somewhat out of scope. I may consider a patch-mod like i've done with Change Dresser and this mod with mending wherein both RTftJ and WS need to be included prior to the new mod. No promises at this point though

Hey man, that's cool too. At least we got something! And all I can do is ask. If you do decide to make it in the future though, boy oh boy would it be nice!
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Harry_Dicks on January 14, 2018, 05:17:17 PM
Kiame, did you not update github?
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on January 14, 2018, 05:50:26 PM
I believe i did. I've re-uploaded just in case.

If you're looking at the date, ignore it. That's when it was first posted, no last updated
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Harry_Dicks on January 14, 2018, 05:56:14 PM
I think that was it, it was 2KB more than my last one, going to check it now.

By the way, my opinion man, but why do you do that with your release on github? It is very confusing to people, it definitely messed with me. Because of the date on Release page not changing. So then I try your master branch, but one of your mods didn't have the Assemblies folder that I didn't notice when extracting it. Why don't you put a little entry in the description at least on github Release page, release version number and date? Because I see your posts that you are making updates to your mods, but then I see the date on github and think you have not updated this. I am not trying to tell you how you should host your mods. I just want you to know, as an end user, that the way you host it like this it can make it confusing for some of us. That's all, love your mods! ;D
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on January 14, 2018, 06:03:21 PM
None of my mods have the assemblies as that's not how repositories should work.

All anyone has to do is press the links on the first page that say "Direct Download - A17  B18" as those point right to the zip file

I do it this way because if i change the release I'll need to update the urls on both the ludeon post and steam post. I have 16 mods I support so I make it as easy on myself as possible
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Harry_Dicks on January 14, 2018, 06:12:10 PM
I understand that it can be a lot to keep up with, and was curious. Maybe it wasn't assemblies, but I think it wasn't the correct version I needed and was breaking the game. Then I got the one from releases even though I thought it was older, until I found out that date isn't correct.

Do you think you could just throw a little "13-1-2014 update" in the description, or does that require you to update the release if you change anything?
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on January 14, 2018, 06:21:14 PM
To know if you have the most recent version, this mod is using ModSync.ninja (http://www.modsync.ninja)
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on January 16, 2018, 03:17:44 AM
Update:
Fixing an issue where all assigned weapons could be lost when adding or removing an assigned weapon.

Looks like i broken something with the last update and TBH I'm not sure how this code was working prior to the last update and why this wasn't breaking until now. In any case sorry for any problems this might have caused!
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Ruisuki on February 21, 2018, 08:50:43 PM
does this mod have a limit as to how many weapons a container can hold? I like to build an armory room close to the 1st floor of my mountain bases where all my guards suit up before going to a fight. If not, is there an option to set a limit in the mod settings so I can have a sense of realism?
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on February 22, 2018, 12:39:41 PM
There is no limit to the number of weapons that are stored and there is no option to create a limit.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Ruisuki on February 22, 2018, 12:47:28 PM
Damn. I guess Im just gonna have to remember to not put more than 5 items in each container then.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on May 05, 2018, 09:33:56 PM
Update:
-'Do Until X' will not take into account quality and hit point filters when counting
Note: Any mod that adds its own filters will not be supported
-Stored items will now be correctly tallied when calculating a colony's total wealth
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on May 09, 2018, 01:58:23 PM
Combat Extended patch for storing ammo:
Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=1381850455
GitHub: https://github.com/Nyx01/Weapon_Storage_CE_Patch_b18

Thanks to steam user Nyx (https://steamcommunity.com/id/nyx_01) for making this
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Chaos17 on May 09, 2018, 04:19:04 PM
I really like this individual storage for pawns, is it possible to extend it to armors too?
It would be so cool to see pawn go to their storage and equip what in there  8)
Unless the basic dresser already do that? I didn't saw that option.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on May 09, 2018, 04:55:43 PM
Ammo is a different mod so switching out ammo will not be possible.

See the post above this for an add-on mod for at least storing ammo
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Chaos17 on May 09, 2018, 04:58:15 PM
I was talking about Armor/equipement/gears  ;D
I know that you made another mod named "change dresser" but it doesn't let pawn to have individual storage to store they own clothes like in this mod who store guns, does it?
If yes, then ignore my question.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on May 09, 2018, 06:03:54 PM
drr i can't read... Saw Armor and thought Ammo...

I did have Change Dresser originally using personalized apparel but changed over to the base game's Outfits as it was simpler all around. I would like to make another pass and add in individual loadouts for apparel/armor at some point
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: vulkans on May 13, 2018, 09:55:56 PM
I'm getting a problem that I've narrowed down to some sort of interaction with the Hospitality mod: Successfully recruiting a hospitality visitor pawn causes the assign weapons button to break on the weapon boxes, the debug console prints out "An element with the same key already exists in the dictionary." when it's clicked. Saving and reloading the game fixes the problem.
Title: Re: [B18] [KV] Weapon Storage [ModSync]
Post by: Kiame on May 14, 2018, 12:48:26 AM
Hmm...
This is one of my earlier mods and after re-working parts of Change Dresser I'm scared to look at this code for this one  ;D

I'm thinking this'll require some TLC all around. I'll probably get to looking at it in the RW 1.0 timeframe. I will have this bug listed as things to investigate at that time Vulkans. Thanks for the feedback and hopefully it's not too painful to work around!
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on June 29, 2018, 12:54:30 AM
Update for 1.0: https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.0/WeaponStorage.zip

Use ModSync RW (https://ludeon.com/forums/index.php?topic=41634.0) to know if/when there's an update
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on July 01, 2018, 06:43:27 PM
1.0 Update:
Both Change Dresser (https://ludeon.com/forums/index.php?topic=41483.0) and Weapon Storage now have a setting for changing the speed the mending attachment mends at
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on July 07, 2018, 03:27:41 PM
Update: Added a new setting "Seconds Between Ticks" to go along with the renamed setting "HP Per Tick"

Example:
"Seconds Between Ticks" = 5.5
"HP Per Tick" = 2
Means: Every five and a half seconds, repair weapons two HP

For more information please see: https://ludeon.com/forums/index.php?topic=41483.msg416523#msg416523
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on July 24, 2018, 01:48:05 AM
[1.0] Updated to work with the latest unstable version
https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.0/WeaponStorage.zip
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: doc776 on July 25, 2018, 01:57:22 AM
not sure if new bug with new dev release right after this fix or my game is crippled.

I cant switch assigned weapons in combat mode and whenever I load the game all weapons are scattered on the floor and destroy few walls around the box. x_X
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on July 25, 2018, 02:31:14 AM
Just tested in RW 1.0.1974 rev 538 and Weapon Storage version 1.0.0.4 and everything's working on my side
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: rawrfisher on August 04, 2018, 02:40:22 AM
I'll just leave this right here.

        bolt-action rifle (normal 50%)
Verse.Log:Message(String, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Debug\Log\Log.cs:49)
WeaponStorage.Patch_Pawn_HealthTracker_MakeDowned:Prefix(Pawn_HealthTracker)
Verse.Pawn_HealthTracker:MakeDowned_Patch2(Object, Nullable`1, Hediff)
Verse.Pawn_HealthTracker:CheckForStateChange_Patch0(Object, Nullable`1, Hediff)
Verse.Pawn_HealthTracker:AddHediff(Hediff, BodyPartRecord, Nullable`1, DamageResult) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Pawn\Trackers\Pawn_HealthTracker.cs:105)
Verse.DamageWorker_AddInjury:FinalizeAndAddInjury(Pawn, Hediff_Injury, DamageInfo, DamageResult) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Pawn\Health\DamageWorkers\AddInjury\DamageWorker_AddInjury.cs:295)
Verse.DamageWorker_AddInjury:FinalizeAndAddInjury(Pawn, Single, DamageInfo, DamageResult) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Pawn\Health\DamageWorkers\AddInjury\DamageWorker_AddInjury.cs:283)
Verse.DamageWorker_AddInjury:ApplyDamageToPart(DamageInfo, Pawn, DamageResult) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Pawn\Health\DamageWorkers\AddInjury\DamageWorker_AddInjury.cs:236)
Verse.DamageWorker_AddInjury:ApplyToPawn(DamageInfo, Pawn) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Pawn\Health\DamageWorkers\AddInjury\DamageWorker_AddInjury.cs:60)
Verse.DamageWorker_AddInjury:Apply(DamageInfo, Thing) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Pawn\Health\DamageWorkers\AddInjury\DamageWorker_AddInjury.cs:26)
Verse.Thing:TakeDamage(DamageInfo) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Thing\Thing.cs:1002)
Verse.HealthUtility:DamageUntilDowned(Pawn, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Pawn\Health\HealthUtility.cs:337)
Verse.Dialog_DebugActionsMenu:<DoListingItems_MapTools>m__56(Pawn) (at C:\Dev\RimWorld\Assets\Scripts\Verse\UI\DevTools\Dialogs\Dialog_DebugActionsMenu.cs:1051)
Verse.<DebugToolMapForPawns>c__AnonStorey0:<>m__0() (at C:\Dev\RimWorld\Assets\Scripts\Verse\UI\DevTools\Dialogs\Dialog_DebugOptionListLister.cs:63)
Verse.DebugTool:DebugToolOnGUI() (at C:\Dev\RimWorld\Assets\Scripts\Verse\UI\DevTools\DebugTool.cs:85)
Verse.DebugTools:DebugToolsOnGUI() (at C:\Dev\RimWorld\Assets\Scripts\Verse\UI\DevTools\DebugTool.cs:16)
RimWorld.UIRoot_Play:UIRootOnGUI() (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\UI\UIRoot_Play.cs:116)
Verse.Root:OnGUI() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\Root.cs:164)
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on August 04, 2018, 12:23:54 PM
ack am i getting sloppy? Looks like i missed a debug log. I'm assuming everything is working correctly in game?
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: rawrfisher on August 04, 2018, 12:24:34 PM
yea everythings fine with your mods but general behavior not so much

colonists ignoring downed colonists regardless of priority settings,  Throwing meals all over the place outside,  Doing all work compleatly outta order, Doing jobs they arnt assigned to and having breaks at the most ridiculous times

If anyones getting sloppy its me...   This is the 10th time I finish a message then have to edit it to add stuff I wanted to say initally.

Did you get around to replicateing any of the non error issues I was having with your mods?  The ones I am thinking of might have somthing to do with pathing when having multiple instances of the same storage unit on a map.  The savegame I sent has 2 different colonies on the same map lol
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on August 04, 2018, 07:04:27 PM
Been busy but i did just check my email and i did not receive any emails regarding rimworld.

If you have two colonies on the same map that can and will likely cause problems even in the base game. You will need to make sure all bills have a limited search area and when pawns get hungry there's no guarantee they'll grab the closest food.

If you want to restrict pawns to only use items from a certain area of the map use the base game's Allowed Areas to mark where pawns can be - a set of pawns in one colony and the surrounding area and the other pawns in the other colony and its surrounding area..

If pawns are placing items in zones they should not be it's more than likely a set of filters or priority are not correct.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: rawrfisher on August 07, 2018, 12:34:08 PM

Tried to add Gun_OrassanShotgun330566 to ThingOwner but this thing is already in another container. owner=Verse.Pawn_EquipmentTracker, current container owner=(Map-0-PlayerHome). Use TryAddOrTransfer, TryTransferToContainer, or remove the item before adding it.
Verse.Log:Warning(String, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Debug\Log\Log.cs:59)
Verse.ThingOwner`1:TryAdd(Thing, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Thing\ThingOwner\DefaultThingOwnerImpl.cs:154)
Verse.Pawn_EquipmentTracker:AddEquipment(ThingWithComps) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Pawn\Trackers\Pawn_EquipmentTracker.cs:217)
WeaponStorage.HarmonyPatchUtil:EquipWeapon(ThingWithComps, Pawn, AssignedWeaponContainer)
WeaponStorage.<>c__DisplayClass0_0:<Postfix>b__0()
Verse.Command_Action:ProcessInput(Event) (at C:\Dev\RimWorld\Assets\Scripts\Verse\UI\Gizmos\Command_Action.cs:18)
Verse.GizmoGridDrawer:DrawGizmoGrid(IEnumerable`1, Single, Gizmo&) (at C:\Dev\RimWorld\Assets\Scripts\Verse\UI\Gizmos\GizmoGridDrawer.cs:162)
RimWorld.InspectGizmoGrid:DrawInspectGizmoGridFor_Patch0(IEnumerable`1, Gizmo&)
RimWorld.MainTabWindow_Inspect:DrawInspectGizmos() (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\UI\MainButtons\MainTabWindows\MainTabWindow_Inspect.cs:94)
RimWorld.InspectPaneUtility:ExtraOnGUI(IInspectPane) (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\UI\MainButtons\Inspect\InspectPaneUtility.cs:128)
RimWorld.MainTabWindow_Inspect:ExtraOnGUI() (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\UI\MainButtons\MainTabWindows\MainTabWindow_Inspect.cs:70)
Verse.WindowStack:WindowStackOnGUI() (at C:\Dev\RimWorld\Assets\Scripts\Verse\UI\Windows\WindowStack.cs:169)
RimWorld.UIRoot_Play:UIRootOnGUI() (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\UI\UIRoot_Play.cs:91)
Verse.Root:OnGUI() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\Root.cs:164)


If you have some free time could you translate this for me?  I get this when I try equipping weapons on a pawn.  Its been hit and miss but I just keep trying and eventually it works.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on August 07, 2018, 01:17:00 PM
Looks like an item got duplicated. Gun_OrassanShotgun330566 exists twice in the game.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: rawrfisher on August 07, 2018, 02:36:28 PM
Quote from: Kiame on August 07, 2018, 01:17:00 PM
Looks like an item got duplicated. Gun_OrassanShotgun330566 exists twice in the game.

I didnt see a second shotgun.  If there was I definetly would be using it lol
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on August 28, 2018, 11:38:54 PM
B19 update now available here:
Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=1180720427

Direct Download: https://github.com/KiameV/rimworld-weaponstorage/releases/download/B19/WeaponStorage.zip

Use ModSync RW (https://ludeon.com/forums/index.php?topic=41634.0) to know if/when there's an update

Has support for newest Mend And Recycle mod: https://ludeon.com/forums/index.php?topic=22894.0
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on August 31, 2018, 12:22:11 AM
Updated for the latest Mend & Recycle version
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on August 31, 2018, 02:42:46 AM
Update:
Added an (i) button to inspect weapons from the Assign Weapons dialog window
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: rawrfisher on August 31, 2018, 02:46:39 AM
Im curious about the collection radius.
Seems the storage only collects in a radius of 1 while infinit storage collects in a radius of 2 or 3.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on August 31, 2018, 09:45:47 AM
Heh I think that may be a bug as infinite storage does seem to suck up stuff further away. I should look into that
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: rawrfisher on August 31, 2018, 11:50:20 AM
Quote from: Kiame on August 31, 2018, 09:45:47 AM
Heh I think that may be a bug as informed storage does seem to suck up stuff further away. I should look into that
Lol I only noticed it cause I have both the infinite and weapon storage in the same room fairly close together
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Canute on September 02, 2018, 06:31:29 AM
Kiame,
could you take a look into
Could not execute post-long-event action. Exception: System.TypeInitializationException: An exception was thrown by the type initializer for MendingWeaponStoragePatch.HarmonyPatches ---> System.ArgumentException: No target method specified for class MendingWeaponStoragePatch.Patch_WorkGiver_DoBill_TryFindBestBillIngredients (declaringType=, methodName =TryFindBestBillIngredients, methodType=, argumentTypes=NULL)
  at Harmony.PatchProcessor.PrepareType () [0x00000] in <filename unknown>:0
  at Harmony.PatchProcessor..ctor (Harmony.HarmonyInstance instance, System.Type type, Harmony.HarmonyMethod attributes) [0x00000] in <filename unknown>:0
  at Harmony.HarmonyInstance.<PatchAll>b__9_0 (System.Type type) [0x00000] in <filename unknown>:0
  at Harmony.CollectionExtensions.Do[Type] (IEnumerable`1 sequence, System.Action`1 action) [0x00000] in <filename unknown>:0
  at Harmony.HarmonyInstance.PatchAll (System.Reflection.Assembly assembly) [0x00000] in <filename unknown>:0
  at MendingWeaponStoragePatch.HarmonyPatches..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at (wrapper managed-to-native) System.Runtime.CompilerServices.RuntimeHelpers:RunClassConstructor (intptr)
  at System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (RuntimeTypeHandle type) [0x00000] in <filename unknown>:0
  at Verse.StaticConstructorOnStartupUtility.CallAll () [0x00000] in <filename unknown>:0
  at Verse.PlayDataLoader.<DoPlayLoad>m__2 () [0x00000] in <filename unknown>:0
  at Verse.LongEventHandler.ExecuteToExecuteWhenFinished () [0x00000] in <filename unknown>:0
Verse.Log:Error(String, Boolean)
Verse.LongEventHandler:ExecuteToExecuteWhenFinished()
Verse.LongEventHandler:UpdateCurrentAsynchronousEvent()
Verse.LongEventHandler:LongEventsUpdate(Boolean&)
Verse.Root:Update_Patch1(Object)
Verse.Root_Entry:Update()

https://git.io/fAluY

That error appear after i add Weapon Storage to the mod list.

Edit: I did some testing. The error appear when i use it together with
[B19] Mend And Recycle
https://ludeon.com/forums/index.php?topic=22894.0
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on September 04, 2018, 08:10:45 AM
Make sure you're using the most recent version of both mods. That will happen when one version is older than the other
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Canute on September 04, 2018, 09:06:03 AM
Ok thanks,
i just installed both mod's shortly before, so i though i got latest versions.
But it looks like i got an older version from Mend And Recycle :-(

Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Canute on September 15, 2018, 12:05:01 PM
I notice you don't add natural weapon like thrumbo horn's and elephant tusk to the storage.
Sure they arn't at the weapon category, but they are decent weapons.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: rawrfisher on September 15, 2018, 12:20:50 PM
Hey canute have you had any issues with large spam of warnings when using either weapons storage or change dresser?
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Canute on September 15, 2018, 12:49:29 PM
Yep i got some error's
Cannot register RimWorld.Verb_MeleeAttackDamage RimWorld.Verb_MeleeAttackDamage(null), (id=Verb_CompEquippable_PainStickSW290430_0_Smash in loaded object directory. Id already used by RimWorld.Verb_MeleeAttackDamage RimWorld.Verb_MeleeAttackDamage(null).
Verse.Log:Error(String, Boolean)
Verse.LoadedObjectDirectory:RegisterLoaded(ILoadReferenceable)
Verse.CrossRefHandler:ResolveAllCrossReferences()
Verse.ScribeLoader:FinalizeLoading()
Verse.Game:LoadGame_Patch1(Object)
Verse.SavedGameLoaderNow:LoadGameFromSaveFileNow(String)
Verse.Root_Play:<Start>m__0()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()

https://git.io/fA1IM
But i couldn't get them in relation with weapon storage so far, and the storage work's fine so far.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: rawrfisher on September 15, 2018, 12:51:47 PM
Thats a mostly harmless albiet annoying error.

Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Canute on September 18, 2018, 02:42:48 AM
Kiame,
a request for the future.
Would it be possible to add some filter option at the Assign weapon window ?
At last Mellee/Ranged would be very helpful.
Sorting by DPS/Range isn't realy needed but nice.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: rawrfisher on September 18, 2018, 02:46:48 AM
I just build 1 storage for ranged and 1 for melee
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on September 18, 2018, 09:24:38 AM
Quote from: Canute on September 18, 2018, 02:42:48 AM
Kiame,
a request for the future.
Would it be possible to add some filter option at the Assign weapon window ?
At last Mellee/Ranged would be very helpful.
Sorting by DPS/Range isn't realy needed but nice.

I can see about adding tabs like infinite storage. One tab for melee and one for ranged
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on September 18, 2018, 12:08:39 PM
Update:
Added a search text box in Assign Weapon window.
Typing "mel" will show all melee weapons
Typing "ran" will show all ranged weapons
Otherwise type the weapon name and it will show those
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on September 22, 2018, 09:20:29 PM
Update:
Made the search field case insensitive
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: rawrfisher on September 22, 2018, 09:27:33 PM
When you have some free time could you double check the assign on equip part of this mod?  It seems weapons don't get assigned when they are equip outside a storage.
I might be wrong  but I recall you mentioning that they were assigned to the pawn when equip outside a storage as well
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on September 22, 2018, 09:57:08 PM
hmm they should assuming there is a weapon storage exists prior to the equip

I'll double check though
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: rawrfisher on September 22, 2018, 10:15:52 PM
If that's the case i think I dun broke something again 8)

Gotta love the hassles that come with load orders exceeding 100 mods
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on September 24, 2018, 12:27:11 AM
Update:
"Do Until X" filtering works again with bills
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Amnesiac on September 24, 2018, 04:22:10 AM
Sorry if this is a dumb question, I'm trying to understand how to use this mod...

How do I get my pawn to switch to one of his other assigned weapons? I've assigned him an Assault Rifle, Pump Shotgun, and Mace, but he only carries around an Assault Rifle in his Gear tab
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Canute on September 24, 2018, 09:06:17 AM
Once you draft your pawn, you can choose to equip other weapon you assign him.
But undrafted he will continue to use the last weapon you told him to equip.
No automatical weapon switch.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Amnesiac on September 24, 2018, 02:20:55 PM
Quote from: Canute on September 24, 2018, 09:06:17 AM
Once you draft your pawn, you can choose to equip other weapon you assign him.
But undrafted he will continue to use the last weapon you told him to equip.
No automatical weapon switch.

Oh good, it works! So I am just dumb ;D this mod is awesome as heck, thank you.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Amnesiac on September 27, 2018, 05:04:44 AM
I was able to duplicate weapons with this mod, after a series of events involving arresting a colonist, I took a single chain shotgun and ended with two. https://i.imgur.com/etjHxnn.png

I know that sometimes the weapon will show up on the list and then disappear when checked, but this time the duplicate did not disappear from the list: https://i.imgur.com/7FTW0fd.png

This is how it happened:


1. Colonist A with the Chain Shotgun went on a food binge. Colonist A was arrested by Colonist B.
2. Colonist B places Colonist A in a prisoner bed, and removes his weapons and equipment. (Including the chain shotgun)
3. Colonist B Hauls the shotgun to weapon storage box.
4. Reload save after this happened, got this error:

Log - https://git.io/fAh9O
Picture - https://i.imgur.com/jkPW38H.png

5. Colonist A is released, Checked weapon storage and two Chain Shotguns now exist.
6. This persists after restarting the game, and the weapons can be assigned to different colonists, while causing errors.

As long as the duplicate exists, every time you load the game, you get these errors shown in the picture above.



In the end I was able to fix it by dropping the duplicates outside of the storage in a previous save (Before the prisoner was released, if after, still gives error) and saving, then reloading. I could also use the devmode to delete the duplicate and stop the error.

Edit: upon further testing, I actually have no idea how I fixed it the first time. I had to use the dev mode to destroy the duplicate in order to stop the errors, but in my first test I was able to do it as described above, but in my later saves, I tried doing the same thing and was unsuccessful.

As a side note, if you save while one of the duplicates is moved/equipped after dropping them out of storage, before reloading, this happens: https://git.io/fAh9A 
https://i.imgur.com/h0xu5bl.png

Hope this helps!
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Canute on September 27, 2018, 06:37:45 AM
I am geting similar error and duplicate weapons.
I think everytime these  UIRootUpdate error pop up another duplicate got created (i think).
It happen many times so far.
I tryed to reproduce it with a test colony with just weapon storage and sparkling world but it didn't happen, or not at the beginning.
But Amnesiac don't use Sparkling world, and it happen with a vanilla weapon, i don't think anymore it is based on Sparking worlds.

It end up that pawn's got multiple assignments of the same weapons.
If you need logs you can use them from
https://ludeon.com/forums/index.php?topic=35503.msg434123#msg434123
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on September 27, 2018, 09:43:45 AM
Thank you Amnesiac for the explanation of how the duplication happened. I will look into this. I have an idea about how this is happening
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Amnesiac on September 28, 2018, 03:29:36 PM
I did some more testing, and for me, it's happening when a pawn drops his currently equipped weapon, for some reason it's not becoming unassigned, creating the duplicate.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on September 28, 2018, 11:20:36 PM
Update:
Fixed an issue that caused weapon duplication when pawns dropped their weapon.

Thanks for the help Amnesiac
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: J.BEAR on September 29, 2018, 04:45:23 AM
Quote from: Canute on September 27, 2018, 06:37:45 AM
I am geting similar error and duplicate weapons.
I think everytime these  UIRootUpdate error pop up another duplicate got created (i think).
It happen many times so far.
I tryed to reproduce it with a test colony with just weapon storage and sparkling world but it didn't happen, or not at the beginning.
But Amnesiac don't use Sparkling world, and it happen with a vanilla weapon, i don't think anymore it is based on Sparking worlds.

It end up that pawn's got multiple assignments of the same weapons.
If you need logs you can use them from
https://ludeon.com/forums/index.php?topic=35503.msg434123#msg434123

hi Kiame, thanks for the mod and the updated duplicate fix
turns out i had duplicates of a legendary sniper and 12 copies of an excellent LMG lol
here's how i fixed my save game:

1.un-equip all guns for all colonists, drop on floor (just in case someone was holding a duplicate weapon, makes it easier to delete later)
2.empty all guns from all weapon storage on floor
3.find the offending duplicate weapon ID (ie. Gun_SniperRifle2476540)
4.go into save file, search and delete all duplicates [thing][/thing] until only 1 remain

my save file is now red/yellow error free on save and load

will let u know if i encounter dupe weapons again somehow

cheers
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on September 29, 2018, 11:58:40 AM
Another way to fix it is to drop everything of the floor then have pawns put them into a weapon storage. When inserting if there is a duplicate it will just delete the duplicate


Edit haha now I'm second guessing myself. I'll double check this when I get on my computer
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Canute on September 29, 2018, 12:05:14 PM
Nope, THIS way i tryed multiple times.
Unassigned all weapons.
Droped anything on floor.
Saved game, error's about duplicate item's
Load game, warning about the stack items, and the pile spread out over the room.

After all weapon's back in the storage, save, load but still error's.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: J.BEAR on September 29, 2018, 01:15:20 PM
Quote from: Kiame on September 29, 2018, 11:58:40 AM
Another way to fix it is to drop everything of the floor then have pawns put them into a weapon storage. When inserting if there is a duplicate it will just delete the duplicate


Edit haha now I'm second guessing myself. I'll double check this when I get on my computer

i'm not 100% sure how i duplicated my weapons, but i think i was able to assign 2 pawns the same excellent LMG somehow. After game load it'd prompt me "Hunter has no range weapon" on one of the pawns.
I think i also lost a pawn crafted legendary charge lance somewhere in pocket dimension somehow and i had to mod it back in. no idea what happened.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Amnesiac on September 30, 2018, 04:56:23 AM
Quote from: Kiame on September 28, 2018, 11:20:36 PM
Update:
Fixed an issue that caused weapon duplication when pawns dropped their weapon.

Thanks for the help Amnesiac

You're welcome!

Just updated and tested some things out, no issues with the weapons being unassigned now!

I did however, find another bug :-[ I was able to make a gun disappear and output an error:
https://git.io/fxfMP
https://i.imgur.com/zp7ftib.png

Steps:
1. Draft pawn, tell him to drop primary weapon (Which is a bolt action rifle, assigned to him. He also has another Shotgun, and Mace assigned to him.)
2. Tell pawn to pick up the just dropped Bolt Action Rifle.
3. Error occurs and Bolt Action disappears

In my testing, I noticed a few things which I think may be important;
1. If the pawn drops all his weapons, then picks up a weapon, this doesn't happen.
2. When a pawn has only 1 weapon assigned, no errors occurred as far as I could tell.
2. Only when he has assigned 2 or more weapons, then picks up a 3rd dropped weapon, does the error occur.

Sorry to do this to you! LOL
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: 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.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Canute on September 30, 2018, 03:36:57 PM
QuoteTo assign weapons to a pawn the best way is to use the weapon storage's Assign Weapon to do that.
Then please add elephant tust and thrumbo horn's to the storage filter ! :-)
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: 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
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on September 30, 2018, 04:40:44 PM
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.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Canute on September 30, 2018, 04:47:30 PM
You are one of the fastest modder :-)
Much thanks !
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: 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.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: J.BEAR on September 30, 2018, 06:55:21 PM
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
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: 5thHorseman on September 30, 2018, 08:21:08 PM
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.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Amnesiac on October 01, 2018, 05:53:22 AM
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
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on October 09, 2018, 10:44:50 PM
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.
Title: Re: [B19] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on October 10, 2018, 11:41:37 PM
Update:
Fixed and issue that was causing the Mod Options from closing if no game had started. Sorry about that!
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on October 18, 2018, 12:32:00 AM
Updated for 1.0
https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.0/WeaponStorage.zip
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on October 25, 2018, 10:54:26 PM
Update:
Fixing an issue where abandoning a map that had a Weapon Storage would cause errors
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on November 27, 2018, 08:09:55 PM
Update:
Works again with the newest version of Mending
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: notfood on November 27, 2018, 10:26:49 PM
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()
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on November 28, 2018, 12:41:42 AM
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
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: crusader2010 on November 29, 2018, 12:34:44 PM
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()
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on November 29, 2018, 12:50:53 PM
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
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: crusader2010 on November 29, 2018, 01:10:44 PM
Quote from: Kiame on November 29, 2018, 12:50:53 PM
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

Nope, plain wood and steel, as per the requirements. I am using Fluffy's Blueprints mod too. And StuffedFloors + StuffedFlaks.
The Blueprints mod is way above WeaponStorage in the mod list (got ~130 mods).

Should I move it further down?

EDIT: moved blueprints and stuffedflaks below weaponStorage and still the same error :(
Also attached the mod config file.

[attachment deleted due to age]
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on November 29, 2018, 04:54:37 PM
If you disable those mods and try to build the weapons storage in a new game does it work?
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: crusader2010 on November 29, 2018, 10:27:41 PM
Quote from: Kiame on November 29, 2018, 04:54:37 PM
If you disable those mods and try to build the weapons storage in a new game does it work?

Going to try it in a few days after I come back home and let you know (though i'd like to use those mods too ;D ). I remember that this happened on B19 too, but not what was causing it and how I solved it then (what I do remember is that Blueprints could be used; so gonna try disabling StuffedFlaks).
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: crusader2010 on December 03, 2018, 11:52:25 AM
Quote from: crusader2010 on November 29, 2018, 10:27:41 PM
Quote from: Kiame on November 29, 2018, 04:54:37 PM
If you disable those mods and try to build the weapons storage in a new game does it work?

Going to try it in a few days after I come back home and let you know (though i'd like to use those mods too ;D ). I remember that this happened on B19 too, but not what was causing it and how I solved it then (what I do remember is that Blueprints could be used; so gonna try disabling StuffedFlaks).

Tried it with the two mods disabled and still getting the same error. I can provide a saved game and an archive with all the mods if needed (it's older than what i use now, but the issue is still happening).

EDIT: here's a link to the whole log:  LOG (https://git.io/fp6dg)
Does the mod conflict with ChangeDresser?

EDIT2: there are also more errors like "Config error in WeaponStorage: has components but it's thingClass is not a ThingWithComps" and "Config error in WeaponStorage: has null thingClass.".

Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Heymom on December 13, 2018, 09:54:48 AM
Hey Kiame

I use a lot of your mods, and i expecially like the storage ones.

I do have a suggestion/request tho. I tend to equip all my pawns with the same weapon (eg. sniper rifle) and always make sure i have +1 spare so that my pawns will pick it up if they lose their "own". I use simple side arms mod as well.
with your weapon storage mod, it seems that the weapon assigned is unique aka you give it a unique ID or smth, so if they drop or lose the weapon (blown up..) i have to re-assign a weapon.

tldr; would it be possible to assign a group type weapon to a pawn
if equiped(unique=false) !== sniper_rifle(id=any, quality=any)
then
equiped == sniper_rifle(id=any, quality=any)
else
equiped == sniper_rifle(id=xx)

^^ my poor attempt at psodo coding :P
Hope you get the idea behind my suggestion tho. Else i can try to elaborate further.

Cheers.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 13, 2018, 10:36:57 AM
Nothing unique really with how weapons are assigned. Each pawn gets assigned a list of weapons. When a weapon is assigned to a pawn it's added to that list.

When a pawn equips the weapon, the weapon is removed from the list. Of the pawn is incapacitated the equipped weapon is added to the list so they do not lose it. Iirc when they are no longer incapacitated they will equip the last equipped weapon automatically

I have not tried this mod with simple sidearms though I do believe they do roughly the same thing. This mod allow the assignment of multiple weapons to pawns and the pawns can immeditly equip any assigned weapons.

If i understand the request, it'd be similar to how apparel is assigned. That would be a large undertaking and tbh I don't see enough benefit for the time it would take
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Heymom on December 13, 2018, 12:31:07 PM
Quote from: Kiame on December 13, 2018, 10:36:57 AM
Nothing unique really with how weapons are assigned. Each pawn gets assigned a list of weapons. When a weapon is assigned to a pawn it's added to that list.

When a pawn equips the weapon, the weapon is removed from the list. Of the pawn is incapacitated the equipped weapon is added to the list so they do not lose it. Iirc when they are no longer incapacitated they will equip the last equipped weapon automatically

I have not tried this mod with simple sidearms though I do believe they do roughly the same thing. This mod allow the assignment of multiple weapons to pawns and the pawns can immeditly equip any assigned weapons.

If i understand the request, it'd be similar to how apparel is assigned. That would be a large undertaking and tbh I don't see enough benefit for the time it would take
Ok, i dont know the coding needed for my request. I just noticed that my pawns wont equip their weapon, after they lose it. So i thought it was due to unique ID assigned to "that" weapon or smth.
I do run a very modded game, so there could be some conflicts. But with 20+ pawns, i tend to go for a more automated management style of game. Why i always use the same gear on all pawns and just make +1 of each, if anyting goes missing.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 13, 2018, 12:48:05 PM
Sorry i typed that when i first work up and the last part was not as nice as it should have been.

I don understand it can become cumbersome having to assign weapons over and over to pawns... let me do some thinking if there might be an easy way do this other than what i was thinking before
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: crusader2010 on December 13, 2018, 01:28:51 PM
Quote from: Kiame on December 13, 2018, 12:48:05 PM
Sorry i typed that when i first work up and the last part was not as nice as it should have been.

I don understand it can become cumbersome having to assign weapons over and over to pawns... let me do some thinking if there might be an easy way do this other than what i was thinking before

May I suggest showing all the pawns on the left, then all the weapons on the right side of the weapons storage window? From there it can be customized further with checkboxes to everything.

If you select more pawns, make visible another checkbox that says "list only weapons whose numbers are equal to the number of selected pawns" (for now don't put filters for quality and such, to keep it simple). Also, with multiple pawns selected and the previous checkbox checked, make visible a button to "bulk assign". It'll take each pawn and assign him one of the weapons (maybe index to index instead of writing more code for random assignment). From what I can tell, there is no chance for error this way.

PS: I managed t solve the errors with ChangeDresser and WeaponsStorage by putting them at the very bottom. Soon i'll try to see with what they conflicted and let you know.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 13, 2018, 01:49:04 PM
So almost like a pool of weapons that selected pawns can pull from?

My concern with that approach is weapon quality. I like to have the best weapons go to average shooters before bad/great shooters...

Brainstorming
Maybe a new creatable thing - Shared Weapons - where you can select the weapon types that are available to be shared. Once one or more Shared Weapon groups is created, whenever any pawn is selected there is a button available to for the pawn to draw from the shared weapon group.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: crusader2010 on December 14, 2018, 03:57:10 AM
Quote from: Kiame on December 13, 2018, 01:49:04 PM
So almost like a pool of weapons that selected pawns can pull from?

My concern with that approach is weapon quality. I like to have the best weapons go to average shooters before bad/great shooters...

Brainstorming
Maybe a new creatable thing - Shared Weapons - where you can select the weapon types that are available to be shared. Once one or more Shared Weapon groups is created, whenever any pawn is selected there is a button available to for the pawn to draw from the shared weapon group.

But the pool of weapons is already there: all of the weapons that are in the weapons storage. Secondly, it wouldn't solve what a previous poster suggested - the need to assign each and every pawn his weapon. He wanted something like a bulk assign.

Another idea would be to create "views" for the weapons list and sorting for pawns based on ranged and melee skills.

Basically have something similar to outfits for the list of weapons in the storage. Default is "all weapons". Players can create new ones where they can choose the types of weapons to show, their quality range, their hitpoints range, whether they were looted from a corpse or not, etc. When we open the weapons storage window we need a button to select the "view" for the list of weapons which simply filters what is shown. Combine it with what I said in the previous post and you can have bulk assignment of whichever weapons/pawns you want (if there are enough of them, of course).

The pawn list could have 2 more columns to show ranged and melee skills and to allow sorting  by them.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 14, 2018, 06:07:15 PM
Quote from: crusader2010 on December 14, 2018, 03:57:10 AM
Quote from: Kiame on December 13, 2018, 01:49:04 PM
So almost like a pool of weapons that selected pawns can pull from?

My concern with that approach is weapon quality. I like to have the best weapons go to average shooters before bad/great shooters...

Brainstorming
Maybe a new creatable thing - Shared Weapons - where you can select the weapon types that are available to be shared. Once one or more Shared Weapon groups is created, whenever any pawn is selected there is a button available to for the pawn to draw from the shared weapon group.

But the pool of weapons is already there: all of the weapons that are in the weapons storage. Secondly, it wouldn't solve what a previous poster suggested - the need to assign each and every pawn his weapon. He wanted something like a bulk assign.

Another idea would be to create "views" for the weapons list and sorting for pawns based on ranged and melee skills.

Basically have something similar to outfits for the list of weapons in the storage. Default is "all weapons". Players can create new ones where they can choose the types of weapons to show, their quality range, their hitpoints range, whether they were looted from a corpse or not, etc. When we open the weapons storage window we need a button to select the "view" for the list of weapons which simply filters what is shown. Combine it with what I said in the previous post and you can have bulk assignment of whichever weapons/pawns you want (if there are enough of them, of course).

The pawn list could have 2 more columns to show ranged and melee skills and to allow sorting  by them.

Yes that's what i'm considering with the outfits selection, just accessible via weapon storage and not turned on until the user creates one.

As for the pool of weapons, it'll actually be all weapons that match the created Shared Weapons in all storages in all maps; unless there's strong negative feedback. The weapons would stay in the storage until a pawn uses one of the weapons. When the pawn switched weapons, the previous weapon would the go through all storages on all maps and find the best one to store the weapon in (based off priority and storage settings); then dropping the weapon next to the pawn if no applicable storage was found.

Adding a pawn's ranged/melee skills has been on my todo list for a long time. I'll see about getting that added too
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 16, 2018, 12:40:00 AM
Update
Added shared weapons
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 17, 2018, 05:50:28 PM
Update:
Storages will now collect all weapons around them on a save - no matter the filter settings. Any weapons collected this way will be put back onto the floor a few seconds after the save is complete / the save is loaded.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: crusader2010 on December 17, 2018, 07:26:35 PM
Quote from: Kiame on December 17, 2018, 05:50:28 PM
Update:
Storages will now collect all weapons around them on a save - no matter the filter settings. Any weapons collected this way will be put back onto the floor a few seconds after the save is complete / the save is loaded.

Playing with the previous version with "shared weapons". The buttons from the window that open up on this action do nothing. Also getting some errors:

This line is spammed a lot (i think for every weapon inside the storage):

Building_WeaponStorage.Remove(ThingWithComp)
StackOverflowException The requested operation caused a stack overflow.
  at WeaponStorage.Building_WeaponStorage.Remove (Verse.ThingWithComps weapon, Boolean forbidden) [0x00000] in <filename unknown>:0


This is repeated over 400 times (I do NOT have that many weapons!):

Exception filling window for WeaponStorage.UI.SharedWeaponsUI: System.NullReferenceException: Object reference not set to an instance of an object
  at WeaponStorage.UI.SharedWeaponsUI.DoWindowContents (Rect inRect) [0x00000] in <filename unknown>:0
  at Verse.Window+<WindowOnGUI>c__AnonStorey0.<>m__0 (Int32 x) [0x00000] in <filename unknown>:0
Verse.Log:Error(String, Boolean)
Verse.<WindowOnGUI>c__AnonStorey0:<>m__0(Int32)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle)


And another one that appears once:

Exception while getting gizmos for pawn Trumpet
Object reference not set to an instance of an object
  at WeaponStorage.HarmonyPatches+Patch_Pawn_DraftController_GetGizmos.Postfix (RimWorld.Pawn_DraftController __instance, IEnumerable`1& __result) [0x00000] in <filename unknown>:0
Verse.Log:Error(String, Boolean)
Verse.Log:ErrorOnce(String, Int32, Boolean)
WeaponStorage.Patch_Pawn_DraftController_GetGizmos:Postfix(Pawn_DraftController, IEnumerable`1&)
RimWorld.Pawn_DraftController:GetGizmos_Patch3(Object)
Verse.<GetGizmos>c__Iterator2:MoveNext()
System.Collections.Generic.List`1:AddEnumerable(IEnumerable`1)
System.Collections.Generic.List`1:.ctor(IEnumerable`1)
System.Linq.Enumerable:ToList(IEnumerable`1)
TD_Enhancement_Pack.StopGizmo:Postfix(IEnumerable`1&, Pawn)
Verse.Pawn:GetGizmos_Patch10(Object)
RimWorld.InspectGizmoGrid:DrawInspectGizmoGridFor_Patch0(IEnumerable`1, Gizmo&)
RimWorld.MainTabWindow_Inspect:DrawInspectGizmos()
RimWorld.InspectPaneUtility:ExtraOnGUI(IInspectPane)
RimWorld.MainTabWindow_Inspect:ExtraOnGUI()
Verse.WindowStack:WindowStackOnGUI()
RimWorld.UIRoot_Play:UIRootOnGUI()
Verse.Root:OnGUI()


EDIT: still getting the second error from above about 500+ times when I open the Shared Weapons window. The rest seem to have gone with the latest version :)

EDIT2: still getting the 3rd error too when trying to assign a weapon to a pawn. Somehow the weapon got lost, too!
I've assigned a ranged weapon to a new recruit but the button to actually equip it never showed up. So I tried dropping it (from the arrow button from Weapon Storage, that is to the right side of every weapon). Then it simply disappeared.

So right now I can't properly assign weapons to pawns (they show up as assigned in in the Assign window, but not on the pawn's gear).

EDIT3: when clicking the "Assign weapons" button, not all of them are shown. All seem to appear only after selecting a pawn.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 17, 2018, 10:28:57 PM
Thanks for the feedback. I have not seen any of these in my testing so i'm trying to figure out how to reproduce these issues.

So when you click the Shared Weapons button (to set it up initially) nothing happens and you just get a exception? Or is the first exception after you've setup a shared weapons filter and you're trying to assign a weapon to a pawn? (thinking the later from the exception)
If the later what weapon (base game or modded, if modded what mod?)

The Shared Weapons UI will not show your current weapons but instead a list of all weapon defs (types). I'm thinking this is due to a poorly written mod not defining labels for all defs in the xml. What  weapon mods are you using by chance?

Is Trumpet a normal pawn or alien? I thought i had verified this does not work on colony animals but just in case, is that a pet?
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: crusader2010 on December 18, 2018, 03:08:59 AM
Quote from: Kiame on December 17, 2018, 10:28:57 PM
Thanks for the feedback. I have not seen any of these in my testing so i'm trying to figure out how to reproduce these issues.

So when you click the Shared Weapons button (to set it up initially) nothing happens and you just get a exception? Or is the first exception after you've setup a shared weapons filter and you're trying to assign a weapon to a pawn? (thinking the later from the exception)
If the later what weapon (base game or modded, if modded what mod?)

The Shared Weapons UI will not show your current weapons but instead a list of all weapon defs (types). I'm thinking this is due to a poorly written mod not defining labels for all defs in the xml. What  weapon mods are you using by chance?

Is Trumpet a normal pawn or alien? I thought i had verified this does not work on colony animals but just in case, is that a pet?

1. After clicking Shared Weapons a window appears with two buttons - Filter and New. Both do nothing. Nothing else is shown in the window. The exception happens after the window appeared on the screen (seems it cannot render something on it).

2. Trumpet is a normal pawn, but has the SUMMONER trait from "A Rimworld of Magic". Don't think that's an issue though.

3. Here are my weapon mods: Titanium+, ProjectArmoury, maybe Apparello (not sure). Got also some mods that alter different stats of weapons. I've attached the mod config. WeaponsStorage is at the end of the load order.

I was previously using the version without shared weapons, so i deleted the mod's folder from Rimworld\Mods and extracted this new archive. Also using an existing saved game in which I had already built a weapon storage item. Could this have caused the issues?

Can provide the saved game if you want.

[attachment deleted due to age]
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 18, 2018, 03:41:54 AM
nah save game compatible. I'll look more into this tomorrow
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: crusader2010 on December 18, 2018, 07:13:53 AM
Quote from: Kiame on December 18, 2018, 03:41:54 AM
nah save game compatible. I'll look more into this tomorrow

Thanks! :) right now i've set the priority to Low for the weapon storage and reverted to the old stockpile way of storing weapons due to the impossibility of assignment :( I hope you'll find something.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 18, 2018, 10:34:00 AM
Does the old way of assigning not work either?
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: crusader2010 on December 18, 2018, 11:38:06 AM
Quote from: Kiame on December 18, 2018, 10:34:00 AM
Does the old way of assigning not work either?

For me it doesn't. I described the issue above, in the edits.

I can also provide an archive with my mods + the save, so you can debug the exact game that i'm playing. Let me know how I can help, either way.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 18, 2018, 12:54:14 PM
For the assign weapons and not all weapons showing up until a pawn is selected...

The logic behind the assign is once a weapon is assigned to a pawn, that weapon is no longer available to be assigned to any other pawn. Once a pawn is selected, the weapons assigned to that pawn will be added to the top of the list. If a weapon is unassigned from a pawn, that weapon will then show up normally and can be assigned to another pawn.


Tested with Titanium+ and Project Armory 1.2 and it's working
(https://i.imgur.com/TnyPdE7.png)
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 18, 2018, 01:20:20 PM
Trying to reproduce the steps you're taking.

Do you just click the "Shared Weapons" button after selecting a weapon storage and then you're flooded by error messages?
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: crusader2010 on December 18, 2018, 01:40:16 PM
Quote from: Kiame on December 18, 2018, 12:54:14 PM
For the assign weapons and not all weapons showing up until a pawn is selected...

The logic behind the assign is once a weapon is assigned to a pawn, that weapon is no longer available to be assigned to any other pawn. Once a pawn is selected, the weapons assigned to that pawn will be added to the top of the list. If a weapon is unassigned from a pawn, that weapon will then show up normally and can be assigned to another pawn.

Sorry, I did not explain it properly. When there is no pawn selected, the Assign Weapon window shows up less weapons than there should be there (of course, without considering those that are already assigned!). When a pawn is selected, the window shows up ALL the weapons (as it should). Proof below. None of my pawns has the elasmotherium horn equipped.

Assign window without any pawn selected: https://imgur.com/a/xfs33Uv (https://imgur.com/a/xfs33Uv)
Assign window with a pawn selected: https://imgur.com/a/8rzA8ve (https://imgur.com/a/8rzA8ve)

There seems to be another bug too. One of my pawns has a weapon that doesn't appear at all in the Weapon Storage. It wasn't assigned to the pawn through the Assign Weapon window, but by taking it from the ground, directly. Proof:

Pawn has unassigned weapon (gear on pawn): https://imgur.com/a/1hYRphX (https://imgur.com/a/1hYRphX)
Pawn has unassigned weapon (assign weapon window): https://imgur.com/a/hXKigD6 (https://imgur.com/a/hXKigD6)

Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 18, 2018, 02:02:11 PM
I'm honestly drawing a blank

Does any of this work in a new game?

There was someone on the workshop with the same problems. I compared the mods both of you have in common. I d/l and enabled those shared mods in hopes of reproducing the failure to equip weapons / open assign weapons window / open shared weapons window and everything's working fine.

The 10 shared mods being:
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 18, 2018, 02:11:15 PM
For anyone having problems with the newest version of this mod, the older version can be downloaded here: https://github.com/KiameV/rimworld-weaponstorage/releases/download/test/WeaponStorage.zip
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: crusader2010 on December 18, 2018, 02:15:34 PM
I'll try moving around the two mods again (WS and ChangeDresser) since I don't want to lose this save right now. At least that's what fixed the previous errors. Most likely this is an issue with updating WS from the previous version and loading the same saved game (I believe this because ChangeDresser is working properly and these are the only two mods I updated recently).

Will return with any news.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: crusader2010 on December 18, 2018, 03:17:04 PM
Quote from: Kiame on December 18, 2018, 02:11:15 PM
For anyone having problems with the newest version of this mod, the older version can be downloaded here: https://github.com/KiameV/rimworld-weaponstorage/releases/download/test/WeaponStorage.zip

Can confirm that the previous version is working properly (with the saved game that has the above issues).

Moving the mods around didn't help. Cannot make it work :(
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 19, 2018, 06:02:10 PM
Update:
Fixing a bug that was was causing an error when removing weapons for smelting or repair
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Arkallus on December 22, 2018, 11:04:19 AM
Ok, So is the weapon that I assigned from the storage box supposed to stay in my colonist's inventory, Because it keeps getting stuck in my colonist's inventory whenever I first draft him and the weapon stays there until i reassign it, only then it disappears from the inventory

I have Simple sidearms btw, if that means anything to you
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 22, 2018, 11:24:44 AM
When a weapon is assigned to a pawn it will stay with them going forward.

If you assign weapons with this mod, simple sidearms is not needed.
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: 2.71828 on January 16, 2019, 01:16:00 PM
I've got a weird problem: My (single and only) weapon storage doesn't accept weapons anymore and remains empty, although it should accept weapons (via the storage options). I know that it worked before in this particular save, but somehow it doesn't work anymore. Could this be related to your last update?

I tried rebuilding the weapon storage, reinstalling it somewhere else, forbidding and then enabling everything in the storage options, reloading the safe, etc., but nothing helps. If the weapon storage is the only "stockpile" that accepts weapons, and I try to "haul some weapons urgently", Rimworld tells me there is no available storage. This happens both with modded weapons and vanilla weapons, although it worked perfectly a couple of days ago.

Is there anything I can do to either get rid of this problem myself or to help you with tracking it down? AFAIK, I don't get any error messages that have anything to do with this. Should I try to remove and re-add the mod to my save, or something?
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Canute on January 16, 2019, 02:20:50 PM
You should try at first, happen that problem at  new colony too, use hugslib quickstart option to create a new test colony.
Then try to disable all mods beside hugslib,Weapon storage and try it again.

Then you can see if it is maybe a modconflict or a general problem.
On a modconflict you still can try to move Weapon storage at the end or at the beginning of the modlist and check if that help.

And btw. how did you update he mod, did you delete the older folder or just overwrite it ?
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: 2.71828 on January 19, 2019, 06:07:09 PM
Quote from: Canute on January 16, 2019, 02:20:50 PM
You should try at first, happen that problem at  new colony too, use hugslib quickstart option to create a new test colony.
Then try to disable all mods beside hugslib,Weapon storage and try it again.

Then you can see if it is maybe a modconflict or a general problem.
On a modconflict you still can try to move Weapon storage at the end or at the beginning of the modlist and check if that help.

And btw. how did you update he mod, did you delete the older folder or just overwrite it ?

Thanks for the tip. However, because I'm very lazy, I did something even simpler and just started a new game with my current modlist. Turns out it was simply user error. I'm using the "Survival Tools" mod which adds tools, and these tools are kind of a hybrid between weapons and clothing, I guess, since with the "Outfitted" mod, my colonists pretty much equip the correct tools by themselves (unless the tools are within a weapon storage), but they're still added to the storage options in the weapons storage. Since I don't want to do by hand which happens automatically, I forbid tools from being stored in the weapon storage. This, however also forbade smeltable and non-smeltable things (because the tool category has these filters, as well), so now my weapon storage was only allowed to store weapons (check mark for the weapon category), but not smeltable or non-smeltable items (crossed out by forbidding the tools category), so nothing was allowed to be stored in the weapon storage, anymore... Thus, I have fixed my own stupid mistake, now.

Too bad, however, that there is no "tool storage", or something...
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on April 10, 2019, 12:33:29 AM
Update:
-Fixed an issue where the slide bars were not showing up in shared weapons dialog
-Pawns incapable of violence will no longer show up in the list of pawns to assign weapons to or in shared weapons
-Better support for imbued weapons
Title: Re: [1.0] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on April 13, 2019, 06:25:13 PM
Update:
Added Combat Extended support! Make sure to update Weapon Storage (d/l link (https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.0/WeaponStorage.zip)) at the same time you download the patch

Patch for Combat Extended:
Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=1711864630
Direct Download: https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.0/WeaponStorageCombatExtended.zip

Combat Extended Patch Notes:
Pawns will be able to retrieve ammo from Weapon Storages for reloading weapons and turrets.
- Pawns reloading their weapons will have ammo put into their hands from weapon storage - no longer will pawns need to run and reload
- Ammo for turrets will appear outside of Weapon Storages if a pawn is not manning a turret. If a pawn is manning a turret, the ammo will appear in the pawn's hands

It is strongly recommended not to use the Combat Extended loadouts for weapons and ammo. Instead assign weapons through Weapon Storage. Loadouts can still be used for food, meds, etc.

Using Grenades:
To assign grenades select any Weapon Storage then Manage Shared Weapons
-From the new window create a new filter and call it something like "emp frag"
-In the list select the grenades you want available to colonists, like "frag grenade" and " EMP grenade"
-Close the Filter window
-Assign colonists to the "emp frag" group

Now when you select a colonist that's assigned "emp frag" they can equip either frag or emp grenades (if there are any stored in Weapon Storage)

Load Order
-Combat Extended
-Weapon Storage
-Weapon Storage Combat Extended Patch
Title: Re: [1.0] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Kiame on April 15, 2019, 02:52:05 AM
Update:
Pawns who are assigned both a sharp (sword) and blunt (club/mace) melee weapons will now switch to the best weapon for the target they're attacking. This can be disabled in the mod's settings. The preferred weapon type is used if the target has the same blunt and sharp armor ratings.
Title: Re: [1.0] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Kiame on April 17, 2019, 01:56:51 AM
Update (Combat Extended Patch):
-Fixed an issue where bows were not getting arrows when firing
-Fixed an issue where pawn could continuously remove ammo from a Weapon Storage then promptly lose the ammo as it was automatically moved to the Weapon Storage

Important
For those using CE you'll need to update both Weapon Storage and the CE Patch. I'm trying to keep this to a minimal  :)

For those not using CE Patch, you can ignore this update.

Weapon Storage: https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.0/WeaponStorage.zip
CE Patch: https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.0/WeaponStorageCombatExtended.zip
Title: Re: [1.0] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Pelador on April 26, 2019, 12:46:11 PM
The following mod uses AI to make use of a couple of items to fight fires. The items are a Fire Extinguisher and Firebeater (technically a gun and a melee item as the game sees them): https://steamcommunity.com/sharedfiles/filedetails/?id=1653848897

As a result, it has been reported by a player that there is an incompatibility with the use of both mods. Largely as it appears that both mods apply a technique of managing the primary equipment to be used for differing activities. The firewarden mod will equip items from inventory to be used in response to a fire, and unequip after completion.

As an immediate solution to the issue, I thought that if certain items could be excluded from the Weapon Storage functionality then this may allow for continuity with the above items as intended tools. Which could be a similar case for any other mod that wishes to employ AI to similar items. If Weapon Storage could exclude certain items and include a mod extension for thingDef to be able to mark these items then other modders could then easily apply this to their items to be treated as such, which would alleviate the headache of trying to maintain a list or have complicated recognition sets/user definitions.
Title: Re: [1.0] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Kiame on April 27, 2019, 12:29:55 AM
The pawn will hold the weapon that's currently assigned to them. If the pawn has multiple weapons and the equipped weapon changes, the original weapon goes back into storage and the selected weapon is then equipped by the pawn.

I have not run this with simple sidearms but i have heard they are compatible
Title: Re: [1.0] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Pelador on April 27, 2019, 04:30:40 AM
Quote from: Kiame on April 27, 2019, 12:29:55 AM
The pawn will hold the weapon that's currently assigned to them. If the pawn has multiple weapons and the equipped weapon changes, the original weapon goes back into storage and the selected weapon is then equipped by the pawn.

I have not run this with simple sidearms but i have heard they are compatible

It is required that the Fire fighting tools be held in the pawn's inventory for use however by the Fire Warden AI. Hence this creates issues with the use of the pocket space process removing items from them. Hence the need to exclude them from this behavior.
Title: Re: [1.0] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Kiame on April 27, 2019, 09:20:36 PM
You'll need to discuss that with whatever mod author adds the Fire Warden
Title: Re: [1.0] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Pelador on April 28, 2019, 08:55:44 AM
I am the author of the Fire Warden mod. And the mod uses normal vanilla behavior with the use of vanilla storage and pockets (pawn inventory) in order to achieve what it needs to do in swapping equipment to respond to fires. It is only the interruption from KV Storage that is causing the problem due to the non-vanilla behavior of how the Storage mod has to manage things with the "pocket dimension". Therefore, the only solution to the issue lies within changing the way in which KV Storage relates to other mods and associated AI. Otherwise, there will be incompatibility remaining between the two mods and potentially the same with any other mod that applies tools for use with AI behavior in a similar fashion.
Title: Re: [1.0] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Kiame on April 28, 2019, 09:29:58 PM
Quote from: Pelador on April 28, 2019, 08:55:44 AM
I am the author of the Fire Warden mod. And the mod uses normal vanilla behavior with the use of vanilla storage and pockets (pawn inventory) in order to achieve what it needs to do in swapping equipment to respond to fires. It is only the interruption from KV Storage that is causing the problem due to the non-vanilla behavior of how the Storage mod has to manage things with the "pocket dimension". Therefore, the only solution to the issue lies within changing the way in which KV Storage relates to other mods and associated AI. Otherwise, there will be incompatibility remaining between the two mods and potentially the same with any other mod that applies tools for use with AI behavior in a similar fashion.

Using reflection you can access any item the pawn can equip and call the methods in Weapon Storage to facilitate the switching of equipment. All source code is posted on github - https://github.com/KiameV/rimworld-weaponstorage

The main method you'd use is WeaponStorage.WorldComp.AssignedWeapons.TryGetValue(Pawn, out AssignedWeaponContainer)

If this is true then you can see if the pawn is equipped a specific weapon (extinguisher i guess) and then use WeaponStorage.HarmonyPatchUtil.EquipWeapon(ThingWithComps, Pawn pawn, AssignedWeaponContainer) to change the pawn's equipment

For the reflection there are two approaches:
Pure abstraction (reflection on objects) - https://github.com/KiameV/rimworld-SaveStorageSettings/blob/master/Source/SaveStorageSettingsUtil/SaveStorageSettingsGizmoUtil.cs
note Exists finds the assembly then AddSaveLoadGizmos uses the assembly to make reflection calls. This is the best option and there's not much in the way of abstraction in this case
OR create a new project in the solution - see the CombatExtended directory  https://github.com/KiameV/rimworld-weaponstorage/tree/master/Source
This is easier to program but requires a second patch to be maintained and users to have two mods to enable functionality
Title: Re: [1.0] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Kiame on April 28, 2019, 10:55:10 PM
I am not in a position to test this atm but this should be very close to what you're looking for

Basically you'd just call


if (!WeaponStorageUtil.TryEquipType(pawn, >def of item to equip<)
{
     // Original Code
}


Just make a new .cs file and put the below code there

using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using Verse;

namespace WeaponStorageUtil
{
    class WeaponStorageUtil
    {
        private static Assembly wsAssembly = null;
        private static bool initialized = false;
        public static bool Exists
        {
            get
            {
                if (!initialized)
                {
                    foreach (ModContentPack pack in LoadedModManager.RunningMods)
                    {
                        foreach (Assembly assembly in pack.assemblies.loadedAssemblies)
                        {
                            if (assembly.GetName().Name.Equals("WeaponStorage") &&
                                assembly.GetType("WeaponStorage.WorldComp") != null)
                            {
                                initialized = true;
                                wsAssembly = assembly;
                                break;
                            }
                        }
                        if (initialized)
                        {
                            break;
                        }
                    }
                    initialized = true;
                }
                return wsAssembly != null;
            }
        }

        public static bool TryEquipType(Pawn p, ThingDef def)
        {
            if (Exists)
            {
                try
                {
                    IDictionary assignedWeapons = wsAssembly.GetType("WeaponStorage.WorldComp").GetField("AssignedWeapons", BindingFlags.Static | BindingFlags.Public).GetValue(null) as IDictionary;
                    if (assignedWeapons != null)
                    {
                        object aw = assignedWeapons[p];
                        if (aw != null)
                        {
                            List<ThingWithComps> weapons = aw.GetType().GetField("Weapons", BindingFlags.Instance | BindingFlags.Public).GetValue(aw) as List<ThingWithComps>;
                            if (weapons != null)
                            {
                                foreach (ThingWithComps w in weapons)
                                {
                                    if (w.def == def)
                                    {
                                        wsAssembly.GetType("WeaponStorage.HarmonyPatchUtil").GetMethod("EquipWeapon", BindingFlags.Static | BindingFlags.Public).Invoke(null, new object[] { w, p, aw });
                                        return true;
                                    }
                                }
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    // Do nothing
                    Log.Warning(e.GetType().Name + " " + e.Message + "\n" + e.StackTrace);
                }
            }
            return false;
        }
    }
}
Title: Re: [1.0] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: mcduff on July 18, 2019, 04:26:46 PM
I get this bug when I open the shared weapons UI.
QuoteException filling window for WeaponStorage.UI.SharedWeaponsUI: System.ArgumentException: key already present in dictionary
Parameter name: key
  at System.Collections.Generic.SortedDictionary`2[System.String,Verse.ThingDef].Add (System.String key, Verse.ThingDef value) [0x00000] in <filename unknown>:0
  at WeaponStorage.UI.SharedWeaponFilterUI..ctor (WeaponStorage.SharedWeaponFilter filter) [0x00000] in <filename unknown>:0
  at WeaponStorage.UI.SharedWeaponsUI.DoWindowContents (Rect inRect) [0x00000] in <filename unknown>:0
  at Verse.Window+<WindowOnGUI>c__AnonStorey0.<>m__0 (Int32 x) [0x00000] in <filename unknown>:0
Verse.Log:Error(String, Boolean)
Verse.<WindowOnGUI>c__AnonStorey0:<>m__0(Int32)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle)

Title: Re: [1.0] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Amnesiac on August 03, 2019, 01:11:04 AM
Hi Kiame,

I think there is an issue currently with the weapon storage, it seems to randomly teleport beer. I have no idea why.

I've moved the weapon storage box around, and every so often all, or sometimes only 40 or so, of my beer will teleport to the circle area of the weapon storage box.

The issue may have started when I started using VGP Garden Drinks, which adds new alcohol types and may mess with the beer in some way that causes it to do this.

Beer, Mead, and other alcoholic drinks are available to be stored in the weapon box as well, though I have beer disabled the beer still teleports
Title: Re: [1.0] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Kiame on January 05, 2020, 12:36:45 PM
Update:
The stored weapons will now correctly calculate the value of apparel stored in Weapon Storage
Title: Re: [1.0] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Kiame on January 23, 2020, 10:43:29 PM
Update:
The Assign Weapon window's scroll will not go past the button at the bottom. This was making it hard to see the last item in the list.
Title: Re: [1.1] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Kiame on February 29, 2020, 06:17:17 PM
Updated for 1.1
https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.1/WeaponStorage.zip
Title: Re: [1.1] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Kiame on March 03, 2020, 10:57:03 PM
Update:
Fix issue where the game would crash if all weapons were unassigned from a hunting pawn.
Title: Re: [1.1] [KV] Weapon Storage [Combat Extended Support] [ModSync RW]
Post by: Kiame on March 24, 2020, 11:56:57 PM
Update:
- When a pawn dies, their weapon will go to weapon storage (assuming there's a weapon storage that can accept the weapon)
- Biocoded weapons will now be displayed at the bottom of Assign Weapons gui. They will also list who they're encoded to.
- Biocoded weapons will no longer be assigned from Shared Weapons
- When a Single-Use weapon is fired, it will now be removed from the pawn's assigned weapons.
Title: Re: [1.1] [KV] Weapon Storage [ModSync RW]
Post by: daquan_baton on March 30, 2020, 09:03:54 AM
It seems this mod isn't compatible with the Facial Stuff mod, loading only this and FS causes the game to load forever/never finish loading/stuck on menu screen with no buttons.

I'm not sure how to get an error log, since the game never loads. Although I was able to change the order in which they load, but no matter their orientation this yields the same outcome.
Title: Re: [1.1] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on March 30, 2020, 10:32:44 AM
Very interesting, there shouldn't be any conflicts between the two. I'll investigate
Title: Re: [1.1] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on March 30, 2020, 10:50:04 PM
Just tested and loads fine with Weapon Storage and Facial Stuff
Title: Re: [1.1] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on March 31, 2020, 12:05:55 AM
Update:
Fixed an issue where pawns would drop weapons when both hands/arms are damaged to the point they cannot hold weapon.

Important points:
There is a new mod setting (and a relatively new one) that play a part in this. These settings apply to dropping weapons as well

- Place Dropped Weapon In Storage (default true)
When any weapon is dropped by a player pawn, the weapon will try to be placed in storage. If there is no storage that can accept the weapon then the weapon will be dropped normally

- Allow Pawn to Drop Weapon (default false)
This will disable the Drop Weapon option from the right click menu. This also plays into this logic in that when a pawn loses arms, the equipped weapon will stay assigned to them instead of being placed into the weapon storage

Additional Point:
Shared weapons ignore the above settings and will be placed into storage. If no storage is available to accept the weapon then it will be dropped normally.
Title: Re: [1.1] [KV] Weapon Storage [ModSync RW]
Post by: VKV on April 07, 2020, 12:07:19 PM
Hi there,

It's a great mod and I have been using it in previous versions too. Now I'm playing with it again with Rimworld 1.1, and I can't find the Assign button. Could you please let me know where to access it? A screenshot would definitely help.

Note: it might be a compatibility issue, but I see no error in the logs, and I'm not using Combat Extended.

Thanks!
Title: Re: [1.1] [KV] Weapon Storage [ModSync RW]
Post by: VKV on April 07, 2020, 12:47:55 PM
Quote from: VKV on April 07, 2020, 12:07:19 PM
It's a great mod and I have been using it in previous versions too. Now I'm playing with it again with Rimworld 1.1, and I can't find the Assign button. Could you please let me know where to access it? A screenshot would definitely help.

OK, got it again. It's in the action button toolbar at the bottom of the screen, next to Install, Uninstall and Build copy when the Weapon Storage item is selected.
Title: Re: [1.1] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on August 12, 2020, 12:30:25 AM
Updated for 1.2
Title: Re: [1.2] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on October 29, 2020, 03:40:46 PM
Update:
Assign Weapon changes:
- Pawns are listed in alphabetical order with previous/next buttons to allow easy cycling.
- Weapon Storages are now listed and can also be cycled through
- Search will now hide unassigned weapons only

When a pawn is selected a new button is available - "Equip From". When pressed, the Assign Weapon window will come up with the pawn selected. A weapon storage can then be selected to interact with from the window. This button can be turned off from mod settings.
Title: Re: [1.2] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 03, 2020, 12:03:45 AM
Update 1.2.0.2 (https://github.com/KiameV/rimworld-weaponstorage/releases/download/current/WeaponStorage.zip):
Fixing an issue where Search was not always being applied.
Title: Re: [1.2] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on December 22, 2020, 02:48:59 PM
Update 1.2.0.3 (https://github.com/KiameV/rimworld-weaponstorage/releases/download/current/WeaponStorage.zip):
Fixing an issue where the assign weapons window would fail to open if two pawns had the same short name
Title: Re: [1.3] [KV] Weapon Storage [ModSync RW]
Post by: Kiame on July 06, 2021, 05:04:17 PM
Update for 1.3 - Direct Download (https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.3/WeaponStorage.zip)