边缘世界 RimWorld

边缘世界 RimWorld

68 个评价
Auto-assign Inventories on Caravan arrival
   
奖励
收藏
已收藏
取消收藏
Mod, 1.4, 1.5, 1.6
文件大小
发表于
更新日期
326.379 KB
2022 年 10 月 31 日 下午 5:32
7 月 11 日 上午 11:32
6 项改动说明 ( 查看 )

订阅以下载
Auto-assign Inventories on Caravan arrival

描述
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 条留言
Syrus  [作者] 11 月 1 日 上午 4:17 
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  [作者] 10 月 29 日 上午 11:36 
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 10 月 29 日 上午 10:32 
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  [作者] 10 月 29 日 上午 10:29 
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 10 月 29 日 上午 1:42 
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 10 月 2 日 上午 7:50 
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  [作者] 10 月 2 日 上午 3:49 
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 10 月 1 日 下午 1:24 
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 10 月 1 日 上午 10:03 
@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 ♥♥♥♥♥♥♥♥ 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 10 月 1 日 上午 10:03 
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)