Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - BrockLee

#1
So I've been trying to figure out how to get one item to apply a defmodextension to another item.

I'm working on a personal mod adding some new custom tents to the Camping Tent mod. My mod is piggybacking on the code of the said mod, and I want to have an air conditioner unit as a linkable facility that, placed adjacent to a tent, will apply (or possibly replace) the extension.

I've tried a couple of approaches, but they keep applying the extension to the linkable itself.

Any ideas would be appreciated 
#2
@ m1st4x    Well, my first use for this mod is going to be in an upcoming tribal playthrough I'm planning. I want to impose some extra restrictions and challenges, including a different butchering system. For example, instead of butchering a muffalo and getting ready-to-use leather and meat, I want "rough hides" and a significantly reduced amount of meat (due to unskilled and primitive butchering methods), as well as some animal tallow and bones.

Adding the hides, tallow, and bones isn't an issue since those values are exposed in XML, but the vanilla meat quantity per animal is hardcoded (and I can't do C#), so I'm left with trying to find workarounds.

I'm aware there are a number of mods already out there that do bones, fat, and hides, but they bring a lot of other things with them I don't want. Plus, I like to a least try my own approach to things first so I can learn, even though it does get a bit frustrating at times.

@ Canute    Thanks for the suggestions, and pointing me toward those two mods. I've used both of them in my mod list before, so I looked into their files. x kg corpses would have been interesting, but unless I missed it, VGP garden only shows that it requires 1 corpse for the compost recipe. Perhaps it's been changed.  The android printer has some kind code for nutrition, from what I can tell.
And you're certainly correct, it's C#...I hit the wrong key.

However, I think I found an option that's somewhat workable. Earlier today I kept scanning through the core .cs file and I finally found something useful for my purposes; ThingDefGenerator_Corpses, where I saw this- def.defName = "Corpse_" + thingDef.defName;

So I threw together a test recipe and it seems to work good, though it needs some refinement.

Here's a copy of the recipe in case anyone else is curious:


<RecipeDef>
    <defName>Butcher_AnimalSm</defName>
    <label>butcher small animal</label>
    <description>Use primitive methods to roughly butcher a small animal for some meat and hide parts.</description>
    <workerCounterClass>RecipeWorkerCounter_ButcherAnimals</workerCounterClass>
    <jobString>Butchering.</jobString>
    <workAmount>350</workAmount>
    <workSpeedStat>ButcheryFleshSpeed</workSpeedStat>
    <workSkill>Cooking</workSkill>
    <efficiencyStat>ButcheryFleshEfficiency</efficiencyStat>
    <effectWorking>ButcherFlesh</effectWorking>
    <soundWorking>Recipe_ButcherCorpseFlesh</soundWorking>
    <interruptIfIngredientIsRotting>true</interruptIfIngredientIsRotting>
    <uiIconThing>Meat_Muffalo</uiIconThing>
    <ingredients>
      <li>
<filter>
      <thingDefs>
          <li>Corpse_Hare</li>
          <li>Corpse_Snowhare</li>
          <li>Corpse_Raccoon</li>
          <li>Corpse_Capybara</li>
          <li>Corpse_Fox_Red</li>
          <li>Corpse_Fox_Arctic</li>
          <li>Corpse_Cat</li>
      </thingDefs>
</filter>
        <count>1</count>
      </li>
    </ingredients>
    <products>
      <RoughHide>1</RoughHide>
  <Meat_Cow>12</Meat_Cow>  <!-- TEMPORARY Change this later -->
  <Tallow>2</Tallow>
  <Bone>2</Bone>
    </products>
    <fixedIngredientFilter>
      <thingDefs>
          <li>Corpse_Hare</li>
          <li>Corpse_Snowhare</li>
          <li>Corpse_Raccoon</li>
          <li>Corpse_Capybara</li>
          <li>Corpse_Fox_Red</li>
          <li>Corpse_Fox_Arctic</li>
          <li>Corpse_Cat</li>
      </thingDefs>
      <specialFiltersToDisallow>
        <li>AllowRotten</li>
      </specialFiltersToDisallow>
    </fixedIngredientFilter>
    <defaultIngredientFilter>
      <thingDefs>
          <li>Corpse_Hare</li>
          <li>Corpse_Snowhare</li>
          <li>Corpse_Raccoon</li>
          <li>Corpse_Capybara</li>
          <li>Corpse_Fox_Red</li>
          <li>Corpse_Fox_Arctic</li>
          <li>Corpse_Cat</li>
      </thingDefs>
    </defaultIngredientFilter>
    <workSkill>Cooking</workSkill>
    <recipeUsers>
      <li>BM_PrimButcherTable</li>
    </recipeUsers>
  </RecipeDef>
#3
Help / Could I get a hand with Corpses, please?
May 07, 2021, 01:57:29 AM
Hi everyone, I've been a long-time lurker around the forums, and dabbled with modding Rimworld on and off for a while now. I've always tried to read through tutorials, search for answers on my own, and use the trial and error system. That being said, I've become a bit frustrated with my latest little project and I would appreciate some suggestions from you more experienced modders out there.

Essentially, I'm trying to break up, or rather, subdivide the AnimalCorpse category into three sub-categories; AnimalCorpseLg - AnimalCorpseMd - AnimalCorpseSm.

I've tried a couple of approaches without success. One using custom categories, and the other using tags.

Oh, and I have to stick with XML, as I'm not proficient with C+, so that might be the whole issue. I used DotPeek to poke through the files but still haven't come up with any new ideas.