Jump to content

Soldier Gender Probability: How to change?


ktchong

Recommended Posts

I have been trying to change the Soldier Gender Probability mod so that my game will no longer recruit any more female soldier, (i.e., I want all male recruitments.) The mod set the default probability of recruiting female soldier to 25%. I want to change the probability to 0%. However, the mod is poorly documented and poorly explained. I see the integer "25" at various points in the mod. However, everytime I changed any or all 25 to 0, the UPK would fail to apply.

 

Can anyone please tell me which parts I should edit to set the probabilty to 0? Here are the codes from the UPK mod file:

 

 

MOD_NAME=Soldier Gender Probability
AUTHOR=wghost81 aka Wasteland Ghost
DESCRIPTION=Set soldier gender probability

Version: 2.0

Compatible with XCOM Enemy Within versions:
- all

UPK_FILE=XComGame.upk
OBJECT=XGCharacterGenerator.CreateTSoldier

// Female probability: change 25 to whatever value you like between 0 and 100
// Do not touch anything except number! Do not add spaces between number and other symbols!
// You can enter only integer values between 0 and 100, no floating-point values are allowed!
// Value 0 will result in all males, value 100 - in all females.
ALIAS=FemaleProb:<%b25>

// modded code
REL_OFFSET=0x121
[MODDED_CODE]
//kSoldier.kAppearance.iGender = ( (eForceGender != 0) ? eForceGender : ( (Rand(100) < 25) ? 2 : 1 ) );
0F 35 <XGTacticalGameCoreNativeBase.TAppearance.iGender> <XGTacticalGameCoreNativeBase.TAppearance> 00 00 35 <XGTacticalGameCoreNativeBase.TSoldier.kAppearance> <XGTacticalGameCoreNativeBase.TSoldier> 00 01 00 <.kSoldier>
45
9B
38 3A 00 <.eForceGender>
25
16
0B 00 // skip
38 3A 00 <.eForceGender>
10 00 // skip
45
96
A7 2C <%b100> 16
2C <!FemaleProb>
16
02 00 // skip
2C 02
01 00 // skip
26
// fill
00 <.eForceGender>
00 <.eForceGender>
00 <.eForceGender>
00 <.eForceGender>
00 <.eForceGender>
0B 0B 0B 0B 0B 0B

{ end of mod file }

Edited by ktchong
Link to comment
Share on other sites

// Female probability: change 25 to whatever value you like between 0 and 100
// Do not touch anything except number! Do not add spaces between number and other symbols!
// You can enter only integer values between 0 and 100, no floating-point values are allowed!
// Value 0 will result in all males, value 100 - in all females.
ALIAS=FemaleProb:<%b25>
I'd hardly call this "poorly documented". There's the variable named "FemaleProb" with value equal to 25. And a comment, explaining what you should change.

 

This will result in zero female probability:

ALIAS=FemaleProb:<%b0>
BTW, the mod is quite old and new PatcherGUI version has less restrictions. So you can write it like this:

ALIAS = FemaleProb : <%b 0>
Spaces can help with separating things and make the text and the code more understandable.

 

Bear in mind that XCOM has no official modding support and is not mod friendly. Some people here remember the times when we used hex editor to implement changes. :smile:

Edited by wghost81
Link to comment
Share on other sites

  • 3 months later...
  • 3 weeks later...

Used thus numerous times and it worked with long war as long as I set it in vanilla first. along with many others in your mod that Long War now uses by default.

 

The latest version seems to have broken it, The tweak still works in vanilla of course.

Tried hiring as well as with the initial allocation, with 100% Female successfully set, both before installing Long War Beta 15b and when that failed, after it.

So LW appears to be changing something this time, that it didn't before.

 

On the OP's question, I'd like to say that Modding noobs may need a little hint that it's the 25 in ALIAS=FemaleProb:<%b25> and not the code below as they may think.

What's clear and obvious to anyone who knows coding comments have // before them, isn't when you don't know that fact, If they are from Skyrim modding they may expect a semi-colon as used in the iIni files.

I'd add

// Change the value in ALIAS=FemaleProb:<%b25> on the next line

to the comments, but that's me.

Link to comment
Share on other sites

  • 1 year later...

I really don't understand what to change on this. If I change it to 100 I will have a full female roaster. if I change it to 0 I get a mostly male with a few female soldiers. Thing is I want just dudes to play a more realistic long war (more men In some cases only men like Alfa or SAS are in special forces which XCOM would draw from) and I can't seam to do that by just changing the female probability to 0. If someone could direct me to a guide or just write down a general walkthrough of all changes, it would be appreciated.

Link to comment
Share on other sites

First of all, are you trying to use this mod with EU, EW, or LW for EW? It makes a difference.

 

Like all mods that are changes outside of INI files, this requires a hex code change to the game executable. So there isn't anything "simpler". All you need to change is the one "ALIAS = FemaleProb : <%b 25>" line to "%b 0".

 

If you want to see what was originally required to "change gender" chances, the author used that code for the example of what was previously involved in "Hex editing UPK files" for a single value of the vanilla game.

 

What the game does with that information is somewhat out of our modders control. If you are still getting females, then there isn't much else to be done. In the vanilla code it is a "random" chance.

 

Remember that this is set in the future. The US Army has (in the last year) opened up all combat positions to qualified women, including Special Forces. So having some women in the XCom teams may be unusual to you, but it is not unrealistic even for a near future setting. (Having such lousy shots is much more disturbing to me. They wouldn't even qualify to graduate a rushed boot camp during the days of conscription for Vietnam with scores like the game's rookies.)

 

-Dubious-

Edited by dubiousintent
Link to comment
Share on other sites

  • 6 months later...

Hey guys, I'm using the same ktchong is using. I want 100% females so i changed the value to 100 in the PatcherGui, everything is successful but when i launch the game it just crashes, i followed the exact instructions as stated in

http://www.nexusmods.com/xcom/mods/448/?tab=9&navtag=http%3A%2F%2Fwww.nexusmods.com%2Fxcom%2Fajax%2Fmodreadme%2F%3Fid%3D448&pUp=1 (which is the patcher mod file read me).

 

Could anyone perhaps suggest another method or set of instructions i could try? Anything at all! I just want females! :sad:.

Edited by askinn
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...