[1.3.3117 + both dlc] Opinion debuff for selling slaves despite ideoligion

Started by gulegule, October 03, 2021, 10:39:52 PM

Previous topic - Next topic

gulegule

Also reported here: https://ludeon.com/forums/index.php?topic=54849

When selling a slave with a Slavery:Honorable ideoligion, some colonists will get a -15 'sold prisoner' opinion debuff alongside the +10 'sold slave' ideoligion modifier.  This happens in unmodded 1.3.3117 with Royalty and Ideology.

Circumstances: Started a small test colony, using dev tools I spawned two prisoners, and enslaved one.  Also spawned a slaver caravan.

What happened: Ordered one colonist ('Izzy') to trade with the slaver.  Sold the previously enslaved prisoner.  Other colonist 'Unay' acquires both +10 sold slave opinion and -15 sold prisoner opinion.  Other colonist 'Sappy' only acquires the +10 opinion.  All three are starting colonists from the same ideology w/ slavery: Honorable selected.

Expected behavior: All colonists should receive only the positive opinion modifiers per their ideoligion.

How to reproduce:  I've put two save files here: https://drive.google.com/drive/folders/1zQav2ogIXTMvGARDBhLnP3BrrLzAU081?usp=sharing. Load the one titled 'SlaveTestTwoEnslaved'.  Note that 'Unay' has a +35 opinion of 'Izzy'.  Use the debug actions menu to trigger a trade caravan from 'East Eveuia' and select 'slaver' as the type.  Now order 'Izzy' to trade with the trader while still near the map border.  Once the trade dialog appears, select 'Phosphos' to sell.  Open the social tab for 'Unay' and hover over the opinion for 'Izzy' which should show both positive and negative modifiers.  Allowing the traders to approach the base seems to not produce the bug, but a trade order when they are at map edge seems to work reliably.  The second save file 'SlaveTestTwoSold' is post sale, and shows 'Unay' with both modifers.

Thanks for reading, hopefully this can be fixed.

gulegule

I was able to fix this by editing Thoughts_Situation_Social.xml to include the appropriate nullifyingPrecepts.

  <ThoughtDef>
    <defName>SoldPrisoner</defName>
    <thoughtClass>Thought_Tale</thoughtClass>
    <workerClass>ThoughtWorker_Tale</workerClass>
    <taleDef>SoldPrisoner</taleDef>
    <validWhileDespawned>true</validWhileDespawned>
    <nullifyingPrecepts>
      <li MayRequire="Ludeon.RimWorld.Ideology">Slavery_Abhorrent</li>
      <li MayRequire="Ludeon.RimWorld.Ideology">Slavery_Horrible</li>
      <li MayRequire="Ludeon.RimWorld.Ideology">Slavery_Disapproved</li>
      <li MayRequire="Ludeon.RimWorld.Ideology">Slavery_Acceptable</li>
      <li MayRequire="Ludeon.RimWorld.Ideology">Slavery_Honorable</li>
    </nullifyingPrecepts>
    <stages>
      <li>
        <label>sold prisoner to slavery</label>
        <baseOpinionOffset>-15</baseOpinionOffset>
      </li>
    </stages>
    <nullifyingTraits>
      <li>Psychopath</li>
    </nullifyingTraits>
    <nullifiedIfNotColonist>true</nullifiedIfNotColonist>
  </ThoughtDef>

Pheanox

Thanks for the bug report.  I was able to reproduce this in 1.3.3166.  I'll get this into the devs and have them review your own workaround and see if it is useful.  I appreciate you taking the time to make this bug very easy to reproduce and isolate.