Praying Spot Help

Started by Exortus, April 21, 2017, 07:15:42 AM

Previous topic - Next topic

Exortus

Dear All,

I have been playing Rimworld for a while now and have started adding mods recently. I have not found any religion focused mod so far that fits the concept I would prefer. So I thought I will try to make my own mini-mod for this purpose.

Basically what I would like to have is a praying spot, very similar to a party or wedding spot, or caravan spot in other mod(s).
I do not want to have specific religions or new mechanism, I just want to build simple shrines and temples where my pawns would go to pray occasionally (beside their rooms).

The problem is that I have absolutely no experience in Rimworld modding. I checked some info for modding but I found them quite overwhelming for this (seemingly) simple feature.


So can somebody help me with accomplishing this? I am looking for files to modify/add and the methods to do so.

I really appreciate any help you can provide.

AngleWyrm

Mods\Core\Defs\JobDefs\Jobs_Joy.xml
  <JobDef>
    <defName>Pray</defName>
    <driverClass>JobDriver_RelaxAlone</driverClass>
    <reportString>praying.</reportString>
    <joyDuration>3000</joyDuration>
    <joyGainRate>1</joyGainRate>
    <joyKind>Meditative</joyKind>
  </JobDef>
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

Exortus

Thanks!
This helped a lot with finding relevant joy and building defs.
Now to dll fidling...

togfox

Bumping an old thread to see if there is a way to nominate where a pawn prays, should they decide to do that?

The vanilla game already has a prayer event (I assume it is 'joy'). I don't want to change that. I just want to nominate where it happens. Just like a party or wedding. When it happens, I'd like to say where it happens.

Cheers.

Mehni

  <JoyGiverDef>
    <defName>Pray</defName>
    <giverClass>JoyGiver_InPrivateRoom</giverClass>
    <baseChance>1</baseChance>
    <pctPawnsEverDo>0.5</pctPawnsEverDo>
    <jobDef>Pray</jobDef>
    <joyKind>Meditative</joyKind>
    <canDoWhileInBed>true</canDoWhileInBed>
  </JoyGiverDef>

That giverClass is a reference to a class in the Assembly-CSharp.dll. Make a new class based on that, with a different IntVec3 as the result. Then point the xml to your new class.

https://rimworldwiki.com/wiki/Modding_Tutorials/Linking_XML_and_C

LWM

This is actually something I am interested in; I was thinking simple shrines.  I can probably put together some logic that would allow interface-spots (whatever those are called), prayer spots, or default to vanilla if all else fails.

--LWM

togfox

I started the xml and have a spot I can place. It is non-functional as I stalled on the coding side. PM if you'd like to take over my limited progress.

LWM

Success!

It turns out getting prayer spots that you can put on top of other things is ...not trivial.  Thanks go out to the Area Rugs mod, which did this by accident and saw no reason to fix it.  There's like 4 different flags you have to get right, and some of them you get right by not having flags at all.

Anyway, I have posted the first working version on GitHub:  https://github.com/lilwhitemouse/RimWorld-PrayerSpot/

It's also available on Steam as Prayer Spot.

I don't think I broke praying in bed while sick, but no promises.

--LWM


togfox

This is great - I must try tonight!!