RimWorld

RimWorld

Extended Storage Extended
TerraggosaurusRex  [developer] 12 Oct, 2018 @ 6:25pm
Can you add <non-vanilla-weapon> to a WeaponsRack?
I might or might not, but that doesn't mean you can't.

You can mod this mod yourself to include the weapns you want (in increasingly less maintainable ways):

  1. Convince the Mod maker making the modded weapons to use XPath transforms to add it as an included Patch in their mod.
  2. Make a mini-mod to use XPath transforms to add it w/o editing this mod's code.
  3. Find the steam mod folder for 1535875857 [this mod] and copy it to the non-steam mods folder, then unsub from this mod to prevent conflicts. In the folder you copied, look inside the /Def files, you can quickly see the list of ids and edit them directly.
  4. Edit the mod directly to add the new wepaon ids, but that will get overwritten when I do updates.

I expect to be updating on a semi-regular basis, so the last item is really sketchy, but viable if you know the risks.

Update

I'm more confident in my understanding of mods, so if there are mods (like Weapons Tech) somebody would like to see, please create a new discussion thread listing the mods. I only ask for that discussion thread to show interest and that it's worth spending my limited development time extracting, adding, and testing another developer's work into mine.

Priorities for including mods are:
  1. Respecting the time needed to develop mods.
  2. Mod is on steam, stable, and is in active development with recent updates.
  3. Source code availible through a non-steam souirce (github / bitbucket / etc.)
  4. Mod internals in question is laid out in a conventional style.
Last edited by TerraggosaurusRex; 5 Nov, 2018 @ 1:13pm
< >
Showing 1-9 of 9 comments
Doc Cams 14 Nov, 2018 @ 5:18pm 
I'm really not a modder and have no prior knowledge of coding but somehow know how to change some lines on the code successfully.
Instead of adding the weapons "thingsdef" per se, would adding the category instead would suffice?
e.g. Been using medieval times, LOTR and other tribal-medieval mods and there's like a ton of weapon stuff. So instead of editing the thingsdef one by one, would replacing the category suffice? Then we will put [thismod] at the end of the modlist so that it can load the mod-added weapons before it.

edit1: Changed the thingdef to category,waiting for load
edit2: successful, mod order doesnt matter.
Last edited by Doc Cams; 14 Nov, 2018 @ 6:15pm
TerraggosaurusRex  [developer] 16 Nov, 2018 @ 9:19am 
@< blank >: Looks like you've got it figured out.

My choices were based on having small/large/massive weapons have their size determine how many you a 'realistically' put into a container for game-balance reasons. The base ExtendedStorage only handles one multiplier per container so we can't say "Store 20 Revolvers but only store 10 Bolt-Action Rifles" and unfortunately Rimworld doesn't have any implementation of a "weapons with mass < 5kg" filter - so managing the what is 'small/large/massive' can only be done on individual thingDefs (with vanilla weapons) on a per container basis.

Other mods may have a categorization schema that makes those balance decisions easier, which is great. And if the mod doesn't stray too far from some really basic precepts, adding thing by category can work (and honestly is preferable - as you've seen).

As I mentioned in the thread you started, please link to the mods (steam links are fine) and I can look into adding self-patches to my mod to accommodate the other mods that people are using.
Doc Cams 19 Nov, 2018 @ 9:07pm 
I am just happy that all the looted weapons are not scattered everywhere. I started the discussion since I can't comment on the workshop since I dont own the game ,sorry 'bout that (now I own it, somebody gifted it to me). Thanks
Haram Bae 24 Nov, 2018 @ 4:29pm 
Probably a dumb question, but i edited my copy of the game to accomodate the multitude of weaponos from the Weapon Tech mod, but now the little "quality" tabs are missing from the racks I edited. Also the log threw up some stuff about missing mass values for the racks.

Did I delete something important or mess up the formatting on the XML?
TerraggosaurusRex  [developer] 24 Nov, 2018 @ 5:08pm 
@Haram Bae - Make sure that Extended Storage is loaded before Extended Storate Extended. I've seen that exact error before but only when not having ES loaded before ESE.

OTOH, I made some internal changes to make modding easier (no, really, stop laughing), slimmed the individual objects, and cleaned up the layout/inheritance - so maybe your mod-ed file isn't inheriting properly - which will mimic the errors ES not being loaded.

A link for a Hugslib logdump would confirm it, though

I strongly suggest you try to transplant your mod-ed filter sections from your mod-ed file into the appropriate file in a fresh copy of this mod.

Next release I expect to include a "Patch Template" in the release so users can quickly build their own patch mods without my updates destroying the customized work.
Last edited by TerraggosaurusRex; 24 Nov, 2018 @ 5:08pm
Haram Bae 25 Nov, 2018 @ 11:42am 
Yeah, I opened the most recent version, huge change in the internal stuff.
I dropped my filter edits in to the new .xml, same issue. However, I noticed that the large weapons rack now has an "exclusion" filter. Is anything not in that filter automatically allowed? I ask because weapons that I didn't add to the filter are showing up as storable.

And ♥♥♥♥♥♥♥♥♥, I tried everything I could think of, and guess what the problem appears to have been? Extended storage WAS loaded first, but it was one of my first mods, and ESE was near the end. I moved them together, and the quality tabs are back and the log errors are gone.
Last edited by Haram Bae; 25 Nov, 2018 @ 12:23pm
TerraggosaurusRex  [developer] 26 Nov, 2018 @ 5:13am 
Yeah, that should be the last major internal change for wepaons-based containers - I'm happy with the inheritance now.

as for the XML <fixedStorageSettings> sets the absolute allowed/disallowed list, but <defaultStorageSettings> set what is accpted by default. If <fixedStorageSettings> isn't availible, then <defaultStorageSettings> also inherits the meaning of <fixedStorageSettings>, so there is only need to maintain one list unless there is a need to do something wacky (like me).

So the selection process goes something like this:
  1. Allow all WeaponsRanged and WeaponsMelee (categories)
  2. Disallow any Grenades (category)
  3. Disallow Gun_TripleRocket [...] Gun_HeavySMG (individual weapons)
  4. Default to accepting MeleeWeapon_Mace [...] Gun_SniperRifle (individual weapons)
  5. Default any remaining wepons to not accepted.

In the end the basic Large Weapons rack will hold any non-vanilla weapon - if you manual accept it into each individual container.

If you are manually setting the filter, I suggest emptying the <fixedStorageSettings><filter> node and replacing it with your filter structure, moving the <priority> from <defaultStorageSettings> to <fixedStorageSettings>, and then removing the entire <defaultStorageSettings> node.

I just now realized how ES uses a non-unique FurnitureBase thingDef, and one of your mods between ES ansd ESE did overwrite it with its own so the ES unique stuff was lost.

I do have a pull request in with the mainter of ES, for other issues, that will solve this problem as well.

Thanks for the extra leg work, I'll add to the description now (and release notes on the next update).
Last edited by TerraggosaurusRex; 18 Dec, 2018 @ 7:24am
Shepardx 28 Nov, 2018 @ 8:55pm 
@TerraggosaurusRex You rock man, but just like that, for sorting via weapon mass, maybe you could ask Simple Sidearms Author. in the mod option in the game there's a slider that allows you to sort weapon according to their mass. Maybe it'd be useful to you?
TerraggosaurusRex  [developer] 28 Nov, 2018 @ 9:53pm 
Glad to help! Thank you for the heads up about Simple Sidearms - I will certainly crack open the code to see how SS is doing it. I fear that it's a C# assembly which mean I'm not going to be able to use it (yet).

OTOH, if I up my xpath patching game I might be able to handle it with XML. Note to self - see if Unity xpath operations can handle standard compound numeric comparison operators.
< >
Showing 1-9 of 9 comments
Per page: 1530 50