- Joined
- Jun 19, 2010
- Messages
- 49
about
i created this tool to fix some known errors of "ObjectMerger" (part of GRIMEX), hence the name "ObjectMergerFixer".
the latest available source code of ObjectMerger misses some features of current ObjectMerger.exe, like LUA support.
unluckily the latest source code of ObjectMerger got lost.
quote from PitzerMike (author of ObjectMerger):
Source code of all my work - Wc3C.net
what it does
fixes following issues of latest ObjectMerger.exe:
- unit field (uaen) values
how to setup
- unzip: ObjectMergerFixer.zip
how to use
important! before you use this tool:
this is a first version without much feedback so far, i strongly recommend you make a backup of your map before using this tool. theoretically, this tool could corrupt your map by damaging your war3map.w3u. improvements or experienced C++ programers are cordially invited to make the tool as safe as possible.
now if you saved a backup there is nothing which keeps you from using it like:
after all your calls to ObjectMerger from WE trigger JASS code, add:
when you save your map it gets called automatically from "JassHelper".
you have to restart WE & reload your map to see changes, this also has to be done only once identical to calls to ObjectMerger.
plans
- add fix for umlaute (ä, ö, ü)
- maybe create a thread in the tools section or even it could be added to the next JNGP version
requirements
- OS (= Operation System) Windows (as far as i know you need it for the WINAPI functions used in the code...)
source code
ver 4.1.1: C++ code by SourceSeeker - 275 lines - codepad
ver 4.1.0: C++ code by SourceSeeker - 279 lines - codepad
ver 4.0.1: C++ code by SourceSeeker - 197 lines - codepad
ver 4.0.0: C++ code - 378 lines - codepad
attached "ObjectMergerFixer.exe" was compiled with dated freeware "DEV C++".
"DEV C++" must be configured to use 32 bit compiler because of the sfmpq.dll from PitzerMike, otherwise following seems to cause troubles:
hSFMpq = LoadLibrary("SFMpq.dll");
version history
version 4.1.1 [2016_11_05]
- fix: in case of wrong (uaen) fields, the fixed bytes didn't get written back to MPQ if there were no wrong (utco) fields.
version 4.1.0 [2016_10_30]
- changed function "getFixedW3U_uaen" to "getFixedW3U":
unreleased version 4.0.2 [2016_10_24]
- fix: in case "war3map.w3u" has nothing to be fixed, don't try to write back an empty W3U (resulted in false "MpqAddFileFromBufferEx(...)" & showed an error message box).
version 4.0.1 [2016_10_23]
- renamend function "function_getOutputVector" to "getFixedW3U_uaen".
- cloned project to have a private & public version for max & min comments.
- cleaned up code, added link to version with min comments.
version 4.0.0 [2016_10_22]
first public version:
- fixes ObjectMerger error with WE (= World Editor) unit field 'uaen' (combat - enabled attacks).
i created this tool to fix some known errors of "ObjectMerger" (part of GRIMEX), hence the name "ObjectMergerFixer".
ObjectMerger is one of the features from JNGP (= Jass New Gen Pack). Beside other tools, it can be found in "...\JNGP\grimext\ObjectMerger.exe".
reason behind decision to write another tool instead of fixing ObjectMerger & recompile:the latest available source code of ObjectMerger misses some features of current ObjectMerger.exe, like LUA support.
unluckily the latest source code of ObjectMerger got lost.
quote from PitzerMike (author of ObjectMerger):
source:Unfortunately it's not the most up-to-date version of the code.
The latest parts of the grim extensions are missing (mainly the code for PatchGenerator.exe which is used to generate the UMSWE patch).
If anyone has downloaded the code from the old repository, please post it here.
You will know it's the latest verson if it has a sub-folder called PatchGenerator.
Source code of all my work - Wc3C.net
what it does
fixes following issues of latest ObjectMerger.exe:
- unit field (uaen) values
should be: 0, 1, 2 or 3
ObjectMerger.exe generates: 48, 49, 50 or 51
info:
0 = nothing
1 = only attack 1
2 = only attack 2
3 = both
note:
as far as i know there is NO workarround for this issue!
link:
[Solved] - LUA: Ascii typecasting on ObjectMerger
- unit field (utco) valuesObjectMerger.exe generates: 48, 49, 50 or 51
info:
0 = nothing
1 = only attack 1
2 = only attack 2
3 = both
note:
as far as i know there is NO workarround for this issue!
link:
[Solved] - LUA: Ascii typecasting on ObjectMerger
should be: -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 or 12
ObjectMerger generates: 12589, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12337, 12593, 12849
note:
there is a workarround which works without this tool by using LUA via JASS
link:
[lua] bug in object generation script
ObjectMerger generates: 12589, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12337, 12593, 12849
note:
there is a workarround which works without this tool by using LUA via JASS
externalblock
instead of JASS external
link:
[lua] bug in object generation script
how to setup
- unzip: ObjectMergerFixer.zip
note:
- i recommend freeware "7-Zip"
- move: ObjectMergerFixer.exe- i recommend freeware "7-Zip"
to: ...\JNGP\grimext\ObjectMergerFixer.exe
note:
- JNGP = name of your JGNP (= Jass New Gen Pack) folder.
- "ObjectMergerFixer.exe" needs "sfmpq.dll" which is in this folder.
- open: ...\JNGP\jasshelper.confnote:
- JNGP = name of your JGNP (= Jass New Gen Pack) folder.
- "ObjectMergerFixer.exe" needs "sfmpq.dll" which is in this folder.
look for: [externaltools]
paste: "ObjectMergerFixer","grimext\ObjectMergerFixer.exe"
note:
- paste can be anywhere, but before the next []-block begins.
paste: "ObjectMergerFixer","grimext\ObjectMergerFixer.exe"
note:
- paste can be anywhere, but before the next []-block begins.
how to use
important! before you use this tool:
this is a first version without much feedback so far, i strongly recommend you make a backup of your map before using this tool. theoretically, this tool could corrupt your map by damaging your war3map.w3u. improvements or experienced C++ programers are cordially invited to make the tool as safe as possible.
now if you saved a backup there is nothing which keeps you from using it like:
after all your calls to ObjectMerger from WE trigger JASS code, add:
//! external ObjectMergerFixer
.when you save your map it gets called automatically from "JassHelper".
you have to restart WE & reload your map to see changes, this also has to be done only once identical to calls to ObjectMerger.
plans
- add fix for umlaute (ä, ö, ü)
- maybe create a thread in the tools section or even it could be added to the next JNGP version
requirements
- OS (= Operation System) Windows (as far as i know you need it for the WINAPI functions used in the code...)
source code
ver 4.1.1: C++ code by SourceSeeker - 275 lines - codepad
ver 4.1.0: C++ code by SourceSeeker - 279 lines - codepad
ver 4.0.1: C++ code by SourceSeeker - 197 lines - codepad
ver 4.0.0: C++ code - 378 lines - codepad
attached "ObjectMergerFixer.exe" was compiled with dated freeware "DEV C++".
"DEV C++" must be configured to use 32 bit compiler because of the sfmpq.dll from PitzerMike, otherwise following seems to cause troubles:
hSFMpq = LoadLibrary("SFMpq.dll");
version history
version 4.1.1 [2016_11_05]
- fix: in case of wrong (uaen) fields, the fixed bytes didn't get written back to MPQ if there were no wrong (utco) fields.
problem was:
function getFixedW3U(...) returned an empty vector instead of the input vector. now it returns input vector if no fixes were applied, which makes use of this function more apparent & also gets rid of an if-block checking for empty vector.
function getFixedW3U(...) returned an empty vector instead of the input vector. now it returns input vector if no fixes were applied, which makes use of this function more apparent & also gets rid of an if-block checking for empty vector.
version 4.1.0 [2016_10_30]
- changed function "getFixedW3U_uaen" to "getFixedW3U":
the function now takes 4 parameters instead of 2 to act more generically.
- new feature for (utco):new api:
vector<char> getFixedW3U( vector<char> v_input, const char * c_wrongBytes, const char * c_rightBytes ) {...}
improved reading of hex values!vector<char> getFixedW3U( vector<char> v_input, const char * c_wrongBytes, const char * c_rightBytes ) {...}
instead of reading at fixed index, everything after uaen.... or utco.... is read until the next null byte appears.
the read content is checked for a digit in range from -9 to 99 (range of utco is -1 to 12).
the read content is checked for a digit in range from -9 to 99 (range of utco is -1 to 12).
fixes ObjectMerger error with WE (= World Editor) unit field 'utco' (art - team color).
unreleased version 4.0.2 [2016_10_24]
- fix: in case "war3map.w3u" has nothing to be fixed, don't try to write back an empty W3U (resulted in false "MpqAddFileFromBufferEx(...)" & showed an error message box).
version 4.0.1 [2016_10_23]
- renamend function "function_getOutputVector" to "getFixedW3U_uaen".
- cloned project to have a private & public version for max & min comments.
- cleaned up code, added link to version with min comments.
version 4.0.0 [2016_10_22]
first public version:
- fixes ObjectMerger error with WE (= World Editor) unit field 'uaen' (combat - enabled attacks).
ObjectMerger generates wrong values. this derives from a wrong variable type. 'uaen' needs integer type, but ObjectMerger generates string type.
example:
put following into a WE trigger as JASS code, save map & compare field 'uaen' of created units:
instead of 0, 1 & 2 it has 48, 49 & 50! these are simply the ASCII values of the characters 0, 1 & 2.
example:
put following into a WE trigger as JASS code, save map & compare field 'uaen' of created units:
JASS:
//! external ObjectMerger w3u hpea 1d1A uaen 0 unam "Arbeiter-custom-test1"
//! external ObjectMerger w3u hpea 1d1B uaen 0 unam "Arbeiter-custom-test2"
//! external ObjectMerger w3u hpea 1d1C uaen 0 unam "Arbeiter-custom-test3-uaen"
//! external ObjectMerger w3u hpea 1d1D uaen 1 unam "Arbeiter-custom-test4"
//! external ObjectMerger w3u hpea 1d1E uaen 2 unam "Arbeiter-custom-test5"
Attachments
Last edited: