Ludeon Forums

RimWorld => Mods => Help => Topic started by: Exortus on April 21, 2017, 07:15:42 AM

Title: Praying Spot Help
Post by: Exortus on April 21, 2017, 07:15:42 AM
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.
Title: Re: Praying Spot Help
Post by: AngleWyrm on April 21, 2017, 01:35:49 PM
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>
Title: Re: Praying Spot Help
Post by: Exortus on April 24, 2017, 05:33:29 PM
Thanks!
This helped a lot with finding relevant joy and building defs.
Now to dll fidling...
Title: Re: Praying Spot Help
Post by: togfox on March 04, 2019, 01:24:19 AM
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.
Title: Re: Praying Spot Help
Post by: Mehni on March 04, 2019, 03:40:23 AM
  <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
Title: Re: Praying Spot Help
Post by: LWM on March 11, 2019, 07:35:53 PM
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
Title: Re: Praying Spot Help
Post by: togfox on March 12, 2019, 05:45:54 AM
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.
Title: Re: Praying Spot Help
Post by: LWM on May 10, 2019, 12:07:50 AM
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

Title: Re: Praying Spot Help
Post by: togfox on May 10, 2019, 01:14:11 AM
This is great - I must try tonight!!