I wrote tools to facilitate game modding
At first I just wanted to replace the fonts, which I couldn't do because of manual work, which caused a lot of errors.
Therefore, to simplify, I made this project. And I replaced the fonts.
But there was another problem - subtitles. And to replace the subtitles, I had to expand this project.
Therefore, I am posting this project here in the hope that it will be useful to someone.
- configparser
- PyYAML
- cchardet
- Wand (image manipulation)
WARNING: Before working through these tools, you need to decompress a upk files. Unreal Package Decomressor
_DYextracted: ObjectName.ObjectId.ObjectType
_DYpatched: ObjectName.ObjectId.ObjectType_patched
_objects.txt: ObjectName.ObjectId.ObjectType; SizeOffset; ObjectSize; OffetOffset; ObjectOffset
-
ObjectName
: name of object -
ObjectType
: type of object -
ObjectId
: id of object after unpacking -
SizeOffset
: offset to size value in header -
ObjectSize
: object size -
OffetOffset
: object offset written in header -
ObjectOffset
: offset to object in file
!IMPORTANT!: files in _objects.txt
sorted by ObjectOffset
python3 unpack.py -f <filter> upkfile
--split
: extract upk to_DYextracted/<upkname>
-f
or--filter
: sets filter to filename (*<filter>*
)
Example: python3 unpack.py -f Blurb ../L_Tower_Script.upk
Patches files from _DYpatched with suffix _patched
.
Example: _DYpatched/ChaletComprime-CologneEighty_PageA.4.Texture2D_patched
python3 patch.py -p upkfile --split
-s
or--split
: use files from_DYpatched/<upkname>
-p
or--patch-header
: insert header file from_DYextracted
Example: python3 patch.py ../L_Tower_Script.upk
- Unpack
python3 texture2d.py <filename>
- Pack
python3 texture2d.py -p <filename> <ddsfile>
IMPORTANT: font texture (Texture2D) must be in same directory as a .Font
See a wiki page
- Extract
python3 fontEdit -e <path to .Font>
- Pack
python3 fontEdit -p <path to .Font> <path to .ttf/.otf> [charset or file]
charset
- optional, if not specified it will use a charset from.Font
file
-
Export to yaml (from
INT
language)python3 subedit.py <upkfile> --output out.yaml --langCode <LANG>
--langCode
- Language to extract (defaultINT
)
-
Import to UPK
python3 subedit.py <upkfile> --input in.yaml --langCode <LANG> --langReplace <LANG>
--langCode
- Language to replace (defaultINT
)--langReplace
(optional) - Change language code to custom (3 chars) (don't work withINT
)
-
Avaiable lang codes (from Dishonored):
INT CHN CZE DEU ESM ESN FRA HUN ITA JPN KOR POL RUS SLO
A new
<upkfile>_patched
upk will be created at same dir as<upkfile>