[B19] More Monstergirls

Started by junchan, March 09, 2017, 02:10:26 PM

Previous topic - Next topic

junchan

@kaptain_kavern: no we're different people.  Nightinggale is just helping out with the patching because it's relevant to his mod.  I welcome any help you can provide though.

@BlueWinds, sorry about that, will try to put something together... i never even thought about the lite version.

kaptain_kavern

Ok. Thanks for the clarification.  ;)

So about patches; as the main difference between Lite and Normal version of ADS is that there is less "artificial organs" in the lite version. So I'm pretty sure you'll need to make a patch with just less "operations" for the lite version. Sorry, I can't be more precise without actually looking at the code.

As I've said, do not hesitate to pm me if needed but I'm sure you'll manage :)

junchan

#167
@kaptain_kavern: yeah I just finished the patch and I'm just about to post it on the first post.
@BlueWinds: see above line.

Now to actually do something for fun today...

Nightinggale

Quote from: kaptain_kavern on November 26, 2017, 02:46:19 PM
I'm willing to help anyone if I can but I'm a bit confused: are Nightinggale and junchan the same person? Or you're working both on the mod?
First Junchan asked for help on how to use ModCheck to patch in a way not covered by any of the examples for ModCheck. I replied to the best of my knowledge. After that Junchan apparently failed to get it to work.

Now I have decided to dig in and figure out what it takes to make it work. Making ADS patches is one of the intended goals of ModCheck, but if it's too complex for people to figure out, then it doesn't matter that it's technically possible. This mean right now I'm conducting research, which I plan to use as a step by step guide for writing ADS patches. It will fix the issue for MM at the same time, but that's mainly a bonus.

Quote from: kaptain_kavern on November 26, 2017, 02:46:19 PMI was proposing myself because I know ADS well and often help Spoonshortage.
It looks more like a technical issue related to how patching works rather than pure ADS knowledge. Right now it uses ParentName="SurgeryFleshAnimal", meaning it should be loaded after ADS. The mod loading order is ok for that, but due to how patching works in the game engine, it triggers before ADS. In other words the main issue right now seems to be to control when the patch files should trigger.

Quote from: kaptain_kavern on November 26, 2017, 02:46:19 PMI still have to try to play a bit with your ModCheck, Nightinggale. Looks promising, simple and effective plus you seem quite motivated; because of this your project is on my "next things to check" list.
I'm kinda of a slow-worker and I haven't finished to updates all my mods, though ^^
Sounds good, but why not put the patches into the mods while you are updating anyway  ;)
ModCheck - boost your patch loading times and include patchmods in your main mod.

junchan

@Nighitnggale.  Yes I failed to get it to work.  Part of it was due to tiredness and my own stupidity, true, but part of it wasn't.  I'm certain that what I had should have been functionally identical to the ADS patch i posted earlier, but MM was failing to allow me to even install a peg leg on one of the cowgirls.  Of course, my stupidity strikes again because it turns out that I deleted what I had so I can't even give it to you to look over.  I was going to try to use ModCheck to integrate the patch I currently have, which I know works, into MM tomorrow.  Looking it over, most of the patch calls on stuff that already exists in the main A Dog Said mod.  The things that aren't in that mod are the harpy wings and the associated surgeries and hediffs.  These are technically where the difficulty should have been, but I just failed at life yesterday and today.  (I took out the harpy beak because I noticed that the animal jaw does what I wanted to do and I didn't exactly want to go around reinventing the wheel here)

junchan

The original authors of the mod have updated the steam page and therefore the "Vanilla" version is no longer relevant.  Go play with the proper version of the mod instead and check out the new additions :D

Nightinggale

I managed to get it working and attached a patch file. It's mainly a template to tell how it's done and you will have to copy paste to get it working for all entries in all files.

Highlights:
<?xml version="1.0" encoding="utf-8"?>
<Patch>
<Operation Class="PatchOperationSequence">
<success>Always</success>
<operations>
<li Class="ModCheck.isModLoaded">
<modName>A Dog Said...</modName>
<yourMod>MoreMonstergirls B18 Vanilla</yourMod>
</li>
<li Class="ModCheck.loadOrder">
<modName>A Dog Said...</modName>
<yourMod>MoreMonstergirls B18 Vanilla</yourMod>
<errorOnFail>true</errorOnFail>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName = "BlackHarpy"]/recipes</xpath>
<value>
<li>InstallPegLegAnimal</li>
...
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs</xpath>
<value>
<RecipeDef ParentName="SurgeryFleshAnimal">
<defName>InstallSimpleProstheticWingHarpy</defName>
...

The idea here is that PatchOperationSequence has a list of operations and if one fails, the following will not be executed. It goes as follows:

  • isModLoaded
    Remain compatible with games without ADS
  • loadOrder
    Will fail if ADS is loaded after MM.
    errorOnFail will make it write an error to the log if this is the case.
  • add recipes to BlackHarpy
    "normal" patching and it will fail if BlackHarpy is not in the xml file
  • add stuff to defs
What should be noted here is that there is actually 3 checks for adding directly to defs. The reason is that the patch file is used each time an xml file in the defs dir is loaded.
ParentName="SurgeryFleshAnimal" makes use of ADS, which is why ADS needs to be loaded and loaded prior to MM. This is true for all xml files, including core, meaning it will trigger prior to ADS being loaded.

Patching BlackHarpy is essentially checking if BlackHarpy is present in the file. If not, then the sequence will stop here. The value list is just a bonus, which has to be done anyway. If it only needs to test if the path exist, then PatchOperationTest can be used instead of PatchOperationAdd.

If InstallSimpleProstheticWingHarpy is added prior to loading ADS, then an error is generated because SurgeryFleshAnimal is missing. This message is not really user readable. ModCheck.loadOrder will prevent reaching InstallSimpleProstheticWingHarpy  if that is the case and write
QuoteMod load order: "A Dog Said..." needs to be loaded before "MoreMonstergirls B18 Vanilla"
You can add the tag customMessageFail to ModCheck.loadOrder and then it will use the string you enter in that one instead.

Never use errorOnFail for the same filecheck more than one time. If you need to use ModCheck.loadOrder in more than one file and you check for the same mod, only use errorOnFail in one of them. If not, you will get an error message from each of them on failure.

While I only added InstallSimpleProstheticWingHarpy, the other additions to defs should be added afterwards, creating a long list in the sequence. This mean it will only have to check if one of them can be inserted into each xml file and once a suitable candidate is found, it installs all of them.

If you have multiple animals in one file, you can fill them into the sequence as well, but patching animals in two different xml files will require two patch files. There is one exception though. <success>Always</success> will make the sequence move on even if the add failed. This mean adding this to all animal patching except the last should work. While it in theory will make the game start a bit faster (not sure if anybody would be able to tell), if you care about startup time, add all the animals into one file and don't use <success>Always</success> on any of them. That will reduce the number of xPath tests, hence making the game start faster.

Most of this is general PatchOperation talk. I think I need to write a general PatchOperation guide. I know some exist, but they don't contain advanced combo stuff like this.

[attachment deleted by admin: too old]
ModCheck - boost your patch loading times and include patchmods in your main mod.

kaptain_kavern

@junchan

If it can help, here is a guide for making ADS animal patch. Be aware that it was written for A17, so some XPath have changed.

https://github.com/spoonshortage/A_Dog_Said/issues/1

Nightinggale

#173
Quote from: kaptain_kavern on November 26, 2017, 05:57:01 PM
@junchan

If it can help, here is a guide for making ADS animal patch. Be aware that it was written for A17, so some XPath have changed.

https://github.com/spoonshortage/A_Dog_Said/issues/1
There is already an ADS compatibility patch and it looks fine to me. I wrote about merging it into MM itself to avoid dealing with multiple patches.

<OperationClass="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName = "BlackHarpy"]/recipes</xpath>
<value>
<li>InstallPegLegAnimal</li>
<li>InstallSimpleProstheticLegAnimal</li>
<li>InstallBionicLegAnimal</li>
<li>InstallSpineAnimalSimple</li>
<li>InstallSpineAnimalBionic</li>
<li>InstallBionicEyeAnimal</li>
<li>InstallAnimalBrainStimulator</li>
<li>InstallBionicAnimalHeart</li>
<li>InstallBionicAnimalLung</li>
<li>InstallBionicAnimalLiver</li>
<li>InstallBionicAnimalKidney</li>
<li>InstallBionicAnimalStomach</li>
<li>InstallNoseAnimalSimple</li>
<li>InstallJawAnimalSimple</li>
<li>InstallJawAnimalBionic</li>
<li>CureInjuryBurnAnimal</li>
<li>CureInjuryCrushAnimal</li>
<li>CureInjuryCrackAnimal</li>
<li>CureInjuryCutAnimal</li>
<li>CureInjurySurgicalCutAnimal</li>
<li>CureInjuryScratchAnimal</li>
<li>CureInjuryBiteAnimal</li>
<li>CureInjuryStabAnimal</li>
<li>CureInjuryGunshotAnimal</li>
<li>CureInjuryShreddedAnimal</li>
<li>CureInjuryBruiseAnimal</li>
</value>
</Operation>

It takes one animal and installs all the recipes in one go instead of splitting up between recipes. Having a list of all recipes as a template and then delete the unneeded ones for each animal would be a good idea though, possibly with comments telling where each bodypart starts.

Your approach seem to group based on recipe rather than animal. I don't know if it's possible in B18, but if there is the choice, I would prefer grouping by animal. It makes it easier to see what can be done for each animal.

This makes me wonder how much work it would be to make ModCheck.AddGroup, which would be like PatchOperationAdd, except it has a list of xPath instead of just one. On execution it will then loop the xPaths and run PatchOperationAdd on each. Sounds useful if you need to add the same bodyparts to say 10 or 30 animals.
EDIT: research into this revealed that it's actually a bad idea and would be prone to make patches execute slower.
ModCheck - boost your patch loading times and include patchmods in your main mod.

BlueWinds

Quote from: junchan on November 26, 2017, 03:28:53 PM
@kaptain_kavern: yeah I just finished the patch and I'm just about to post it on the first post.
@BlueWinds: see above line.

Now to actually do something for fun today...

Thank you very much!

kaptain_kavern

#175
@Nightinggale

I just choose to patch recipeDef RecipesUsers because it was quicker that way (unless a mod has more animals than total recipes in ADS ;-) most of animal mods only add one animal.

Also by habits, prior to A17, there was no patching so we had to overwrite whole defs instead. With that logic in mind, it was better to use recipes users tag in a modded recipes rather than overwrite the compete animal Defs.

But I think we need to stop "polluting" junchan's thread ;-). We can discuss things more, there if it's OK with you

junchan

I'm sorry to say this but I will no longer be able to work on this.  I wish everyone well and I thank the people who took an interest in my take on wagon and I <3 Phil Fish's mod.

The latest version of everything is available here for people to do what they wish with.

https://www.dropbox.com/s/sr7eutx640ejlcq/rimworld%20monstergirl%20stuff.7z?dl=0

Sorry everyone.

junchan

After my dramatic post back in november about not being able to work on this, as well as almost 10 months of absence I just thought I'd post that I'm currently updating this for B19.  Work is in progress and at the time of writing, I have Cowgirl, Centaur and Dryad updated and working.  And by updated I mean that the XML is pretty much rewritten completely from scratch.  I should be posting at some point over the weekend.

I stopped working on this because I was having major life problems at the time and I was even hospitalised for a little while this year, so yeah, I wasn't in a good position at the time.

Well anyway, enough of that.  Expect an update soon.

Canute

Glad you made it back,
can we call you now Survivor-jun chan ? :-)

Yoonic

Hey, welcome back! I have already started to miss my hauling and cleaning girls. :D