[B18]DESurgeries - 06/12/17

Started by kaptain_kavern, July 24, 2016, 04:56:06 PM

Previous topic - Next topic

Do you want/need an A17 version?

Yes
No

Serenity

What's the benefit of the "cure cut" surgery? Just a time saver so it doesn't have to deal and no risk of scarring? I guess the HP of the body part will still be the same.

Tai

I'm not sure if this is a bug or a mod incompatibility or just how you have stuff tuned, but whenever I try to do any of the repair surgeries, in a well-lit hospital with plenty of medicine available, firstly my doctors seem to prefer Glitterworld medicine, then the worst medicine they can find. Then, if they -didn't- find Glitterworld medicine, it seems like they're pretty much guaranteed to fail the surgery - my doctors are Medicine 16 and 17, with 101% and 117% surgery success chance respectively, and they both failed to repair a colonist's pinky in quick succession in a well-lit hospital.

I'm guessing part of the problem might be the medicine search - when I debugged in some Glitterworld medicine, they used that fine and the surgery worked. But I've got good medicines nearby, and they're actively going further to take the bad stuff - and then using the good stuff to treat their mistakes.

I'm running a fairly hefty modlist, but far as I can tell the only things that might have incompatibilities are EPOE, ADogSaid, Combat Realism, and -maybe- Vegetable Garden given the extra medicines it adds?

kaptain_kavern

Hey thanks for the precise bug report8)

So precise that I already have an idea about what is going wrong. I will do some more test with the new Veg Garden and check my code. I may have specified to only search for vanilla Meds in the code.

kaptain_kavern

Yeah i see where things go wrong here.

In order to force the use of expensive/better medicine, I have set in the code that the hardest ones are forbid to use Herbal and normal medicine (in Vanilla that means only Glittertech one's or a "missing material message") but now if you put modded ones in the equation then my code is wrong and this should produce the kind of behaviour Tai was talking about. And as some of those surgeries are super hard to achieve, the less potent modded medicine having very low bonus, this ensure a failing.

Now I maybe can let pawn use any medicines at all for all surgeries but how can i be sure that people understand they will have to use the best possible medicine for hardest surgeries?

a.k.a : i'm on to something but still thinking how to settle this, but wanted to let you know about it
Again thanks for the precision of the bug report, Tai  ;D

ruzackovich

I'm running a fairly hefty modlist, but far as I can tell the only things that might have incompatibilities are EPOE, ADogSaid, Combat Realism, and -maybe- Vegetable Garden given the extra medicines it adds?
[/quote]
is it combat realism for a13, and stopped ? is it any combat realism  for a14 too..? if any can you share the link, please .. :P

kaptain_kavern

Check there, friend : https://github.com/skyarkhangel/CombatRealism/releases

I understand it can be hard to follow : ^^

Fisty

Any way to add Sleeping Sickness curing to this?  My husband tried but it didn't work..

kaptain_kavern

Hi Fisty,

I take note of it and will put that in the next update thx.


If you can convince your husband to try again ==> My advice : take the code for treating say, asthma (in DESurgeries/Defs/RecipeDefs/Recipes_Surgery.xml), copy/past it below and adapt it for treating Sleeping Sickness (all infection definitions/code are located in Core/Defs/HediffDefs/Hediffs_Local_Infections.xml). That's how I will do ;)

That's if you need it quick :p

Fisty


kaptain_kavern

I'm not at home ATM but I can try to provide example with dementia.
"Cure Dementia bit of code"
<RecipeDef ParentName="SurgeryVeryHard">
  <defName>CureChronicDementia</defName>
  <label>cure dementia (3 Glit. Med)</label>
  <description>Cure dementia.</description>
  <workerClass>Recipe_RemoveHediff</workerClass>
  <successfullyRemovedHediffMessage>{0} has successfully treated {1}'s dementia.</successfullyRemovedHediffMessage>
  <jobString>Curing dementia.</jobString>
  <ingredients>
    <li>
      <filter>
        <categories>
          <li>Medicine</li>
        </categories>
      </filter>
      <count>3</count>
    </li>
  </ingredients>
  <fixedIngredientFilter>
    <categories>
      <li>Medicine</li>
    </categories>
    <exceptedThingDefs>
      <li>HerbalMedicine</li>
      <li>Medicine</li>
    </exceptedThingDefs>
  </fixedIngredientFilter>
  <removesHediff>Dementia</removesHediff>
</RecipeDef>


Should become
<RecipeDef ParentName="SurgeryVeryHard">
  <defName>CureSleepingSickness</defName>
  <label>cure Sleeping Sickness (3 Glit. Med)</label>
  <description>Cure Sleeping Sickness.</description>
  <workerClass>Recipe_RemoveHediff</workerClass>
  <successfullyRemovedHediffMessage>{0} has successfully treated {1}'s Sleeping Sickness.</successfullyRemovedHediffMessage>
  <jobString>Curing Sleeping Sickness.</jobString>
  <ingredients>
    <li>
      <filter>
        <categories>
          <li>Medicine</li>
        </categories>
      </filter>
      <count>3</count>
    </li>
  </ingredients>
  <fixedIngredientFilter>
    <categories>
      <li>Medicine</li>
    </categories>
    <exceptedThingDefs>
      <li>HerbalMedicine</li>
      <li>Medicine</li>
    </exceptedThingDefs>
  </fixedIngredientFilter>
  <removesHediff>SleepingSickness</removesHediff>
</RecipeDef>

The most important being to label the <removesHediff> tag with the exact name (copy/paste) of the <label> tag in Core/Defs/HediffDefs/Hediffs_Local_Infections.xml

Maybe that can help : https://github.com/kaptain-kavern/DESurgeries/commit/03650a813c59796389b133881ce2ab6e874e914e

Like I said I can test it now, but when i'll get home I will start by just copy/paste from here ;)

Darcclan

Herro Kapt

This is the code I added to your surgeries xml right underneath dementia. Even with this her pawns still weren't showing the surgery for the sleeping sickness at the time, only the removal of scars they had. (showing both the dementia first and mine for reference)


             <!-- Very Hard Surgery -->
    <!-- Chronic: Dementia -->
<RecipeDef ParentName="SurgeryVeryHard">
  <defName>CureChronicDementia</defName>
  <label>cure dementia (3 Glit. Med)</label>
  <description>Cure dementia.</description>
  <workerClass>Recipe_RemoveHediff</workerClass>
  <successfullyRemovedHediffMessage>{0} has successfully treated {1}'s dementia.</successfullyRemovedHediffMessage>
  <jobString>Curing dementia.</jobString>
  <ingredients>
    <li>
      <filter>
        <categories>
          <li>Medicine</li>
        </categories>
      </filter>
      <count>3</count>
    </li>
  </ingredients>
  <fixedIngredientFilter>
    <categories>
      <li>Medicine</li>
    </categories>
    <exceptedThingDefs>
      <li>HerbalMedicine</li>
      <li>Medicine</li>
    </exceptedThingDefs>
  </fixedIngredientFilter>
  <removesHediff>Dementia</removesHediff>
</RecipeDef>

   <!-- Cure Sleeping Sickness -->
<RecipeDef ParentName="SurgeryVeryHard">
  <defName>CureSleepingSickness</defName>
  <label>cure sleeping sickness (3 Glit. Med)</label>
  <description>Cure sleeping sickness.</description>
  <workerClass>Recipe_RemoveHediff</workerClass>
  <successfullyRemovedHediffMessage>{0} has successfully treated {1}'s sleeping sickness.</successfullyRemovedHediffMessage>
  <jobString>Curing sleeping sickness.</jobString>
  <ingredients>
    <li>
      <filter>
        <categories>
          <li>Medicine</li>
        </categories>
      </filter>
      <count>3</count>
    </li>
  </ingredients>
  <fixedIngredientFilter>
    <categories>
      <li>Medicine</li>
    </categories>
    <exceptedThingDefs>
      <li>HerbalMedicine</li>
      <li>Medicine</li>
    </exceptedThingDefs>
  </fixedIngredientFilter>
  <removesHediff>SleepingSickness</removesHediff>
</RecipeDef>

kaptain_kavern

Oh I think I've got it. Have you tried to see if it shows after creating a new world ?

Because to me you have write it good ...

Fisty

Nope, haven't tried a new world yet.. will have to wait until later, we haven't slept yet.  =)
Thanks for the help!

Fisty

Tried with a new world..  failing to actually test it though 'cause I can give a pawn the sleeping sickness but it's just showing up as hidden in the health tab.

kaptain_kavern

You can use "dev mode" (or dev tool i'm not sure how it is write) and the option to "Add Hediff" and then "HediffWithComp"