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 - SihvMan

#61
Hey, did you know you can make your own tab for research?

You'd have one file with
<Defs>

<ResearchTabDef>
<defName>VegGar</defName>
<label>Vegetable Garden</label>
</ResearchTabDef>

</Defs>


And add

<tab>VegGar</tab>

under your ResearchProjectDef(s).

This puts all of your research under it's own tab, so you don't have to compete w/ other mods for space on the tree.
#62
Quote from: Anonemous2 on May 21, 2017, 10:44:52 AM
Quote from: SihvMan on May 20, 2017, 10:30:52 PM
Hey Anonemous2!

With A17, there's now a better way to add the linked facilities.

You can make a [Patches] folder in the top level of your mod folder and add and xml with xpath PatchOperations, like so;

-Snip-

This allows you to delete the research bench and bed defs from your ThingDefs, yet still have the facilities link.

This makes your mod then compatible with anything that also modifies those two def.

If you're interested, I can also whip up some patches for other furniture mods as they are updated to A17, and make them in such a way as to have them activate dynamically, based upon which ones are loaded.

AWESOME  ;D

Here; have a better version of the patch code. This one has some checks to keep it working even if another mod completely overrides/butchers the base code, as well as dynamic patches for the beds from cuproPanda's Powerless and Rimrue's Tribal Essentials.

[attachment deleted by admin due to age]
#63
Help / Re: A17; changes
May 22, 2017, 07:45:09 AM
Something to note, having made a half dozen patches recently. This might be a "no duh" for some, but I'll include it for completeness' sake.

When patching using the <Patch> method, you cannot patch to an Base/Abstract. The way RimWorld loads mods makes it load Abstract->Def->Patch, such that the inheritors receive the un-patched abstract.

That being said, you can patch Defs that have inherited abstracts, as though the stuff in the abstract is actually in the inheritor's Def. Ex: If the abstract has <comps>, but the inheritor does not, a patch's <xpath> can be
<xpath>//ThingDef[defName = "InheritorDef"]/comps</xpath>
but not
<xpath>//ThingDef[defName = "AbstractDef"]/comps</xpath>

Also, when patching to <comps> you can patch to specific comps with
<xpath>//ThingDef[defName = "ExampleDef"]/comps/li[@Class="CompProperties_ExampleProperty"]</xpath>

This can used in the place of li(#) if you're patching multiple things with similar comps, in case the comp being patched is in multiple Defs at different list #'s (fringe case, but was useful when I made the patch for Anonemous2's MoreFurniture).
#64
Quote from: kaptain_kavern on May 21, 2017, 08:14:33 PM

UPDATE

Craftable Molotov Cocktails and Thrumbo Wool are now using the new PatchOperation method introduced in A17.
___________________________________

- Ok Kap ... But what does that mean?
- Well ... simply put it "just" means that, now, those mods are also compatible with other mods that are modifying the same "game object". When all modders will use this method, mods will be nearly all compatible.
___________________________________
Also this was my first try at the new method and, as a modder, I can tell you it's promising, modders can now doing things that were requiring C# knowledge (which I lack  ::) )

I wanna thank SihvMan for pointing me to some infos about that. And also thanks to Zorba and Zhentar for explaining to us

Oh, so this is what you were asking for!

Patch code looks good.
#65
Releases / Re: [A16] More Monstergirls
May 22, 2017, 05:39:42 AM
Quote from: Fregrant on May 21, 2017, 11:28:03 PM
Names like "Thrumbogirl, male" looks weird. Not sure how to fix though, we dont need two separate races etc.

Code from the AnimalKindDef of the Ibex could be a solution.


<labelMale>ibex ram</labelMale>
<labelFemale>ibex doe</labelFemale>


So it could be

<labelMale>thrumboBoy</labelMale>
<labelFemale>thrumboGirl</labelFemale>
#66
Quote from: XeoNovaDan on May 21, 2017, 10:16:58 AM
I swear to god you're a lifesaver. Thanks!
Always the trivial mistakes :P

lol. No problem. Happens to the best of us.
#67
Hello again, XeoNovaDan!

Check your spelling. You wrote Operaton instead of Operation in all areas where the error message kicked in.

Quote from: XeoNovaDan on May 21, 2017, 08:51:30 AM
--Snip--

<?xml version="1.0" encoding="utf-8"?>
<Patch>

<!-- ========== GrenadierBase ========== -->

<Operation Class="PatchOperationSequence">
  <success>Always</success>
  <operations>
    <li Class="PatchOperationTest">
      <xpath>//PawnKindDef[@Name = "GrenadierBase"]</xpath>
      <success>Invert</success>
    </li>
    <li Class="PatchOperatonReplace">  <=====================Operation, not Operaton
      <xpath>//PawnKindDef[@Name = "GrenadierBase"]/apparelMoney/min</xpath>
      <value>
        <min>875</min>
      </value>
    </li>
    <li Class="PatchOperatonReplace">  <=====================Operation, not Operaton
      <xpath>//PawnKindDef[@Name = "GrenadierBase"]/apparelMoney/max</xpath>
      <value>
        <max>1600</max>
      </value>
    </li>
  </operations>
</Operation>

</Patch>

--Snip--

<Operation Class="PatchOperatonReplace"> <=====================Operation, not Operaton
  <xpath>//PawnKindDef[@Name = "GrenadierBase"]/apparelMoney/min</xpath>
  <value>
    <min>875</min>
  </value>
</Operation>
<Operation Class="PatchOperatonReplace"> <=====================Operation, not Operaton
  <xpath>//PawnKindDef[@Name = "GrenadierBase"]/apparelMoney/max</xpath>
  <value>
    <max>1600</max>
  </value>
</Operation>

--Snip--

With the spelling fixed, the patch loaded successfully on my end.
#68
Mods / Re: Help needed with modding butchering.
May 21, 2017, 09:25:20 AM
Quote from: jamaicancastle on May 21, 2017, 05:43:38 AM
--Snip--

The documentation in this thread implies that if the xpath matches multiple nodes, it will change all of them, but I can't verify this. Have you tried a path that would match all animals? If I'm reading the xpath document correctly (always a dubious idea), this should grab any ThingDef inheriting from AnimalThingBase:
<xpath>//ThingDef[@ParentName = "AnimalThingBase"]/label</xpath>

(An aside: the /label is only needed because it's using PatchOperationInsert, which adds a sibling to the selected node(s). If you use PatchOperationAdd, which adds a child instead, you'll want to leave that part off. Practically, the two should work the same way... unless one of the ThingDefs you're chasing doesn't have a label for whatever reason - which would be odd, but not impossible.)

(A second aside: If for whatever reason (multiple mods would be my guess) this code ends up running on a def that already has a ButcherProducts node, I believe it ends up with two. I have no idea how the code handles that case - it might produce both sets of products, or only one.)

You can add to multiple nodes, if they're all in the same ThingDef (but not ThingDefs, which is different). This applies to things like the (li) node (which you can have multiple of because it denotes a single sub-node on a list). I generally use Insert instead of Add because it avoids issues like this and gives greater accuracy with where your patched node will end up.

Now, the case you gave might work with modifying the AnimalThingBase, though it would make ALL animals drop that product in exactly equal amounts. With the example given, it would mean squirrels would drop the same number of bones as Thrumbos. Not very accurate.

If the code already has a butcherProducts, it will kick up an error about multiple same nodes and fail to load the Patch. If this occurs, you would instead Add a node under <xpath>//ThingDef[@ParentName = "AnimalThingBase"]/butcherProducts</xpath>.

If you wanted to design around this, you'd have to increase the complexity of your patch, as follows;


<Patch>

<Operation Class="PatchOperationSequence">
  <success>Always</success>
  <operations>
    <li Class="PatchOperationTest">
      <xpath>//ThingDef[defName = "AnimalThingBase"]/butcherProducts</xpath>
      <success>Invert</success>
    </li>
    <li Class="PatchOperationAdd">
      <xpath>//ThingDef[defName = "AnimalThingBase"]</xpath>
      <value>
        <butcherProducts>
        </butcherProducts>
      </value>
    </li>
  </operations>
</Operation>

<Operation Class="PatchOperationAdd">
      <xpath>//ThingDef[defName = "AnimalThingBase"]/butcherProducts</xpath>
      <value>
        <**butcherProductDef>**Amount</**butcherProductDef>
      </value>
</Operation>


The first Operation checks if there is a butcherProducts node, and adds one if (and only if) there is not. The second Operation (which MUST go second) adds your product as an item on the list under the butcherProducts node. This makes it compatible in cases where other mods patch the same Def in a similar manner.
#69
Quote from: nihel on May 18, 2017, 03:06:14 PM
I've played a bit with your mod adding structures. Now i have a problem with loading map. I left window blueprint on the ground when i was quitting a game and it seems to be a problem.
Here's log:


Could not load reference to Verse.ThingDef named UtilityWindows_Blueprint
Verse.Log:Error(String)
Verse.ScribeExtractor:DefFromNode(XmlNode)
Verse.Scribe_Defs:LookDef(ThingDef&, String)
Verse.Thing:ExposeData()
Verse.ThingWithComps:ExposeData()
RimWorld.Blueprint_Build:ExposeData()
Verse.ScribeExtractor:SaveableFromNode(XmlNode, Object[])
Verse.Scribe_Collections:LookList(List`1&, Boolean, String, LookMode, Object[])
Verse.Scribe_Collections:LookList(List`1&, String, LookMode, Object[])
Verse.Map:ExposeData()
Verse.ScribeExtractor:SaveableFromNode(XmlNode, Object[])
Verse.Scribe_Collections:LookList(List`1&, Boolean, String, LookMode, Object[])
Verse.Scribe_Collections:LookList(List`1&, String, LookMode, Object[])
Verse.Game:LoadGame()
Verse.SavedGameLoader:LoadGameFromSaveFile(String)
Verse.Root_Play:<Start>m__734()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__731()

There is a way to fix it or am i screwed?

There was a similar bug about 3 or so pages back. To fix, go to where ever you store your saves. Back up the most recent save, then open it with Notepad++ [or equivalent text editor]. Search for all instances of

UtilityWindows_Blueprint

and

UtilityWindows_Frame

and delete them.

This will remove the unload-able parts of the save. Something about the blueprints iss screwed up. In the future, just don't save/exit while there's a Clutter Blueprint set down and you'll be fine.
#70
Mods / Re: Help needed with modding butchering.
May 21, 2017, 02:35:28 AM
Quote from: faltonico on May 20, 2017, 09:51:49 PM
@SihvMan
Regarding patches and that example...
for each animal a new line of <xpath>? or do we have to repeat the whole patch for each animal?

So far, you need to do a new <Operation Class="PatchOperationInsert"> for each animal. If anyone knows otherwise, I'd really like to know, because 30+ operations was horrible to write out.
#71
Quote from: Rimrue on May 21, 2017, 01:26:42 AM
Ah, thanks, Sihvman. I couldn't figure out how my mod could affect cotton! I didn't touch those defs at all!

No prob. Common mistake.
#72
Quote from: kb420 on May 21, 2017, 01:15:12 AM
i used the essentials pack, with the vegetable garden mod the cotton changes to cotton fiber so that you have to craft cloth from it.

That's just Veg Garden working as intended. You'll need to research Complex Clothing (or something like that), then build a Tailor Loom. You can turn cotton fibre into cotton cloth there.
#73
Quote from: Hatti on May 02, 2017, 07:08:51 PM
Some mods are already available for the A17 development branch! have fun

Yay QualityBuilder!
#74
For those using the RTG mod, I can confirm that the mod works in A17 if you just change the About.xml to version 17.0
#75
Quote from: kaptain_kavern on May 20, 2017, 11:08:18 PM
Hi SihvMan,

Excuse me for "hijacking" this conversation but can you please point me to some docs or references for this "new method" you just explained?
I'm an "old" modder who have missed a couple of alphas...  ;)

Thank you in advance



PS: I found some infos, good ol' Zenthar provide some infos here ; https://ludeon.com/forums/index.php?topic=32181

Not a problem. The post you linked has most of the current guides and tips that any of us know on patching. For current (working) applications, check out the code I posted above (which I'm using for a modified local copy of A17 More Furniture), the Patch folder of my Bone Mod [https://ludeon.com/forums/index.php?topic=32560.0], and the thread between me and XeoNovaDan [https://ludeon.com/forums/index.php?topic=32645.0].

You can also PM me if you have any questions. I love your Thrumbo Wool mod. Keep up the good work.