Give thoughts in Alpha 10

Started by Ykara, April 19, 2015, 03:10:24 PM

Previous topic - Next topic

Ykara

Hi guys, I'm having some problems updating my mods to alpha 10. One of them is the drugged rib from EPOE. The rib gives the user a positive thought - well, at least it should. Because I can't get it to work.

   
  <ThoughtDef>
    <defName>DruggedRibThought</defName>
    <workerClass>ThoughtWorker_Hediff</workerClass>
    <hediff>DruggedRib</hediff>
    <nullifyingTraits>
      <li>Prosthophobe</li>
    </nullifyingTraits>
    <stackLimit>12</stackLimit>   
<stages>
      <li>
        <label>Drugged rib</label>
        <description>I don't know why, but somehow I feel relaxed.</description>
        <baseMoodEffect>10</baseMoodEffect>
      </li>
    </stages>
  </ThoughtDef>


Here is the code, I hope someone can help me :/
Thanks in advance!

Tynan

Don't set stack limit for conditional thoughts like this. The thought can never stack anyway and you may be confusing the system with this.

Also try removing the nullifying trait. Or make sure your test case colonist doesn't have it :)
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Ykara

#2
Quote from: Tynan on April 20, 2015, 08:27:43 PM
Don't set stack limit for conditional thoughts like this. The thought can never stack anyway and you may be confusing the system with this.

Also try removing the nullifying trait. Or make sure your test case colonist doesn't have it :)
Thanks! I'll give it a try, I hope it works!

Edit: I've tried it, but it still doesn't work. All I get is this error:

Exception ticking Matvei: System.InvalidCastException: Cannot cast from source type to destination type.

  at RimWorld.ThoughtWorker_Hediff.CurrentStateInternal (Verse.Pawn p) [0x00000] in <filename unknown>:0

  at RimWorld.ThoughtWorker.CurrentState (Verse.Pawn p) [0x00000] in <filename unknown>:0

  at RimWorld.ThoughtHandler.GainThoughtsAsNeeded () [0x00000] in <filename unknown>:0

  at RimWorld.ThoughtHandler.ThoughtInterval () [0x00000] in <filename unknown>:0

  at RimWorld.Need_Mood.NeedInterval () [0x00000] in <filename unknown>:0

  at RimWorld.Pawn_NeedsTracker.NeedsTrackerTick () [0x00000] in <filename unknown>:0

  at Verse.Pawn.Tick () [0x00000] in <filename unknown>:0

  at Verse.TickList.SingleTick () [0x00000] in <filename unknown>:0


I've looked through the dlls, could it be that the ThoughtWorker_Hediff only works for staged hediffs?

Adamiks

I removed
    "<nullifyingTraits>
      <li>Prosthophobe</li>
    </nullifyingTraits>
    <stackLimit>12</stackLimit>"

and i added new stage and "druggedrib hediff" to whole body like alcohol do but this still don't working. I really don't know why.