Trader/Visitor error (Medicine)

Started by sefin_88, August 07, 2016, 09:06:23 AM

Previous topic - Next topic

sefin_88

I regularly get this error when a Visitor, Trader, Caravan, or Orbital trader arrives.  It occurs with Glitterworld Meds, Regular Meds and Herbal Meds.  I can't seem to narrow down whats wrong.  I use a lot of mods and I'm guessing something is messing with the way traders spawn in meds to sell.

Any help would be appreciated.

[attachment deleted by admin - too old]

1000101

Check each of the mods you use for TraderKindDefs.

Look at those defs and see if they reference Medicine.  Once you find that out then you can start tracing where the problem lies.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

sefin_88

I know there is a valid reason for:

<li Class="StockGenerator_SingleDef">
        <thingDef>GlitterworldMedicine</thingDef>
        <countRange>
          <min>-30</min>
          <max>20</max>
        </countRange>
      </li>


Any reason why a stock would be set to a negative number for a minimum?

CallMeDio

I suppose that it is because the stock get generated in this range between min and max and when the random generated stock number falls on a negative they buy the item but have none to sell you.
The cause of the problem is something else as there are a lot of negatives in the game default TraderKindDefs and it always work, keep looking inside the mods for anything with medicine inside the mod's TraderKindDefs folder
QuoteYou may need a rubber duck.  Also, try some caveman debugging.

Released mods: No Mood Loss on Prisoner Sold or Died

sefin_88

I think I'm on the right track.  If a script is written to generate stock category - medicine.  Then its also scripted to generate a specific medicine.  It wont generate twice, will it?  Thus giving the error?  If that 'is' the case then it either needs to be a specific category or a specific item; but not both.    Thoughts?

CallMeDio

Nope, just did that to my files to check and no error. I recommend doing this:
1-look inside all your mods and take note of the name of all the mods who have TraderKindDefs folder inside
2- open rimworld let activated only 1 of this mods you took note of, load the save, enable dev tools on options menu, click on the left gear icon of the white dev buttons above the screen and click replace all traders button(or something like that)
3- if you get the error you found the problematic mod, post a .zip of it here so we can see, if you don't get the error exit to main menu turn off the mod you had on and activate another of the ones you took note that contain the folder and repeat the process until you get the error with only one mod that contain the TraderKindDefs folder activated, so you will know exactly what mod it is.
QuoteYou may need a rubber duck.  Also, try some caveman debugging.

Released mods: No Mood Loss on Prisoner Sold or Died

sefin_88

Thanks for the help.  I will definitely try this.  Ill leaving on a trip tomorrow but ill post as soon as I narrow it down.