Ludeon Forums

RimWorld => Releases => Mods => Outdated => Topic started by: XeoNovaDan on July 17, 2017, 08:04:03 PM

Title: [A17] Animal Armour Mod v1.1 (19/07/2017)
Post by: XeoNovaDan on July 17, 2017, 08:04:03 PM
(http://i.imgur.com/rd1wBHU.png)

Overview
As the title very much states, this mod adds armour for animals to RimWorld!

Disclaimers: the armour works through Hediffs, and it has to be installed via surgery since that's the only XML-friendly way of actually making this mod happen - but there is an absence of the requirement for medicine, and the surgery success chance multiplier is 'Infinity', meaning that it's impossible to fail installing armour on an animal. Similarly, animals will still be anaesthetised since that's hardcoded in the surgery code, and I'm not a C# wizard so I can't write custom stuff. Also, the installation of animal armour will completely reset the animal's health for the rest of the body; this is most likely to do with the fact that the body is the main body part, so every sub-part gets reset. Since I've not got the skills yet to rectify some of the outstanding issues, consider this project deprecated.

Animal Armour adds three 'tiers' of animal armour to the game: makeshift, standard, and heavy. Similarly, these armour types are all split into five size categories: tiny, small, medium, large, and huge.

The only means of obtaining standard and heavy animal armour of any size is through trade, but makeshift armour however may be crafted. The further up the sizes you go, the more expensive the items are to purchase - or manufacture in the case of makeshift armour. All size categories are functionally identical, however, other than the animals that they be installed on. Furthermore, what size category an animal fits into depends on its body size as an adult since again, I'm no C# wizard.

Naturally, the ability to be able to handle animals plays a role as to the maximum size category that you can install armour on to; it won't take much to armour up on a small critter, but it'll take quite a lot more skill to armour up a lumbering beast. Fine craftsmanship is also necessary to make small animal armour, but also to make large animal armour that won't simply fall apart.

To remove armour from an animal, you need to make an 'animal armour remover' at a crafting spot - this being because the hediff remover class is hardcoded to require medicine. Armour can also be removed by installing another type of armour.

Armour Types
Makeshift: 20% sharp protection, 8% blunt protection, -5% movement.
Standard: 27.5% sharp protection, 11% blunt protection, no movement penalty.
Heavy: 60% sharp protection, 20% blunt protection, -20% movement.

Size Category Info
Tiny: fits on animals with a mature body size of less than 0.3. Examples: cats, iguanas, and squirrels.
Small: fits on animals with a mature body size of 0.3 or greater, but less than 0.8. Examples: tortoises, monkeys, and foxes.
Medium: fits on animals with a mature body size of 0.8 or greater, but less than 1.3. Examples: wolves, huskies, and boars.
Large: fits on animals with a mature body size of 1.3 or greater, up to 2.4. Examples: muffalo, boomalopes, and bears.
Huge: fits on animals with a mature body size of greater than 2.4. Animals: Rhinoceroses, Elephants, Megatheria, and Thrumbos.

I'd much appreciate some feedback on the market value balance too, since I'm currently a little uncertain about how everything's balanced in regards to that. It was a bit of a headache producing a formula which got sensible results for market values at various size points, and I even ended up slightly deriving from what the formula provided.

Compatibility
This mod will work fine with spoonshortage's A Dog Said. While this mod will also work with Combat Extended; it's not balanced around Combat Extended's changes to the armour system and protection values of certain armour types.

Animal mods currently made compatible with Animal Armour:
Dinosauria (https://ludeon.com/forums/index.php?topic=35678.0) by spincrus
Megafauna (https://ludeon.com/forums/index.php?topic=34432.0) by Spino

As for compatibility with other animal mods, I'm not going to be taking responsibility for making patches; it'll be up to other animal mods' authors to make a patch for their mods with this.

Credits
Marnador for the RimWorld style font
Canute and rambo for the ideas around armour removal

Downloads
GitHub (https://github.com/XeoNovaDan/AnimalArmour/releases/tag/v1.1)
Steam (http://steamcommunity.com/sharedfiles/filedetails/?id=1078967086)

License
You may include this mod in any mod pack, and you may derive from this mod too. I only ask that you inform me, and that you also provide a link to this forum post, with my name.

Thank you :)
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017) - Now on Steam
Post by: XeoNovaDan on July 17, 2017, 08:13:40 PM
Mod's now on Steam!
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017) - Now on Steam
Post by: RazorHed on July 17, 2017, 09:38:27 PM
Cool I was thinking about doing something similar a while back , and the surgery was the only way I could see it working. Didn't get it working though . Well done.
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017) - Now on Steam
Post by: moonra on July 18, 2017, 05:00:55 AM
Oh lord, armored tortoises, poor raiders.
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017) - Now on Steam
Post by: XeoNovaDan on July 18, 2017, 05:53:45 AM
Yeah, it did involve a bit of XML sorcery to hack this one together. I'm curious to see if this will end up as the base of something executed in a more elegant way.
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017)
Post by: Soupy Delicious on July 18, 2017, 07:06:31 AM
aaahahahah I love it.
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017)
Post by: Katarumi on July 18, 2017, 07:10:38 AM
Strangely, I can't seem to find this mod via the Steam search functions; I could only see it via direct link or going directly to your workshop. Is that intentional?

This looks amazingly useful, by the way! Can't wait to try it out on my wargs.
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017)
Post by: XeoNovaDan on July 18, 2017, 07:16:12 AM
@Katarumi
Yeah, it has to be 'Armour' in the search query; not 'Armor'. It's hard being British in a community that's mostly not British to my knowledge :P
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017)
Post by: rambo on July 18, 2017, 07:31:46 AM
cool mod but still needs some work (like remove armor and stuff)
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017)
Post by: XeoNovaDan on July 18, 2017, 07:45:53 AM
@rambo
Yes, that would be nice if armour really was removable. However, I don't believe it's possible to remove hediffs from the main body since you'd technically be removing the body itself... However, now that you mention it and I've just thought on it a little, it may be possible to actually do something... but then the pawn would probably die since you're technically removing the torso.

I can't write custom stuff as my programming knowledge in C# is basically null and void, so that's off the table unless somebody else was to do so.

Edit: Hmm, it doesn't look like it will be possible with just XML. I've looked at the def for the 'Excise Carcinoma' recipe, it looks like it only removes the hediff, so I don't think it will actually give any items back.
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017)
Post by: rambo on July 18, 2017, 08:04:57 AM
thanks ;D
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017)
Post by: Canute on July 18, 2017, 08:14:42 AM
about remove armor.
Why not create a no armor armor, no material, low work ?
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017)
Post by: XeoNovaDan on July 18, 2017, 08:16:45 AM
@Canute
I could do that. It'll be an extremely hacky way of doing so, but it's worth a shot. I'm currently working on something else, but I'll come back to this soon.
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017)
Post by: Katarumi on July 18, 2017, 08:45:52 AM
Quote from: XeoNovaDan on July 18, 2017, 07:16:12 AM
@Katarumi
Yeah, it has to be 'Armour' in the search query; not 'Armor'. It's hard being British in a community that's mostly not British to my knowledge :P

Whoops! I can't read, apparently, haha. Sorry for the confusion!
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017)
Post by: rambo on July 18, 2017, 11:48:22 AM
the armour surgery thing doesnt work for my huskies and i tried every type of "Armour"
Title: Re: [A17] Animal Armour Mod v1.0 (18/07/2017)
Post by: XeoNovaDan on July 18, 2017, 12:03:17 PM
@Rambo
Just tried reproducing this in my test map, it seems I may have made another oversight somewhere; I spawned in a husky, there isn't a recipe to install makeshift armour when I put makeshift armour on the map. However, when I place standard armour, there's a recipe for both standard and makeshift. I must've made a mistake somewhere in the RecipeDefs.

Thanks for pointing this out, and I'll get to it straight away :)

Edited (again): Yup. Quite a major oversight actually. Will address this in v1.1 soon-ish. I'll also look into body part removal, so this could take a little while.
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017) - Removable Armour
Post by: XeoNovaDan on July 19, 2017, 12:15:38 PM
Updated to v1.1! (19/07/2017)

Changes:
- Animal armour is now removable.
- New item 'animal armour remover' required to remove armour from an animal
- There's now one hediff for each size of each armour type; armoured animals on existing saves should have the 'medium' size hediffs.

A bit of a story actually: It was somewhat of an ordeal to get armour removal working at all. I tried basing a recipeDef off of the Recipe_RemoveHediff class (same class that 'excise carcinoma' uses), but part of that class is actually hardcoded to require medicine. Instead of making armour removal require medicine, I had to instead ultimately go down adding a new item to remove armour. Credit goes to Canute for the item suggestion, and rambo for the original suggestion.
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017) - Removable Armour
Post by: Swat_Raptor on July 19, 2017, 03:57:08 PM
Now I might actually care about raising animals again.

I can let my armored tortoises roam free knowing that if a warg starts attacking, it will take them a long time for them to do a considerable amount of dmg, now I can send hunters out without fear because hungry predators will probably target the smaller armored animal.
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017) - Removable Armour
Post by: Spino on July 20, 2017, 10:38:35 AM
Very cool mod! From what I've seen, making a compatibility patch for Animal Armour shouldn't be too hard either, unless I'm horribly wrong and just haven't realised it yet.
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017) - Removable Armour
Post by: XeoNovaDan on July 20, 2017, 10:48:30 AM
@Spino Patch making should be very straightforward. The single patch XML has size guidelines too.
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017) - Removable Armour
Post by: Canute on July 20, 2017, 11:50:34 AM
I am not a big fan of compatibility patch and i notice the armor currently don't work for other then vanila animals.

But can't you do it like Anglewyrm did at the Mines mod, scan for all animals on game start and made auto. patches for them ?
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017) - Removable Armour
Post by: XeoNovaDan on July 20, 2017, 11:56:30 AM
@Canute I barely know basic C#, let alone enough to do something like that. Unless there's a way to do it with XML, maybe PatchOperationSequence w/ Test?
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017)
Post by: Dragoon on July 22, 2017, 12:17:10 AM
yey War Doggy.
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017)
Post by: Celestial on July 24, 2017, 08:13:09 AM
Whenever the animal armour remove appears in the scenario editor, it is -214........ some reason there's an integer overflow. I'm thinking if it's because of the market value 0. I changed it to 1 and I've gotten proper numbers. I'm not sure what would happen If i started a game with the negatives, never tried
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017)
Post by: Spino on July 24, 2017, 01:31:40 PM
Just wanted to say that you were right, making a patch for AA was really easy - did one today for my animal mod!
Solid job on this one, man!
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017)
Post by: XeoNovaDan on July 24, 2017, 01:47:01 PM
Thank you! I'll be sure to add a list of mods that have been patched to work with this.

May the march of the armoured megabeasts begin!
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017)
Post by: Bonesmasha on August 07, 2017, 02:42:04 PM
I'm getting the message in the context menu that my level is too low, even though my doctor is level 20. It only happens with medium armor and above, I can install tiny and small armor on animals below 0.8 size.

Any suggestions ?
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017)
Post by: XeoNovaDan on August 07, 2017, 02:53:41 PM
How good is your doctor's handling skill? If he can manage small armour, he must be a 4 or 5. Animal armour installation is based on animal skill level, not medicine.
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017)
Post by: Bonesmasha on August 08, 2017, 02:49:35 AM
So it's based on the handling skill. Gotcha' . The issue was that I have the Quality Doctor mod which forces any operations to be done by the most skilled doctor, so I couldn't force my animal handler to do it, I had to get the work priorities of everybody out from the work tab and only leave my animal handler for it. Not a big deal.

Great mod btw. I think animals should be more exploited, I'm planning on doing full armored bionic squirrel army with scyther blades installed on their tails :D.

Thanks for the response !
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017)
Post by: XeoNovaDan on August 08, 2017, 05:27:52 AM
@Bonesmasha No problem! Be sure to install the armour first because of how torso replacing works. If you did bionics then armour, you'd lose the bionics.
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017)
Post by: CruelBanana on August 08, 2017, 09:19:20 AM
Will the armor be wisible at some point? It's more of a cosmetic issue to me, but I suppose it may also get confusing who you need to get armour for if you have about 50 animals (yes, I lag a lot).
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017)
Post by: XeoNovaDan on August 08, 2017, 09:23:47 AM
@CruelBanana This project has been abandoned by me anyway, and will cease to get further updates. I wouldn't be able to unless I manage to write some actual C# code that displays a sprite when an animal has a certain hediff, which I can't do.
Title: Re: [A17] Animal Armour Mod v1.1 (19/07/2017)
Post by: fong on October 21, 2017, 08:45:41 AM
 I've an idea about animal's attacking weapons,
just like animal armor wearing on animal,
but normally is melee and shape weapon! :P

I don't know possible for you to create this mod,
but I'll keeping ask anyone who could do it,
and it'll be an one of the "hit mod"! I think,

because of many people like play with an animal farm,
and it's actually much fun and helpful !  ;D :) :D

   Thank you for this mod anyway.
      Good luck, and Bless!