Jump to content

New Guy Free/Automatically/Always On?


RBrim08

Recommended Posts

In XCOM EU it would be very simple to remove the condition that checks if OTS New Guy is bought before upgrading new soldiers to squaddie.

I don't imagine there is any difference regarding this in EW.

 

I'll probably attempt making a little mod for this in a week or so.

 

Edit: Still works the same:

XGFacility_Barracks.AddNewSoldier

  if((HasOTSUpgrade(3)) && !bBlueshirt)
  {
    if(kSoldier.GetRank() == 0)
    {
      kSoldier.LevelUp();
    }
  }

Changing the condition to if((HasOTSUpgrade(3)) && !bBlueshirt) is really all that is needed.

Edited by Bertilsson
Link to comment
Share on other sites

In XCOM EU it would be very simple to remove the condition that checks if OTS New Guy is bought before upgrading new soldiers to squaddie.

I don't imagine there is any difference regarding this in EW.

 

I'll probably attempt making a little mod for this in a week or so.

 

Edit: Still works the same:

XGFacility_Barracks.AddNewSoldier

  if((HasOTSUpgrade(3)) && !bBlueshirt)
  {
    if(kSoldier.GetRank() == 0)
    {
      kSoldier.LevelUp();
    }
  }

Changing the condition to if((HasOTSUpgrade(3)) && !bBlueshirt) is really all that is needed.

So... where do I go to change that? I have no modding experience with XCOM.

Link to comment
Share on other sites

So... where do I go to change that? I have no modding experience with XCOM.

 

You would first decompress XComStrategyGame.upk

Then you would open XGFacility_Barracks.AddNewSoldier in a tool called UE Explorer

Then you would use token view to find this section:

(047/02F) [07 AD 00 82 1B 24 14 00 00 00 00 00 00 24 03 16 18 0D 00 81 2D 00 1A 32 00 00 16 16]
	JIN(32/28) -> NF(29/25) -> VF(12/12) -> BC(2/2) -> EFP(1/1) -> S(15/11) -> NF(12/8) -> BV(10/6) -> LV(9/5) -> EFP(1/1) -> EFP(1/1)
	if((HasOTSUpgrade(3)) && !bBlueshirt)

Then you would break it down into components like this:

Goto virtual memory AD if what follows is not true : 07 AD 00
&& operator : 82
HasOTSUpgrade(3) : 1B 24 14 00 00 00 00 00 00 24 03 16
!bBlueshirt : 18 0D 00 81 2D 00 1A 32 00 00 16
End of && operator : 16

Then you would remove the unwanted parts like this

Goto virtual memory AD if what follows is not true : 07 AD 00
!bBlueshirt : 18 0D 00 81 2D 00 1A 32 00 00 16

And concatenate the remaining parts like this:

07 AD 00 18 0D 00 81 2D 00 1A 32 00 00 16

And then you would have to add 0B-tokens to fill in the missing storage space for the things you removed like this:

07 AD 00 18 0D 00 81 2D 00 1A 32 00 00 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B

Then you would use a hex editor like HxD to edit XComStrategyGame.upk and replace

This: 07 AD 00 82 1B 24 14 00 00 00 00 00 00 24 03 16 18 0D 00 81 2D 00 1A 32 00 00 16 16
With: 07 AD 00 18 0D 00 81 2D 00 1A 32 00 00 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B

Then you would reload the modified XComStrategyGame.upk file into UE Explorer and verify that the modified code has not changed the virtual memory location where the if statement should jump if not true.

 

Since I didn't mention that detail earlier you would have to roll back to original XComStrategyGame.upk, open it in UE Explorer again and figure out where the virtual memory target line originally existed by finding it in the parenthesis of this section:

(0AD/081) [1B F8 33 00 00 00 00 00 00 00 1C 32 00 00 16]
	VF(19/15) -> LV(9/5) -> EFP(1/1)
	UpdateOTSPerksForSoldier(kSoldier) 

Then you would re-apply the changes via HxD and open in UE Explorer again, to finally be able to confirm that the target AD was in fact unchanged and you have completed the mod.

 

If you instead had discovered that the target address was indeed changed you would have been best of by using my little jump offset repair tool to fix the virtual memory size in the function header and any additional jump offsets that may have been broken by your mod. But fortunately that would not happen in this case.

 

Finally you would possibly start a religion dedicated to praising the user-friendliness provided by Firaxis in the new versions of XCom :smile:

 

OR you would wait for toolboks to be updated for Enemy Within, save the following in a text file and load it as a custom toolboks mod:

MOD_NAME=Cheat mod to automatically upgrade all rookies to squaddie like OTS New Guy
AUTHOR=Bertilsson
DESCRIPTION=See MOD_NAME above.

Version: 1.2 Offset corrected for Enemy Within Patch 1

Compatible with XCOM Enemy Within version Patch 1.

UPK_FILE=XComStrategyGame.upk
OFFSET=3539723
[MODDED_HEX]
07 AD 00 81 2D 00 1A 32 00 00 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B

Was that answer to your question? :smile:

 

EDIT: In above examples there are 07 AD 00 (jump to virtual memory 00 AD if following is not true:) Some weird 18 0D 00 (I'm guessing this is related to the removed && and means something like if not true skip 13 virtual memory bytes).

By just getting rid of them and adding 3 more 0B tokens in the end of the example it works like a charm.

 

So to finish the example:

Get rid of the 18 0D 00 thing by changing

This:

07 AD 00 18 0D 00 81 2D 00 1A 32 00 00 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B

to this:

07 AD 00 81 2D 00 1A 32 00 00 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B

 

Sorry for being lazy and not testing that it actually worked. Have tested now.

 

And have also corrected the toolboks mod.

Edited by Bertilsson
Link to comment
Share on other sites

  • 2 weeks later...

Man i tried for hours to figure this s#*! out, but its not working.

 

If I go the simple route using toolbooks (toolbooks is updated for EW) to add it as a custom mod, the game crashes when starting any mission.

 

If I decompress the UPK and look for the function, i dont find the described section.

 

I found the described function in object view, but everything else looks way different and I have no idea how to proceed.

 

This is frustrating :[

 

UE Explorer is not very user friendly i have to say...

Link to comment
Share on other sites

  • Recently Browsing   0 members

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