RimWorld

RimWorld

214 ratings
[D] Interests Framework
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.1, 1.2
File Size
Posted
Updated
409.864 KB
8 May, 2020 @ 6:29pm
22 Aug, 2020 @ 7:53am
14 Change Notes ( view )

Subscribe to download
[D] Interests Framework

Description
Adds tools to create skill-linked "interests" in place of and in addition to the basic major and minor passion.

This mod does not significantly change the game on its own. Instead, it enables modders to create their own interests more easily than would otherwise be possible, as passions are hard-coded into the game.

Check out my Interests mod, which utilizes this framework to add 11 new interests to the game: https://steamproxy.net/sharedfiles/filedetails/?id=2089938084

Requires Harmony.


------------------------------------------------------------------------------------------------------

How it works:
Passions are set and read according to an enum. Enums are compiled directly to ints, which means they can't be overridden with Harmony or any other means. However, this also means any int can be cast to a Passion unchecked, and stored in a field meant for a Passion.

The result is compatibility with most mods.

The other major obstacle is the fact that passion evaluation is hardcoded based on the enum. So, we use Harmony patches, including some transpilers, to call our own code on these evaluations. However, this has to be done for *any* evaluation of passions, which means mods that use their own code to evaluate passions won't natively take our new interests into account. So, the framework patches some of those too.
Let me know if you think of mods that could use increased integration with interests.


------------------------------------------------------------------------------------------------------

Load order:

Harmony
Core
Royalty
...
Interests Framework

------------------------------------------------------------------------------------------------------

Compatible with:
- EdB Prepare Carefully (patch included)
- RimHUD (patch included)
- Character Editor (patch included)
- Children, school and learning
- Work Tab
- Mad Skills (though this may change functionality of some learn rates, obviously)

Conflicts:
- Static Quality Plus. This mod overrides nearly everything about pawn skills, and it'd be a significant project with constant maintenance to ensure compatibility, so I don't.
- Generally, mods that display skill/passion information in an exclusionary way. I don't know any in particular other than the ones I've explicitly patched, but they're bound to be out there. Let me know if you find one.
- Custom races may or may not take advantage of expanded passions automatically.

------------------------------------------------------------------------------------------------------

Details:
- Source code is included, so feel free to look and modify anything you want.

- DInterest.InterestDef: new type of def for interests. Define one in XML using the preset fields, or subclass it and use the hooks from InterestBase.
- Defined interests are automatically added to the pool with the given properties. These include the ability to modify:
- Learn rate
- Forget rate
- Texture
- Chance to appear (through a weight system)
- Chance for the associated skill to be chosen for inspiration
- Chance for inspiration to occur
- Skills ineligible for the interest

- Additionally, you can subclass InterestDef and override any of the methods. This allows you to define behavior to occur on every tick for every pawn with the given interest, or create interests that affect all the pawns on the map when they use the given skill (among other things).

------------------------------------------------------------------------------------------------------

Please let me know if you run into any issues, compatibility or otherwise.
Popular Discussions View All (1)
1
30 May, 2020 @ 12:38pm
Can't Use Debug + This (unless have edb preparecarefully)
LukanGamer
33 Comments
Mlie 16 Sep, 2021 @ 1:53pm 
Made an update of this:
https://steamproxy.net/sharedfiles/filedetails/?id=2603675659
Hope it helps anyone!
DerKreepero 2 Sep, 2021 @ 2:12am 
Well damn I hope someone has the time and energy to convert this to 1.3. It's a fantastic mod.
why are we here? just to suffer? 10 Aug, 2021 @ 8:15am 
1.3??
Varjonyymi 3 Aug, 2021 @ 5:30am 
Oh yeah, same problem as in 1.2 before the compatibility patch. Personally I don't mind, RimHUD showing the needs etc. is handy, so just turning skill view off from hud and checking them from pawn bio. So at least I'd appreciate the updated Interests if you upload it :)
Mlie 3 Aug, 2021 @ 3:41am 
@Varjonyymi The RimHud sill display a bunch of stars for the skills that have interrests connected to them. So where it shows 1 or 2 stars based on passion it will show about 10 stars.
Varjonyymi 3 Aug, 2021 @ 3:04am 
Or not incompatibility but rather integration problem
Varjonyymi 3 Aug, 2021 @ 3:02am 
@Mlie: how bad the incompatibility with Rimhud is? If it's just the cosmetic thing of not showing Interests on the hud but pawn bio menu working correctly, it doesn't sound like a big deal
Mlie 3 Aug, 2021 @ 1:39am 
I have tried updating it and have a working version. However the integrations in other mods (Himhud for example) is not working. So i could release it as it is now without integrations, but unsure if it would be worth it
Varjonyymi 2 Aug, 2021 @ 5:48am 
@Timou: Mlie has marked it on his update list
Timou 2 Aug, 2021 @ 4:17am 
Update please 1.3