Jump to content

The next Step


dreadylein

Recommended Posts

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

  • Replies 98
  • Created
  • Last Reply

Top Posters In This Topic

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

Using the same online calculator, I calculate the float 0.25 as hex, which gives: 0x3e800000

Hey, 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

Using the same online calculator, I calculate the float 0.25 as hex, which gives: 0x3e800000

Hey, 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

 

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

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 by Daemonjax
Link to comment
Share on other sites

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

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

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 by Daemonjax
Link to comment
Share on other sites

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 by Caiman
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...