Jump to content

Interesting UPK Stuff I've Found


BlackAlpha

Recommended Posts

Hi evreyone

stumbled on this in

xcomstrategygame.upk >> XGStartegySoldier

 

function bool IsReadyToLevelUp()

{

// End:0x12 Loop:False

if(IsATank())

{

return false;

}

// End:0x5e

else

{

return m_kSoldier.iXP >= TACTICAL().GetXPRequired(GetRank() + 1);

}

}

 

function bool IsReadyToPsiLevelUp()

{

return m_kSoldier.iPsiXP >= TACTICAL().GetPsiXPRequired(GetPsiRank() + 1);

 

what i want to do is to change the +1 to a higher value, so your soldier could level up, based on kills wihtout the 1 rank per mission limition ( a rockie could become a sargent in one mission)

but dont know how to test that ( decompressd the file > opend with EU Explorer > ?) how do i change it in the file & find the HEX value ot modify to original file?

new to modding BTW

could you give a step by step explintion if it not to much trouble

Edited by answerogre
Link to comment
Share on other sites

This makes it so dead bodies stay for a much longer time. I've no idea what the numbers actually mean. First I thought it was seconds, but bodies in vanilla disappear like after 30 seconds, so I don't know. Setting it really high does the trick, though!

 

Props to Bokauk for figuring this out.

You were right, the value is the number of seconds until the game will attempt to clear the corpse. However, if the corpse is currently near/in view of the camera, it will not be cleared. That's why you never see a corpse disappear when it's in view. When you scroll the camera away then go back, the corpse is magically gone :)

 

So 7200 would mean the corpse would disappear only after it has been off of the screen for two hours :)

 

For those that want to mod this without delving into the hex, I've created an easy to configure mod with this feature :)

XCOM: ToolBoks

 

 

what i want to do is to change the +1 to a higher value, so your soldier could level up, based on kills wihtout the 1 rank per mission limition ( a rockie could become a sargent in one mission)

 

From glancing at that code, it looks like the +1 you refer to just means, "how much XP is required for MyCurrentRank + 1 (next rank)", not by how many ranks you can be promoted in one mission.

 

If there is such limitation (and I suspect there is), then I like your idea though :)

 

Daemonjax wrote a tutorial on an example mod which might help you get started :)

Edited by bokauk
Link to comment
Share on other sites

This makes it so dead bodies stay for a much longer time. I've no idea what the numbers actually mean. First I thought it was seconds, but bodies in vanilla disappear like after 30 seconds, so I don't know. Setting it really high does the trick, though!

 

Props to Bokauk for figuring this out.

You were right, the value is the number of seconds until the game will attempt to clear the corpse. However, if the corpse is currently near/in view of the camera, it will not be cleared. That's why you never see a corpse disappear when it's in view. When you scroll the camera away then go back, the corpse is magically gone :)

 

So 7200 would mean the corpse would disappear only after it has been off of the screen for two hours :)

 

For those that want to mod this without delving into the hex, I've created an easy to configure mod with this feature :)

XCOM: ToolBoks

 

 

what i want to do is to change the +1 to a higher value, so your soldier could level up, based on kills wihtout the 1 rank per mission limition ( a rockie could become a sargent in one mission)

 

From glancing at that code, it looks like the +1 you refer to just means, "how much XP is required for MyCurrentRank + 1 (next rank)", not by how many ranks you can be promoted in one mission.

 

If there is such limitation (and I suspect there is), then I like your idea though :)

 

Daemonjax wrote a tutorial on an example mod which might help you get started :)

 

thanksfor the link

 

and there is a limitation I did a mission with one soldier 12 kills (sectoids) and he only got a squddie rank while a sniper with the same amouts of kills but with more missions is a sargent

Link to comment
Share on other sites

Could you please post instructions on how to change the panic function. It would shine a lot of light on how its done for all of us to get a better understanding and contribute more to the modding community.

 

Thanks

 

The problem for me is that once unpacked there are tons for files and properties not sure where to look based on the information i gathered from UE.

 

 

NEVERMIND - I am eat up with stupid this morning....I found the hex in UE easily enough then it dawned on me to open the upk in HxD and search for the line to edit...DOH!

Edited by tsanford01
Link to comment
Share on other sites

Cool :)

 

I usually check unpacked fuction to narrow down the code I am searching in. Next referring to Table From UE Explorer Daemonjax put online and using windows calculator (dec to/from hex) to find the exact hex to change. You can check The next Step - Upk Surgery thread for some info and tutorials. When knowing what to change, I search portion of unpacked function in upk file it came from, make changes and check them in UE Explorer.

 

File XComgame.upk, class XGUnit, function AddTargetsInSight, first ==

Search for: 7B B3 00 00 47 55 00 00 00 00 00 00 58 B3 00 00 00 00 00 00 00 00 00 00 66 B3 00 00 00 00 00 00 E1 17 00 00 54 EF 02 00 87 01 00 00 17 01 00 00 49 02 00 28 15 49 02 00 28 15 49 03 00 24 00 15 14 2D 00 5C B3 00 00 28 05 66 B3 00 00 00 00 66 B3 00 00 0A 63 00 24 02 07 60 00 2D 01 71 AF 00 00 0F 00 5D B3 00 00 01 90 30 00 00 14 2D 00 5C B3 00 00 27 06 C3 00 0A BD 00 24 01 0F 00 5D B3 00 00 01 98 30 00 00 07 AE 00 82 1B F3 3D 00 00 00 00 00 00 4A 16 18 0E 00 9A
Replace 9A (==) at the end with 96 (<).

Doing so renders the condition (add friends to targets, if there is no enemy in sight) invalid, because there will never be less than zero enemies.

Edited by Drakous79
Link to comment
Share on other sites

  • 3 weeks later...
==== XGItemTree ====

>>>> function ScaleCost(out TItem kItem)

Changed:

if(fEngineers >= float(kItem.iMaxEngineers))

fScale = fScale + float(1) * 0.50;


To:

if(fEngineers > float(kItem.iMaxEngineers))

fScale = fScale + float(1) * 0.75;


This will make it so items cost a bit more than their base price. Once the player has more engineers than is required to produce the item, the price will drop more and more.
Generally, the engineer discount now won't be as big as in vanilla.

Props to Johnnylump for fixing the engineers bug.

HEX Hint:
Change:
47 01 B1 00 98 35 00 00 38 3F 35 C0 02 00 00 C8 02 00 00 00 00 48 9A 35 00 00 16 0F 00 99 35 00 00 AC 38 3F 35 C0 02 00 00 C8 02 00 00 00 00 48 9A 35 00 00 00 98 35 00 00 16 0F 00 99 35 00 00 AB AE 00 99 35 00 00 38 3F 26 16 1E 00 00 00 3F
To:
47 01 B3 00 98 35 00 00 38 3F 35 C0 02 00 00 C8 02 00 00 00 00 48 9A 35 00 00 16 0F 00 99 35 00 00 AC 38 3F 35 C0 02 00 00 C8 02 00 00 00 00 48 9A 35 00 00 00 98 35 00 00 16 0F 00 99 35 00 00 AB AE 00 99 35 00 00 38 3F 26 16 1E 00 00 40 3F

Edited by BlackAlpha
Link to comment
Share on other sites

===================

XComStrategyGame.upk:

===================

 

==== XGItemTree ====

 

>>>> GetItemBuildTime

 

if(eItemCat != 3 || (IsShipWeapon(eItem)))

{

iEngineerDays = 0;

}

 

Changed to:

 

goto J0x52;

eItemCat != 3 || (IsShipWeapon(eItem));

iEngineerDays = 0;

J0x52:

 

 

This is accomplished by changing the second 07 (at location 45) to an 06, so it skips all the code.

 

This makes it so the production times are re-enabled and everything takes time to build. See the INI file for the time settings.

 

Note that this one someone else found. I'm just repeating it to let people know about it. Credits to Daemonjax and Tbkiah.

 

This is a bit embarrassing, but given that I've no experience with hex editing beyond "replace this with that" I'd be interested in knowing how you know where exactly to look. I went through the file, found text from each of the lines you translated, but they're all over the actual hex of the upk, and the rest of it is scrambled characters. Sorry if that's a bit much to ask for an explanation, but for some reason, I really enjoy not only seeing the end-result, but knowing how it was accomplished, as well.

 

 

 

Link to comment
Share on other sites

===================

XComStrategyGame.upk:

===================

 

==== XGItemTree ====

 

>>>> GetItemBuildTime

 

if(eItemCat != 3 || (IsShipWeapon(eItem)))

{

iEngineerDays = 0;

}

 

Changed to:

 

goto J0x52;

eItemCat != 3 || (IsShipWeapon(eItem));

iEngineerDays = 0;

J0x52:

 

 

This is accomplished by changing the second 07 (at location 45) to an 06, so it skips all the code.

 

This makes it so the production times are re-enabled and everything takes time to build. See the INI file for the time settings.

 

Note that this one someone else found. I'm just repeating it to let people know about it. Credits to Daemonjax and Tbkiah.

 

This is a bit embarrassing, but given that I've no experience with hex editing beyond "replace this with that" I'd be interested in knowing how you know where exactly to look. I went through the file, found text from each of the lines you translated, but they're all over the actual hex of the upk, and the rest of it is scrambled characters. Sorry if that's a bit much to ask for an explanation, but for some reason, I really enjoy not only seeing the end-result, but knowing how it was accomplished, as well.

 

I can't tell you how exactly the goto command works. I've seen Daemonjax and Bokauk use it but I never looked into how or why it works. Maybe someone else can inform you about it.

 

Or are you just wondering about how to HEX edit and find the correct code to edit in general?

Edited by BlackAlpha
Link to comment
Share on other sites

  • Recently Browsing   0 members

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