XCOM 2
Multiple Faction Soldier Classes
MantiSynth 30. jan. 2019 kl. 15:43
Problem
I downloaded this mod, and the supported classes (not the third-party classes) and ever since then all faction soldiers i recruit are the new classes. This can't be just luck, because I recruited about 4 after downloading this mod, and I have been having that very problem with the biotic mod, where all rookies are promoted to the "rare" biotic class
< >
Viser 1-8 af 8 kommentarer
Flashstriker 31. jan. 2019 kl. 11:57 
Theres an Ini setting that you can change. FavourNewClasses should be set to False and the chance will become 50/50. This has been answered in the comments (I would know, I asked the same question) so maybe read those next time?
MantiSynth 31. jan. 2019 kl. 15:37 
I actually read that comment, but when I searched for it in the XCOM folder, I didn't find it
MantiSynth 31. jan. 2019 kl. 15:47 
oh wait nvm found it
Neonivek 14. juli 2019 kl. 17:30 
Thanks, as much as I like the other faction soldiers (I really do) I feel that they serve better as variants to the standard Reapers/Skirmishers/Reavers and not as the go to.

If anything I wish there was an option to weight it in favor of the standard... so that there is always a 50/50 chance (even if you got a billion Reaper classes... but to admit there is only two so)
Sidst redigeret af Neonivek; 14. juli 2019 kl. 17:31
Where's the folder for it?
Flashstriker 22. juli 2019 kl. 3:23 
To answer all questions about it once and for all, you can find FavourNewClasses in steamapps\workshop\content\268500\1373823499\Config\XComFactionClasses.ini . You should change this to False, which will give you an even distribution of new and vanilla classes
invisibleman 4. dec. 2019 kl. 10:49 
I may have found a solution here.

It seems to work for me, still generating Skirmisher Heavy/Heretic, Templar Psion/Dragon and Reaper Scythe/Cryptic, but with probabilities slightly favouring the classic heroes. I must test this systematically, but 3 regular reapers in a row and a few regular Skirmishers and Templars look promising and my PC hasn't melted yet.

--------------------------------WARNING--------------------------------
I am not an exprienced modder. I'm not even entirely sure which programming language I've used here. There was some luck involved in finding this one.
Also, my solution looks suspiciously simple, so there may be some issues which I'm not aware of. In this case, I'd appreciate constructive criticism.


So, here's what to do:

Edit file

steamapps\workshop\content\268500\1373823499\Script\MultipleFactionSoldierClasses.u

Lines 339/340 should look like this:
if (RBase > 1)
R = (class'Engine'.static.GetEngine().SyncRand(RBase,"MultipleFactionSoldierClassController::"$GetFuncName()));

I commented these out (just put '//' in front) and inserted these new lines just below the original ones:
if (RBase >= 1)
R = (class'Engine'.static.GetEngine().SyncRand(RBase));
Iridar 16. dec. 2022 kl. 18:15 
Editing .u files is an excellent way to make your game crash and nothing more. The proper way is to change the source code and then recompile the mod, but you need modding tools for that.

"The fix" above in particular seems to be a placebo at best. Here's the relevant piece of the source code:

static function string RandomizeClasses(X2CharacterTemplateManager CharacterTemplateManager, name TemplateNameBase, array<string> ValidClasses, bool NewClasses) { local X2CharacterTemplate Template; local string NewClassName; local name TemplateName; local int R, RBase; if (CharacterTemplateManager == none) CharacterTemplateManager = class'X2CharacterTemplateManager'.static.GetCharacterTemplateManager(); TemplateName = name(string(TemplateNameBase) $ "Soldier"); RBase = ValidClasses.Length; do { Template = CharacterTemplateManager.FindCharacterTemplate(TemplateName); if (RBase > 1) R = `SYNC_RAND_STATIC(RBase); else R = 0; NewClassName = ValidClasses[R]; } until (RBase <= 1 || NewClasses == false || (NewClassName != string(TemplateNameBase))); `log("MFSC: New randomized class is [" $ NewClassName $ "]:(" $ string(R) $ ")"); // constantly changing the template is how we generate random classes Template.DefaultSoldierClass = name(NewClassName); return NewClassName; }

The RBase variable is the number of potential classes the mod will randomly choose from.

The default logic is that if there's more than one to choose from, then the selection will be randomized.
If there's not more than one, then the first - and only - class on the list will be selected automatically, without accessing the random number generation function.

Strictly speaking that's unnecessary to do, because `SYNC_RAND_STATIC(1) would always generate 0 anyway.

So even if "the fix" would have worked, it would not have altered the mod's logic in any way.
Sidst redigeret af Iridar; 16. dec. 2022 kl. 18:17
< >
Viser 1-8 af 8 kommentarer
Per side: 1530 50