[1.0 - 1.1] Genetic Rim - Combine animals to create new hybrids - v5.05

Started by SargBjornson, August 17, 2017, 06:12:08 AM

Previous topic - Next topic

Okam

Quote from: SargBjornson on November 23, 2017, 10:39:43 AM
Done! The mod now has native support for A Dog Said and Animal Collab Project. The patches that add new creatures will probably still need a new mod, due to all the intricate inter-dependencies, but those two have been fast and easy using Nightinggale's mod!
that's so niceeeeeeeeee! thanks m8

but, can i update this mod and mod check in a existing game?

SargBjornson

As far as I know, they are independent. My mod uses the DLL version of modcheck, so if you have the mod version of modcheck there should be no problems!

Okam

Quote from: SargBjornson on November 26, 2017, 10:57:58 AM
As far as I know, they are independent. My mod uses the DLL version of modcheck, so if you have the mod version of modcheck there should be no problems!

Okay! thanks <3

Albion

Hey Sarg, first up: you have a small spelling error. Your research tab is labeled "Genetic Resea(r)ch". You might want to fix that.

Secondly: I created a patch in my mod so creatures in your mod now produce a new substance called neutroglycerin instead of boring chemfuel. At least the ones mixed with Boomalope DNA. However I came across the Muffalope which has GR_MuffalopeMilk as the milkable substance and the chemfuel production in a different comp.
Will this stay this way or are you changing this in the future? I guess having 2 different CompProperties_Milkable in one create is impossible but I didn't try it.
Would it be possible for you to switch the GR_MuffalopeMilk to the AnimalProduct comp and the chemfuel to the Milkable comp? If you would do that I could just replace the <milkDef> and be done with my patch. Replacing the <resourceDef> of the AnimalProduct comp will result in a problem with the displayed text since your custom code checks for the <resourceDef> in the 'CompInspectStringExtra' function to decide what to display, which would be null for a resource it doesn't expect.
Switching the resources also shouldn't result in errors and therefore won't break any savegames.

SargBjornson

Hi Albion!

Oh yeah! I did that because I'm not sure if two CompProperties_Milkable in teh same creature will work properly. I can change it in the next update with minimal problems. Might take a week or so, though, since I'm planning on something quite big ;)

Albion

Much appreciated.
I guess switching the resourceDefs is the best and easiest way without breaking saves. However you could test if it is possible for a creature to have 2 Milkable comps and maybe change it with the transition to the release of beta 19 (in 6 months or so  :D ).

kubolek01

Quote from: SargBjornson on December 01, 2017, 04:04:46 AM
Hi Albion!

Oh yeah! I did that because I'm not sure if two CompProperties_Milkable in teh same creature will work properly. I can change it in the next update with minimal problems. Might take a week or so, though, since I'm planning on something quite big ;)
EVEN bigger than your 2nd form you show here? ;)
Eat lead, walking pile of silver! (greedy Player)
I...I can't do it. Leave it alive, please!(inner soul)
It lives 200 years to end up as a jacket?!(realists mind)
If I would go to vacation in off-Earth, even fictional place, I'd choose Nibel.

Canute

Quoteif it is possible for a creature to have 2 Milkable comps
Why only 2 ? :-)
A cow with a battery of udder, for Milk,Chemfuel,Beer,.... :-)
I just remember a book, when a mad genetic scientist modify his pet, so each dug could produce a differnt type of drug for his need.

SargBjornson

Quote from: Albion on December 01, 2017, 05:27:20 AM
Much appreciated.
I guess switching the resourceDefs is the best and easiest way without breaking saves. However you could test if it is possible for a creature to have 2 Milkable comps and maybe change it with the transition to the release of beta 19 (in 6 months or so  :D ).

Ok, I just took a look, and I noticed something... Since Chemfuel production uses the Milkable class, the inspection text shows "Milk production" anyway. And that's ugly, really ugly. So my idea is to move ALL chemfuel production in my hybrids to my custom NewAnimalSubproducts.CompProperties_AnimalProduct class, which can display different text strings (why didn't I pass those strings as parameters??? Well, I'll certainly leave that for B19...).

So, will this cause you too much of a hassle to adapt?

Quote from: kubolek01 on December 01, 2017, 04:32:12 PM
EVEN bigger than your 2nd form you show here? ;)

Just a teaser: imagine if you could investigate a tech to mind control your creatures, giving them special abilities. So you can now directly control bear hybrids to attack. You can detonate boomalope hybrids remotely at will. And you can make chickens do, I dunno, chickeny things.

Wouldn't that be cool? ;)

Nightinggale

Quote from: SargBjornson on December 02, 2017, 03:38:22 AMOk, I just took a look, and I noticed something... Since Chemfuel production uses the Milkable class, the inspection text shows "Milk production" anyway. And that's ugly, really ugly. So my idea is to move ALL chemfuel production in my hybrids to my custom NewAnimalSubproducts.CompProperties_AnimalProduct class, which can display different text strings (why didn't I pass those strings as parameters??? Well, I'll certainly leave that for B19...).
I wrote code for BoneMod, which adds bones to butcherProducts, scale it for body size and missing body parts and displays it in the inspector. I wrote a yet to be published code where the same code is generic and can add whatever item you want based on xml only. I wonder if this approach can be used for milkable products as well.
ModCheck - boost your patch loading times and include patchmods in your main mod.

Albion

Quote from: SargBjornson on December 02, 2017, 03:38:22 AM
Ok, I just took a look, and I noticed something... Since Chemfuel production uses the Milkable class, the inspection text shows "Milk production" anyway. And that's ugly, really ugly. So my idea is to move ALL chemfuel production in my hybrids to my custom NewAnimalSubproducts.CompProperties_AnimalProduct class, which can display different text strings (why didn't I pass those strings as parameters??? Well, I'll certainly leave that for B19...).

So, will this cause you too much of a hassle to adapt?

Well this will make the entire patch I made depreciated and useless but I understand why you would do that.
Having it labeled milk production is a suboptimal solution but the description of the creatures explains to the player that they'll actually milk chemfuel. This might actually be a suggestion for the suggestion subforum to have the Milkable comp changed to production and some tags on how to call the stuff that is actually produced.
Anyway. You can do what you want but I would simply stick with the milk production since that is the way the vanilla core game does it with Boomalopes.
However if you rework your animalProduct comp to use a def instead of hardcoded strings I can adapt my patch to use your comp.

Nightinggale

I think I figured out how to handle multiple strings for milking. Add this:
public class CompMilkChemfuel : CompMilkable
{
public override string CompInspectStringExtra()
{
if (!this.Active)
{
return null;
}
return "MilkFullness".Translate() + ": " + base.Fullness.ToStringPercent();
}
}

Then instead of using CompMilkable, use namespace.CompMilkChemfuel (namespace is whatever your namespace is in C#). You can then change MilkFullness into whatever new string you want. At least in theory, everything else should be the same.
ModCheck - boost your patch loading times and include patchmods in your main mod.

SargBjornson

That's more or less what I'm doing, but I don't want to change it too much to avoid breaking Albion's mod :)

Nightinggale

Quote from: SargBjornson on December 02, 2017, 02:09:46 PM
That's more or less what I'm doing, but I don't want to change it too much to avoid breaking Albion's mod :)
Good point, but at the same time it won't fix the issue. How about this: (yes, now I found your code  ;) )

CompProperties_AnimalProduct
{
    public string customResourceString;


    public override string CompInspectStringExtra()
    {
            if (!this.Active)
            {
                return null;
            }
            if (!customResourceString.NullOrEmpty())
            {
                return Translator.Translate(customResourceString) + ": " + base.Fullness.ToStringPercent();
            }
// the if else if chain

This should allow adding customResourceString to CompProperties_AnimalProduct in xml. This will then be used as the string when writing fullness. However if it's not included in xml, it will be null and it will fall back to the current code. In other words since no xml file has customResourceString right now, nothing will change right away from adding this and no mod compatibility will be broken. However it adds the option to set the string in xml.

Also I would be really surprised if this change will affect savegames. In fact I can't really see anything, which will cause this to backfire. If it does, I would like to know about it.
ModCheck - boost your patch loading times and include patchmods in your main mod.

SargBjornson

Hey, I like that idea! Albion, you think you could implement it like that?