RimWorld

RimWorld

67 ratings
Auto-assign Inventories on Caravan arrival
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.4, 1.5, 1.6
File Size
Posted
Updated
326.379 KB
31 Oct, 2022 @ 5:32pm
11 Jul @ 11:32am
6 Change Notes ( view )

Subscribe to download
Auto-assign Inventories on Caravan arrival

Description
Description:
Automatically distributes things carried in the inventory of caravan members to pawn's inventories in accordance to their requirements set by the "Assign"-tab assignments (like medicine) and drug-policies when a caravan arrives on a map.

- For example:
Alice and Bob are in the same caravan. Both should carry 5 beer due to a drug policy assignment.
Alice has 1 beer in her inventory and Bob has 12 beer.
Once Alice and Bob's caravan enters a map, this mod will distribute Bob's beers by moving 4 of them to Alice's inventory.
Now Alice carries 5 beer and Bob carries 8 beer, both satisfying their drug policy requirement.

Everyone is happy!
Until they die from an ambush of manhunting squirrels because they got drunk...

---

This will also work nicely if you are using the ammo option in Yayo's Combat 3 and set colonists to always carry a certain amount of ammo.

---

Compatibility:
No known incompatibilities.

Please report any issues and include the HugsLib log (CTRL+F12) if possible when reporting bugs,
it helps immensely tracking down what went wrong, thank you!

---

Modder notes:
If anyone wishes to integrate this patch into a bigger compilation of tweaks/patches, feel free to do so, but please inform me.
A short mention for writing the code would also be appreciated in that case.

---

GitHub: https://github.com/XT-0xFF/AutoAssignInventoryCaravan
27 Comments
Syrus  [author] 12 hours ago 
Checked it to make sure, and pawns will use drugs from the caravan inventory while traveling, at least for scheduled drug use
(tested with Luciferium and Psychite Tea, made sure they were loaded onto a pack animal before the caravan left the map, then set the drugs to be taken 10x a day, the caravaneers immediately started taking them off map)
Syrus  [author] 29 Oct @ 11:36am 
If pawns can't use drugs from the caravan inventory, I could execute the distributing of items on creating caravans as well, I guess...
Marvash Magalli 29 Oct @ 10:32am 
I assumed the same, but apparently they don't... unless it's a weird mod interaction. Ah well, I thought this mod would fix my problem, thanks for correcting me!
Syrus  [author] 29 Oct @ 10:29am 
Hmh...probably won't help you in that case, since this mod distributes the items when a caravan arrives.
I'd have thought that pawns take drugs during a caravan from the overall caravan inventory regardless of who carries them though?
Marvash Magalli 29 Oct @ 1:42am 
Had to stop a caravan cause a pawn who needed to take luciferium loaded it on a random animal instead of stocking it in his inventory as usual... thank you, will give this a try!
SilkMoth 2 Oct @ 7:50am 
no idea too sounds just....stupid.....maybe its a coincidence and something updated breaking pawn behavior sometimes but i cant possibly know wich mod could it be, therefore i can only assume its the only thing i added just now
Syrus  [author] 2 Oct @ 3:49am 
And that's what I don't understand about CE. This mod here is technically speaking very small, it only patches in a pre- and postfix to "CaravanEnterMapUtility.Enter", the prefix looks up what pawns are in the caravan, the postfix executes the distribution. If the prefix is not executed for whatever reason, the postfix won't do anything. If the postfix is not executed, nothing will happen.

The distribution method looks through all pawns in the caravan, checking the "Assign"-tab and drug policy assignments, counting up what each colonist should have.
Then it looks through all inventories of any pawn in the caravan (colonists, prioners, animals), counting what everyone does have.
And finally it distributes the available items as best as possible.

In other words, it only comes into play when a caravan enters a map (spawns into a map).
No idea why it would cause the issues you mention...
SilkMoth 1 Oct @ 1:24pm 
okay seems like theres a conflict with CE. Pawns seem to stand around sometimes trying to merge items all the time and it only happend after i added this mod
Also Jobgiver is giving reload weapon errors making pawns freeze too putting away and taking out their weapon when wielding melee (that too didn't happen before) therefore i suspect this is a mod conflict sadly.
Either way ill be sure to use this mod when i start a run without CE in the near future
SilkMoth 1 Oct @ 10:03am 
@Gerewoatle there's no need to be so mean towards me when i politely asked a simple question about compatility for a mod, also am i one of the ones complaining? why bring that up? yeah sure some loud ass people that don't really know anything about patching just complain about it but its just happens and does not represent everyone playing with ce dammit. People complaing about every god damm mod if something dosent work despite not knowing how much hard work people put into making FREE content for this game for everyone to enjoy
SilkMoth 1 Oct @ 10:03am 
sure ill try it!
however i want to clear up a few things i am not complaining nor am i demanding a ce patch from anyone, i tired doing it myself its quite hard, im also not much of a coder my carrer ended much sooner than id like for less than nice reasons.
I do know that ce used to be REALLY incompatible with almost everything but its not nowdays and there's a huge list of things it works with and more patches are added semi regularly wich is great ofc and the CE team is doing wonders (ofc so are the people who also do them)