Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Also, I'm not sure if my characters are just not that fertile or something, because I had them spend days and nights together and nothing happened.
Ultimately used a console command, but that only got my player-character pregnant.
I want to get all my wives pregnant, to make sure I can have a child of each faction, or something like that.
Gonna make the new true Calradian Empire!!! (and I simply don't know if this error will either break the game at some point due it's endlessly multiplying entries, or because of something else linked to it)
Even if it's a fix we have to apply somewhere else, to just, reduce the list occasionly.
Question: you're talking about helpers.cs and Patches/PregnancyCampaignBehaviorPatches.cs
Where can those be found?
I figured out where the mod is downloaded (which is not in the MB-Folder, but in steamapps/workshops.
But neither there, nor in Documents/MB2B or the steamapps/common/MB2B folder, I could find those files.
So even if I would want to check the files/lines you mentioned, I can't because I can't find them.
Look at the github page for the mod
Anyhow, I wrote a real long text here, and accidentally deleted it....
Sadly, I don't have that much knowledge of programming, I learned some over 10y ago in school, even C#, but we probably only scraped the surface.
But what I think is kinda strange: PregnancyCampaignBehavior looks pregnancy+ and polyamory,
while RomanceCampaignBehavior only looks for polygamy.
The problem however, occurs with the combination of pregnancy+ and polygamy.
What's also strange, I never was able to get any of the characters pregnant, and had to use a console command to do that instead, but this will only make the player-character pregnant, didn't test it further, but the "father" seems to be my first wife. - The child recognizes the parents by a singly entry, that's good.
If this helps in anyway:
I tried to change settings after the mess already occured:
Starting with preg+gamy.
Removing polygamy: keeps duplicating
Set polygamy, remove pregnancy: no duplicating
set polyamory: no duplicating
remove polygamy: still no duplicating
set pregnancy: duplicating (which makes sense, because the container/lists already exist.
I now activated debug, and it only adds the line you'd expect: "Removed duplicate spouse NameOfSpouse"
So the mod thinks it did the job, or at least, the code forces it to say that.
I tried to have ChatGPT look at the code, but it only said to look certain things if they're used correctly, hoped it would find a specific logical error.
But maybe it's worth looking at that?
ChatGPT:
"Null check for hero.Spouse: In the RemoveExSpouses method, there is an attempt to use hero.Spouse without first checking if it's null. Make sure to ensure that hero.Spouse is not null before accessing it.
Usage of the ! operator: In some parts of the code, the ! operator is used, indicating that a certain method or property cannot be null. Make sure that the usage of the ! operator is correct and that the corresponding objects cannot actually be null.
Assignment of _exSpousesList and ExSpousesReadOnlyList: The assignments of _exSpousesList and ExSpousesReadOnlyList to _exSpouses(hero) and ExSpouses(hero) are performed within a condition where hero might be null. Make sure hero is valid before making these assignments."
So the mod thinks it did the job, or at least, the code forces it to say that.
Assuming that it's a failure to remove the spouse (and not that there are multiple attempts, some of which fail and some that don't), you can try looking for the line of code that prints : "Removed duplicate spouse NameOfSpouse", and go backwards from it to see what the conditions are for it to be printed/what is supposed to occur before it prints. (as those are failing, but it's still going through them, considering them completed, then printing)
ExSpouses, at least in my game, will never pass the not null check in Helpers.cs (line 100).
I added a debug message and in all iteration was always false for that condition.
NB: ALL BELOW IS AN ASSUMPTION SINCE I"M NO EXPERT OF C#
I believe that the problem lies in line 56, where by doing a Distinct() toList() you are no longer referencing hero.ExSpouses, but you created a new List, and every add/remove is done to the new list, not the original one since the reference is lost.
The code is removing the ex, but only on the new list.
Then in line 100 the first check passes, but ExSpouses is never not null (in my case).
This means that neither _exSpouses(hero) nor ExSpouses(hero) will ever be updated.
The log is not misleading, the problem is that there is no update to the original list
I believe that by adding this under line 62 should do the trick, at least for the short testing i've done
if (_exSpouses != null)
{
_exSpouses(hero) = _exSpousesList;
}
Which file do you need to add this code and have you had success in your tests by making this change?
I THINK THE OWNER OF THE MOD HAS NOT BEEN UPDATED YET