Jump to content

UPK Utils


wghost81

Recommended Posts

  • Replies 235
  • Created
  • Last Reply

Top Posters In This Topic

Updated git sources and nexus files to v.2.1:

https://github.com/wghost/UPKUtils

http://www.nexusmods.com/xcom/mods/448

 

Modified some new keys behavior and added some keys from TODO list (yes, finally GUIDs!). Added a new tool called FindObjectByOffset. Came in handy while I was analyzing texture info, so I decided to share it too. :smile:

 

Hope this will work well and stable. :smile:

 

I won't be working on a new "smart" features for a while as I have other things to do right now, but I will return to this ASAP.

 

Please, feel free to post any bug reports, corrections and suggestions. :wink:

Link to comment
Share on other sites

Added a new tool DeserializeAll. It is unstable, but can batch-deserialize map archetypes (like XComWaveSystem), which is helpful in analyzing maps.

 

Type (in windows console)

DeserializeAll URB_PierA.upk TheWorld.PersistentLevel

To get all TheWorld.PersistentLevel info, like player starting points, alien pods, wave system info, etc.

 

Updated both nexus files and github sources.

Link to comment
Share on other sites

  • 5 weeks later...

Updated PatchUPK for better UPKModded compatibility:

 

02/19/2014:

- C-style comments support added:

/* comment */

// comment

- FIND_HEX operation now sets temporary scope, which limits the next write operation to FIND_HEX boundaries.

This allows to auto-expand object (if AUTO or MOVE specifier is set) to fit in replacement data (specified

by MODDED_HEX or AFTER_HEX). Also applies to BEFORE_HEX/AFTER_HEX.

- MODDED_FILE is now considered a total replacement for current scope: i.e. it should contain full object

data. Is also required now to use Full.Object.Name.ext pattern for file name, as program will auto-set

scope, based on file name.

- EXPAND_FUNCTION key now sets current scope to specified object.

Link to comment
Share on other sites

  • 4 weeks later...

I'm still trying to avoid adding new objects for the sake of compatibility. So recently, while I was rewriting XGDeployAI.GetPossibleSpawns function, I was forced to make some crazy variable conversions:

 

Original:

    local XComAlienPod kPod;
    local array<XComAlienPod> arrPods, arrRemove;
    local int iPod, iTestPod;
Modified:

    local XComAlienPod kPod;
    local array<XComAlienPod> arrPods;
    local TRect arrRemove;
    local int iPod[14];
    local Vector iTestPod;
    local XComAlienPod A;
One good thing: if there is at least one variable, one can have an indefinite numbers of variables of the same type via converting this variable to static array:

// convert iPod variable to static array
OBJECT=XGDeployAI.GetPossibleSpawns.iPod
REL_OFFSET=0x10
BYTE=14 // array size
Other good thing: one can convert dynamic array to two independent variables. Dynamic array is a variable itself, plus it has inner variable, which defines its inner object type. Conversion of the array is pretty straightforward, and inner variable needs to be relinked both in export table and in object code:

// convert XGDeployAI.GetPossibleSpawns.arrRemove dynamic array to structure
EXPORT_ENTRY=XGDeployAI.GetPossibleSpawns.arrRemove
OBJIDX=Core.StructProperty // Type
OBJECT=XGDeployAI.GetPossibleSpawns.arrRemove
REL_OFFSET=20
UNSIGNED=0 // set PropertyFlagsL to zero
REL_OFFSET=40
OBJIDX=Engine.Actor.TRect // StructObjRef
// rename and relink XGDeployAI.GetPossibleSpawns.arrRemove.arrRemove
EXPORT_ENTRY=XGDeployAI.GetPossibleSpawns.arrRemove.arrRemove
REL_OFFSET=8
OBJIDX=XGDeployAI.GetPossibleSpawns
REL_OFFSET=12
NAMEIDX=A // some random name from name list
// link new var to XGDeployAI.GetPossibleSpawns
OBJECT=XGDeployAI.GetPossibleSpawns.iTestPod
REL_OFFSET=12
OBJIDX=XGDeployAI.GetPossibleSpawns.A // NextRef
If one is rewriting several functions at once and has unused local var in some function, that unused var can be relinked to other function in the same manner.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...