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 PatchCompatible 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:
- Load one or many Weapon Storage containers with weapons
- Select a Weapon Storage
- Select the Assign Weapons button
- Select the pawn to assign weapons to
- Select the weapons to assign to the pawn
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.
- If a pawn drops a weapon which they are assigned to, they are no long assigned to that weapon.
- If a pawn picks up a weapon, they are now assigned with that weapon.
- If a drafted pawn is carrying something in their primary equipment slot that is not a weapon, instead of placing the item in their pocket of holding they will place it on the ground.
Forming CaravansStored 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 AttachmentWill 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)
Like my mods? Consider supporting me!
(https://ko-fi.com/kiamev)
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!
Good Question.
Does this mod enable pawns to carry multiple weapons or are they required to exchange their weapons from the box ?
<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:
- Load one or many Weapon Storage containers with weapons
- From the different Weapon Storages, assign weapons to the pawns
- When a weapon is assigned to a pawn, that weapon is no longer stored in that container. Instead it exists in a pocket dimension (think bag of holding ;) ) that is accessible by any other Weapon Storage
- 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.
- If a pawn drops a weapon which they are assigned to, they are no long assigned to that weapon.
- If a pawn picks up a weapon, they are now assigned with that weapon.
- If a drafted pawn is carrying something in their primary equipment slot that is not a weapon, instead of placing the item in their pocket of holding they will place it on the ground.
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.
It's Hammerspace !
Awesome :)
Final and most important question : Do Caravans have access to the Gunstorage ?
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.
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 ..
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.
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
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.
Your mod is compatible with ?
https://ludeon.com/forums/index.php?topic=32497.0
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.
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?
This will support any modded weapons. No idea regarding cartridges (didn't even know there were mods w/ cartridges tbh)
Added the ability to drop one weapon at a time.
Steam and direct download updated
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
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.
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 ! :-)
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
Update:
Weapons in the GUI are now sorted by type.
Cleaning up the buttons for selecting weapons when pawns are drafted.
Update:
Added an option in Mod Settings to display weapon buttons even when a pawn is not drafted.
A18.1700 version can be downloaded here: https://github.com/KiameV/rimworld-weaponstorage/releases/download/20171025/WeaponStorage.zip
Every time I draft my colonist he drops all of his clothes, anything to do with this mod ?
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!
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
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.
Fixed for the latest A18 unstable build. Steam and direct download updated
Update:
Added "Repair Attachment"
See mod description for more details
Stored Weapons will now show up in trade windows
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
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.
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.
Woa this looks like a very tricky bug. Props for even finding it ^^
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
Fixed an issue where Include in Sale button selection was not persisting between saves
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.
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
"Do until X" is now supported. Stored weapons will be counted
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
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 ?
I unassigned a pawn from a thrumbo horn and the weapon storage ate my thrumbo horn.. :'(
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.
Okay .. I have build one for change dresser but not filled it yet.
Adding ModSync.ninja (http://www.modsync.ninja/) support
Fixing an issue where this mod would cause Mac and Linux to crash
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!
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)
??
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.
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
Update:
-When a pawn is downed, the weapon in use will be remembered and re-equipped when the pawn is healed.
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.
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
Update:
-Stored Weapons can now be used in bills
Quote from: Kiame on December 29, 2017, 03:01:35 AM
Update:
-Stored Weapons can now be used in bills
YEESHHH.
New mod added to add mending support: https://ludeon.com/forums/index.php?topic=37942.msg388564#msg388564
Update:
-Fixed an issue where Reset on a trade window would cause stored items to no longer be shown
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!
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.
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!
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.
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
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.
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.
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.. ::)
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
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!
Kiame, did you not update github?
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
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
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
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?
To know if you have the most recent version, this mod is using ModSync.ninja (http://www.modsync.ninja)
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!
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?
There is no limit to the number of weapons that are stored and there is no option to create a limit.
Damn. I guess Im just gonna have to remember to not put more than 5 items in each container then.
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
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
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.
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
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.
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
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.
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!
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
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
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
[1.0] Updated to work with the latest unstable version
https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.0/WeaponStorage.zip
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
Just tested in RW 1.0.1974 rev 538 and Weapon Storage version 1.0.0.4 and everything's working on my side
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)
ack am i getting sloppy? Looks like i missed a debug log. I'm assuming everything is working correctly in game?
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
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.
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.
Looks like an item got duplicated. Gun_OrassanShotgun330566 exists twice in the game.
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
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
Updated for the latest Mend & Recycle version
Update:
Added an (i) button to inspect weapons from the Assign Weapons dialog window
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.
Heh I think that may be a bug as infinite storage does seem to suck up stuff further away. I should look into that
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
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
Make sure you're using the most recent version of both mods. That will happen when one version is older than the other
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 :-(
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.
Hey canute have you had any issues with large spam of warnings when using either weapons storage or change dresser?
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.
Thats a mostly harmless albiet annoying error.
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 just build 1 storage for ranged and 1 for melee
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
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
Update:
Made the search field case insensitive
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
hmm they should assuming there is a weapon storage exists prior to the equip
I'll double check though
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
Update:
"Do Until X" filtering works again with bills
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
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.
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.
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!
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
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
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.
Update:
Fixed an issue that caused weapon duplication when pawns dropped their weapon.
Thanks for the help Amnesiac
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
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
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.
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.
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
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.
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 ! :-)
I guess it is time for me to figure out how add those 'weapons' dynamically to the filters....
I wonder what a tust is
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.
You are one of the fastest modder :-)
Much thanks !
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.
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
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.
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
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.
Update:
Fixed and issue that was causing the Mod Options from closing if no game had started. Sorry about that!
Updated for 1.0
https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.0/WeaponStorage.zip
Update:
Fixing an issue where abandoning a map that had a Weapon Storage would cause errors
Update:
Works again with the newest version of Mending
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()
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
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()
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
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]
If you disable those mods and try to build the weapons storage in a new game does it work?
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).
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.".
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.
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
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.
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
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.
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.
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.
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
Update
Added shared weapons
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.
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.
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?
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]
nah save game compatible. I'll look more into this tomorrow
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.
Does the old way of assigning not work either?
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.
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
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?
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)
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:
- JecsTools
- Psychology
- ED-EnhancedOptions
- TD Enhancement Pack
- QualityBuilder
- Blueprints
- QualitySurgeon
- RimHUD
- Locks
- MendAndRecycle
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
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.
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 :(
Update:
Fixing a bug that was was causing an error when removing weapons for smelting or repair
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
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.
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?
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 ?
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...
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
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
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.
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
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.
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
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.
You'll need to discuss that with whatever mod author adds the Fire Warden
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.
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
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;
}
}
}
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)
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
Update:
The stored weapons will now correctly calculate the value of apparel stored in Weapon Storage
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.
Updated for 1.1
https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.1/WeaponStorage.zip
Update:
Fix issue where the game would crash if all weapons were unassigned from a hunting pawn.
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.
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.
Very interesting, there shouldn't be any conflicts between the two. I'll investigate
Just tested and loads fine with Weapon Storage and Facial Stuff
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.
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!
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.
Updated for 1.2
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.
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.
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
Update for 1.3 - Direct Download (https://github.com/KiameV/rimworld-weaponstorage/releases/download/1.3/WeaponStorage.zip)