Ludeon Forums

RimWorld => Mods => Help => Topic started by: Pandora on January 03, 2015, 05:33:55 AM

Title: ThoughtDef
Post by: Pandora on January 03, 2015, 05:33:55 AM
A two-part question:

I'd like to add thought defs to my mod. Basically;

Add bill to worktable, colonist completes bill; colonist gets thought. I want to create a shower worktable where colonists use soap in a recipe and gain a "Clean" thought. This would be a time limit thought, possibly stack-able.

Questions:
1. Can I do this without .dll?
2. Would I add the thought code to the Soap or the Worktable?

And (on an unrelated note). Can I create an Orbital trade beacon, similar to the vanilla Orbital trade beacon, without a .dll?
Title: Re: ThoughtDef
Post by: unifex on January 03, 2015, 05:46:28 AM
Afaik it'd need a bit of code to add the thought. I'm thinking a custom JobDef (could extend the DoBill one) with a driverClass that adds the thought.

I think you could also create a new Soap class that implemented the Usable interface, and add the thought in the UsedBy() method.
Title: Re: ThoughtDef
Post by: Pandora on January 03, 2015, 05:54:50 AM
Coding I can do, it's .dll's that I can't.
Title: Re: ThoughtDef
Post by: Temeez on January 03, 2015, 06:01:03 AM
I'm fairly sure that you need to do some C# (.dll) modding to accomplish this.
Title: Re: ThoughtDef
Post by: Pandora on January 03, 2015, 06:13:27 AM
I used this code in Alpha 7, I believe it worked (I had no errors).

<ThoughtDef>
      <defName>eatenstew</defName>
      <label>Ate simple Stew</label>
      <description>I ate a simple stew.</description>
      <baseMoodEffect>5</baseMoodEffect>
      <duration>20000</duration>
      <stackLimit>3</stackLimit>
   </ThoughtDef>

   <food>
         <quality>MealSimple</quality>
         <nutrition>85</nutrition>
         <eatenDirectThought>eatenstew</eatenDirectThought>
         <eatEffect>EatVegetarian</eatEffect>
         <ticksBeforeSpoil>40000</ticksBeforeSpoil>
         <soundEat>Meal_Eat</soundEat>
      </food>
   </ThingDef>