Skip to content

Conversation

@StarAmy
Copy link

@StarAmy StarAmy commented Mar 10, 2022

Hey, here's the code I've used to make the items required for pregnancy configurable. You're welcome to incorporate or tweak any of it (although I understand if you want to do your own from scratch). It seems to be working well with the custom BFAV entries and DNA items I added separately in my own game so far.

@Digus
Copy link
Owner

Digus commented Mar 24, 2022

Sorry for the delay to answer you.
Just checked the code and it's quite simple what you need.

Here are some points:
Checking the "Male" text on the DisplayName won't work when translated, it would need to check the "Name" attribute.
Also, some invented names might contain the text "male" even if it's not a male animal.
Some animals don't have a different name for Male and Female, you just put Male and Female as prefix.
Ex. Male Alpaca and Female Alpaca
Since Female has the text "male" in it, it would also be considered a male animal.
Doesn't BFAV has a way to identify male animals?
The FarmAnimal class does have a isMale() method, but it's hardcoded and would need some mod to patch so it can be used.
But I get if there is no other option, we could go with the name containing "Male" text and people will just have to work around it, never using "female" as part of the name if they want to use this functionality.
Also, I'm don't see a need for a separate config file for pregnancy. Seeing what you need, I will add it to the current animal data file in way people can configure it.
I hope I can work on this this weekend.

@StarAmy
Copy link
Author

StarAmy commented Mar 24, 2022

Awesome, thanks so much. The coding half of this project is a little tied up today, but I thought I (config/art) would respond quickly to tell you I appreciate it - and not to stress about the time, because just the documentation for my half is taking a while.

BFAV didn't have that functionality that I saw but we were pouring through a lot of unfamiliar code so I will do some double checking. I think we had it work off capital "Male" only for that reason but if there's a cleaner way to do it we will do some fiddling. I will make sure the example config is included for you too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants