- Joined
- Aug 18, 2009
- Messages
- 4,099
A package of lua scripts that shall help to modify the binary files of map archives. You can read from files, the values get stored in a table under identifiers, can be edited from there and written into a file again in the end.
This allows you to work with standardized mask functions for both reading and writing, thus you need to care less for the sequential format of the binary files. Still, the masks are less suitable for manipulation of the data, which is why you may coonsider converting to another format temporarily.
Included masks:
obj (w3u, w3t, w3b, w3h)
objEx (w3d, w3a, w3q)
env (w3e), though it's very slow to read large terrains
guiTrig (wtg), you need to copy the latest TriggerData.txt from your War3Patch.mpq\UI\ to the working directory in order to use this since it contains information about the arguments different functions take
wct
doo
cam (w3c)
Sample code:
Besides lua, you currently need 3 things to use it:
LuaFileSystem (lfs) (google for it if you do not have it already)
waterlua https://github.com/WaterKnight/waterlua, see the readme
wc3binary https://github.com/WaterKnight/wc3binary
This allows you to work with standardized mask functions for both reading and writing, thus you need to care less for the sequential format of the binary files. Still, the masks are less suitable for manipulation of the data, which is why you may coonsider converting to another format temporarily.
Included masks:
obj (w3u, w3t, w3b, w3h)
objEx (w3d, w3a, w3q)
env (w3e), though it's very slow to read large terrains
guiTrig (wtg), you need to copy the latest TriggerData.txt from your War3Patch.mpq\UI\ to the working directory in order to use this since it contains information about the arguments different functions take
wct
doo
cam (w3c)
Sample code:
Code:
require "wc3binaryFile"
require "wc3binaryMaskFuncs"
root = wc3binaryFile.create()
root:readFromFile('war3map.wtg', guiTrigMaskFunc)
root:getSub('trig1'):setVal('enabled', 0)
root:getSub('trig1'):print()
root:print("print.txt")
root:writeToFile('output.wtg', guiTrigMaskFunc)
Besides lua, you currently need 3 things to use it:
LuaFileSystem (lfs) (google for it if you do not have it already)
waterlua https://github.com/WaterKnight/waterlua, see the readme
wc3binary https://github.com/WaterKnight/wc3binary
Last edited: