Ludeon Forums

Ludeon Forums

  • December 01, 2020, 09:49:58 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: ThoughtDef  (Read 796 times)

Pandora

  • Drifter
  • **
  • Posts: 58
  • AstroTec Engineer
    • View Profile
ThoughtDef
« 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?
« Last Edit: January 03, 2015, 05:37:06 AM by Pandora135 »
Logged

unifex

  • Drifter
  • **
  • Posts: 71
  • Refugee
    • View Profile
Re: ThoughtDef
« Reply #1 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.
Logged

Pandora

  • Drifter
  • **
  • Posts: 58
  • AstroTec Engineer
    • View Profile
Re: ThoughtDef
« Reply #2 on: January 03, 2015, 05:54:50 AM »

Coding I can do, it's .dll's that I can't.

Temeez

  • Drifter
  • **
  • Posts: 79
  • Refugee
    • View Profile
Re: ThoughtDef
« Reply #3 on: January 03, 2015, 06:01:03 AM »

I'm fairly sure that you need to do some C# (.dll) modding to accomplish this.
Logged

Pandora

  • Drifter
  • **
  • Posts: 58
  • AstroTec Engineer
    • View Profile
Re: ThoughtDef
« Reply #4 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>