Jump to content

Hex codes from ToolBoks


fys

Recommended Posts

I’m interested in the hex codes of single features from ToolBoks:

 

Remove Overwatch and Hunker-Down Delay

Disable Disappearing Corpses

Display Soldiers’ XP

Skip Revealed Aliens Cutscenes/Revealed Aliens Only Move After XCOM Turn

Abductions in Nations with Satellite Coverage

 

I'd like to integrate them permanently into my private mod without need to use other mods. Maybe there are also others who would like to do the same.

Link to comment
Share on other sites

I can provide three of those:

 

XcomGame.upk >> XcomunitPawn
Keep bodies when alien killed
16 1e 00 00 a0 40 16 61
to
16 1e 00 00 e1 45 16 61
Set Hunker Down and Overwatch delay to 0 seconds (instead of 1.75)
(this will make 2 changes)
XComGame
1e 00 00 e0 3f
to
1e 00 00 00 00
Allow abductions even with satellite coverage
XcomStrategyGame.upk >> XGStrategyAI.DetermineBestAbductionTargets
ef 00 07 c0 00 19 00 88
to
ef 00 06 c0 00 19 00 88
I'm interested in the XP one, myself, but haven't figured it out or seen it posted.
Link to comment
Share on other sites

Thanks a lot, mate!

 

In earlier times, I refrained from hex-editing the game, but I guess there is no way around for code fixes and other cool features. I've already gathered as many AI fixes and such from other topics. Very nice work of you crack coders here!

Link to comment
Share on other sites

Will do.

Are you sure about the satellite coverage code above? I can't find it in XcomStrategyGame.upk.

I haven't figured out hex codes by myself yet, but I guess this change is about following lines?:

    arrAbductionTargets = DetermineBestAbductionTargets();
    // End:0x70
    if(arrAbductionTargets.Length >= 3)
    {
        arrMissions.AddItem(2);
    }

Or is it here?

    arrAbductionTargets = DetermineBestAbductionTargets();
    // End:0x28
    if(arrAbductionTargets.Length < 2)
    {
        return 0;
    }

PS: I've found the "Long War upk changes" topic. From there, I find the other changes in XComGameStrategy.upk, like Reduce base abductions per attempt or Change number of Abductions per month. Nice!

However, no luck with your ef 00 07 c0 00 19 00 88 code for satellite coverage. Typo or changed by latest official patch?

 

PPS: Oh, I just found the ef 00 06 c0 00 19 00 88 hex code there. Was it already changed by official patch or did you mix-up new with old code?

Ehm, possible that ToolBoks has changed this file already when I messed up with the tool and couldn't make it run properly. Forgot to make backups there. Nevermind then.

Edited by fys
Link to comment
Share on other sites

No, it shouldn't be either of those. The fix is kind of a hack (before we developed the ability to rescript functions), but here's what my modded function looks like

function array<XComGame.XGGameData.ECountry> DetermineBestAbductionTargets()
{
    local array<XComGame.XGGameData.ECountry> arrPossibleCountries;
    local int iCountry;
    local XGCountry kCountry;
    local XComGame.XGGameData.ECountry eTargetCountry;

    iCountry = 0;
    J0x0B:
    // End:0xFD [Loop If]
    if(iCountry < 36)
    {
        eTargetCountry = byte(iCountry);
        kCountry = Country(eTargetCountry);
        // End:0x76
        if(!kCountry.IsCouncilMember())
        {
        }
        // End:0xEF
        else
        {
            // End:0x9B
            if(kCountry.LeftXCom())
            {
            }
            // End:0xEF
            else
            {
                goto J0xC0;
                kCountry.HasSatelliteCoverage(); // REMOVED IF WITH CODE CHANGE
                J0xC0:
                goto J0xEF;
                // End:0xD9
                if(IsTerrorTarget(eTargetCountry))
                {
                }
                // End:0xEF
                else
                {
                    arrPossibleCountries.AddItem(eTargetCountry);
                }
            }
        }
        ++ iCountry;
        // [Loop Continue]
        goto J0x0B;
    }
    return arrPossibleCountries;
    //return ReturnValue;    
}

The destination hex change is in my code and working. I checked the vanilla code and it looks like I posted it correctly, so I can't explain why you can't find it.

Link to comment
Share on other sites

It's fine, thanks. Still good to know what exactly has been changed in the code there.

 

Toolboks most likely changed the upk file once. I've been surprised that the archive was already decompressed when I started to do my first change on XComGameStrategy.upk.

I'm already doing a reinstall now and backup all upk file this time to prevent such confusion for the future.

Heh, that's why I don't like hex-editing and such patchers. It lacks the oversight compared to ini files, and you never know what has been already changed.

Link to comment
Share on other sites

Just a little heads up...

When toolboks starts it does not only decompress some of the .upk files... more importantly it also disables hash checking of those files...

 

So if you decide to do it all from scratch, without ever starting toolboks, then you also need to disable hash checking or the game will fail to launch as soon as it detects a modified upk file.

Edited by Bertilsson
Link to comment
Share on other sites

Yes, I've deleted the small "uncompressed_size" files. The modified upk procedure is clear to me, and the game still launches after my current 29 changes. Still collecting more here. I only hope everything will run smoothly later while playing. :D

Link to comment
Share on other sites

  • Recently Browsing   0 members

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