dose206 Posted October 21, 2012 Share Posted October 21, 2012 Ok... New mod... I'd like equal chances for an xcom soldier to be male or female. Currently, the code is set up to have 33% female soldiers. I know this has been done before by kanet32, but this will be the tutorialized version. :D I love tutorialized versions. Link to comment Share on other sites More sharing options...
Anbar Posted October 21, 2012 Share Posted October 21, 2012 Ok... New mod... I'd like equal chances for an xcom soldier to be male or female. Currently, the code is set up to have 33% female soldiers. I know this has been done before by kanet32, but this will be the tutorialized version. :D gotta be honest but of all the stuff you ahve mentioned the big one for me would be item build time.... much more significant in gameplay than sex of soldiers for me ;-) how you managed to do that would be very helpful/useful. Link to comment Share on other sites More sharing options...
Tayot84 Posted October 21, 2012 Share Posted October 21, 2012 Using the same online calculator, I calculate the float 0.25 as hex, which gives: 0x3e800000Hey, windows 7 has a hex calculator, the calculator in the accesories folder has an option in the view menu that says programer.Click that and it turns into a nifty byte calculator.I'ts what I've been usin so far, kinda easier than goin online. Link to comment Share on other sites More sharing options...
Daemonjax Posted October 21, 2012 Share Posted October 21, 2012 Using the same online calculator, I calculate the float 0.25 as hex, which gives: 0x3e800000Hey, windows 7 has a hex calculator, the calculator in the accesories folder has an option in the view menu that says programer.Click that and it turns into a nifty byte calculator.I'ts what I've been usin so far, kinda easier than goin online. Yeah, but can't get float values using that calculator. Link to comment Share on other sites More sharing options...
tbkiah Posted October 21, 2012 Share Posted October 21, 2012 gotta be honest but of all the stuff you ahve mentioned the big one for me would be item build time.... much more significant in gameplay than sex of soldiers for me ;-) how you managed to do that would be very helpful/useful. function int GetItemBuildTime(XComGame.XGGameData.EItemType eItem, XGStrategyActor.EItemCategory eItemCat, int iEngineerDays) { local float fBalanceFactor; // End:0x19 Loop:False if(iEngineerDays == -1) { return -1; } // End:0x52 Loop:False if(eItemCat != 3 || (IsShipWeapon(eItem))) { iEngineerDays = 0; } fBalanceFactor = class'XGTacticalGameCore'.default.ITEM_TIME_BALANCE; return int(float(iEngineerDays * 24) * fBalanceFactor); } This is the script for build times... I changes the ||(OR) between != 3 and (IsShipWeapon(eItem))) to a && (AND) and this made it so that all items have the build times located in the INI files. This is just a quick fix, Once we can actually edit scripts, we could simply remove that part of the script and not have to worry about it screwing up any part of the game.. like if something happens to be a ship weapon and be in category 3. Link to comment Share on other sites More sharing options...
Daemonjax Posted October 21, 2012 Share Posted October 21, 2012 (edited) function int GetItemBuildTime(XComGame.XGGameData.EItemType eItem, XGStrategyActor.EItemCategory eItemCat, int iEngineerDays) { local float fBalanceFactor; // End:0x19 Loop:False if(iEngineerDays == -1) { return -1; } // This is an implied JumpToken; //goto J0x52; //eItemCat != 3 || (IsShipWeapon(eItem)); //iEngineerDays = 0; //J0x52: fBalanceFactor = class'XGTacticalGameCore'.default.ITEM_TIME_BALANCE; return int(float(iEngineerDays * 24) * fBalanceFactor); } Changing the second 07 (at location 45) to an 06 gives us that... So it skips all the code I commented out. tbkiah's change probably works as well, too. There's probably a LOT of ways you could change that code to make it read the build times. :D Anyways, the tutorial is up on the previous page for the equal gender ratios. SOOOO SIMPLE RIGHT??!! ;) Edited October 21, 2012 by Daemonjax Link to comment Share on other sites More sharing options...
tbkiah Posted October 21, 2012 Share Posted October 21, 2012 Your way is much better than mine, I don't have any idea what i'm really doing i just fumbled through the code and came up with that idea... much better your way because if there is an exception it doesn't allow it to happen. Such that if an item is not category 3 and somehow is also a ship weapon then the build time would be 0. I would also note that at first i thought i messed up.. then went to the INI and realized some items do in fact have a 0 build time right in the INI. Link to comment Share on other sites More sharing options...
Deleted2725050User Posted October 21, 2012 Share Posted October 21, 2012 Noob question inc :pinch: If some of you guys aren't re-packing the .upks then what are you doing, do you just have a folder with the right file structure in its place? Also Ive been working with the .upks that deal with meshes and textures, and I know you guys are working mostly with game mechanics, maybe theres a difference in how they are set up and thats whats throwing me off? Link to comment Share on other sites More sharing options...
Daemonjax Posted October 21, 2012 Share Posted October 21, 2012 (edited) If some of you guys aren't re-packing the .upks then what are you doing...? Once I determine specifically what bytecode needs to edited, I copy the surrounding hex data into my clipboard. Then I close UE Explorer, and open the uncompressed upk that was previously opened in UE Explorer. Then, I paste the bytecode in my clipboard into the search feature of the hexeditor to find the code in the upk. I make the actual change there, and save the file. Done. All I need to actually do after that point is just run XSHAPE. But, it's nice to re-open the file in UE Explorer to see the change in the decompiled code first. Basically, I don't change the unpacked files. Also Ive been working with the .upks that deal with meshes and textures, and I know you guys are working mostly with game mechanics, maybe theres a difference in how they are set up and thats whats throwing me off? I haven't looked at the meshes or textures. This is one game where I'm not particularly interested in changing those, but maybe someone else can help. Edited October 21, 2012 by Daemonjax Link to comment Share on other sites More sharing options...
Caiman Posted October 21, 2012 Share Posted October 21, 2012 (edited) Nice to read I have the same workflow going as you, Daemonjax! :biggrin: I followed your first(i guess) "tutorial-post" on how to do it... and that part was left out, so I figured it´d work like that(and it worked very very well). :thumbsup: Edited October 21, 2012 by Caiman Link to comment Share on other sites More sharing options...
Recommended Posts