RimWorld

RimWorld

277 ratings
Caravan Mood Buff
3
2
2
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.3, 1.4, 1.5, 1.6
File Size
Posted
Updated
175.322 KB
12 Dec, 2021 @ 10:20am
20 Jul @ 10:40am
10 Change Notes ( view )

Subscribe to download
Caravan Mood Buff

Description
Description
Have you ever been annoyed by caravan pawns immediatly going full mental the moment they enter a caravan site?
Ever felt that any normal person would realize they can't expect to be pampered when traveling the world?
Thought that winning a battle should make one happy, even if it came at a cost?

...I have.

I have been annoyed to no end by "run wild", "gave up", "berserker" etc. when trying to clear out ancient complexes and other sites in the fastest way possible because people's mood disintegrates within minutes the moment they get somewhere, forcing a harsh timer on you before everything breaks into total chaos - just for them to be all happy again, the moment you leave.


Using this should make caravan fights less painful when it comes to constant mood breaks.


Adds mood buffs for caravans:
- while traveling in a caravan
- while on a map that is not player controlled, like event sites or battles
- when a caravan site that is being visited has no more enemies
- when winning a caravan battle
All buffs are adjustable in the settings.

---

Compatibility:
No known incompatibilities.

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

---

GitHub: https://github.com/XT-0xFF/CaravanMoodBuff
68 Comments
Syrus  [author] 21 Jul @ 11:32am 
@Sennah
Nah, that's just debug information.
Though I have no idea how you got the initialization of the static defs to fail. Only idea I have to un- and resubscribe to the mod - or there is a conflict with some other mod you are running
Sennah 21 Jul @ 11:11am 
Did you leave some path to your files in your code?
Could not execute post-long-event action. Exception: System.NullReferenceException: Object reference not set to an instance of an object
[Ref 4C830C99]
at CaravanMoodBuff.CaravanMoodBuffSettings.InitializeStatics () [0x00000] in D:\0Stuff\2Games\RimWorld\_mods\CaravanMoodBuff\Source\CaravanMoodBuffSettings.cs:59
at CaravanMoodBuff.CaravanMoodBuff.Initialize () [0x00000] in D:\0Stuff\2Games\RimWorld\_mods\CaravanMoodBuff\Source\CaravanMoodBuff.cs:50
at Verse.LongEventHandler.ExecuteToExecuteWhenFinished () [0x0007c] in <981a33edf24d499488b0f820d94638e1>:0
startIndex: 60
endIndex: 72
Syrus  [author] 21 Jul @ 9:53am 
@Aladeen
As long as it works, it works. Maybe not perfectly efficient, but I see no other option for the moment.

@Richard Mc Nutbuster
The error it throws in the log would be a good start, without any info I can't help
Richard Mc Nutbuster 21 Jul @ 8:06am 
not sure why (id have no idea what log to produce here) but it pops up a red error and the mod options dont exist
Aladeen 20 Jul @ 7:44pm 
@Syrus, I agree with you regarding the underlying execution and what it’s doing. Decompiling might help, but even if we figure it out, we won't be able to modify the game :)

That .ToArray() is a poor way of “solving” the problem, but if no weird behaviors are occurring, then I guess we could say “it worked.”
Jetwolf 20 Jul @ 2:50pm 
Legendary, ta
Syrus  [author] 20 Jul @ 10:46am 
Version 1.6.2
Fixed error due to modified collection, thanks to @Aladeen
Removed leftover debug print

---

@Aladeen
This issue has me slightly worried.
The code, as it was, was taken from previous versions, which ran without issue. Not sure why the collection is modified during the call all of a sudden, it could mean that there is something multithreaded going on which causes the collection to change on subsequent runs of the foreach-loop.
I applied your change, it should work fine, though if it really is a multithreading issue, I'm worried that the collection may be modified while its array is being acquired...not sure what that would mean for my code and its execution.
Aladeen 20 Jul @ 8:25am 
Hi Syrus, thanks for your mod! Not sure what's happening in 1.6, but in some cases it throws a repeating error. I submitted a pull request to fix it.
Jetwolf 14 Jul @ 3:06pm 
Thank you!
[岗] Señiorita woofers 12 Jul @ 8:33am 
The Man