Closed tdauth closed 5 months ago
Does a hashtable make more sense because if the size limits of int?
Add an option --oplimitoperations 100 It will split the initializer into functions with 100 operations and use a generated NewOpLimit function.
Extract hero abilities as well, so we do not have to register them all: uhab
and maybe abilities in general: uabi
./wc3objectdataextractor -Fjpg -f umki,usei,urq,urqa,ures,useu,utra,uupt,upgr,ucam,uhab,uabi -t integerlist,integerlist,integerlist,integerlist,integerlist,integerlist,integerlist,integerlist,integerlist,integer,integerlist,integerlist -l 500 -i ~/privaterepos/wowr-website/map/wowr.w3x/war3map.w3u -o test.j
Allow specifying SLKs with meta data and TXT files so the standard values are loaded.
Use a hashtable because of constant integer JASS_MAX_ARRAY_SIZE = 32768.
Use a hashtable and the parent key is the object ID, the child key is the field ID and the value is an instance of struct F.
struct F
integer/string array values
integer count
endstruct
Revised with hastable struct. New call:
./wc3objectdataextractor -Fp -f umki,usei,urq,urqa,ures,useu,utra,uupt,upgr,ucam,uhab,uabi -t integerlist,integerlist,integerlist,integerlist,integerlist,integerlist,integerlist,integerlist,integerlist,integer,integerlist,integerlist -l 500 -i ~/privaterepos/wowr-website/map/wowr.w3x/war3map.w3u -o test.j
With SLKs:
./wc3objectdataextractor -Fp -k ~/privaterepos/wc3lib/src/map/test/UnitMetaData.slk -s ~/privaterepos/wc3lib/src/map/test/UnitData.slk -f umki,usei,urq,urqa,ures,useu,utra,uupt,upgr,ucam,uhab,uabi -t integerlist,integerlist,integerlist,integerlist,integerlist,integerlist,integerlist,integerlist,integerlist,integer,integerlist,integerlist -l 500 -i ~/privaterepos/wowr-website/map/wowr.w3x/war3map.w3u -o test.j
Add script and SLK and TXT files into a folder in this repository to run it on Linux.
New command with new option to add all SLKs and TXT files automatically:
./wc3objectdataextractor -vFp -c ~/privaterepos/wowr-website/objectdata -f umki,usei,ureq,urqa,ures,useu,utra,uupt,upgr,ucam,uhab,uabi -l 500 -i ~/privaterepos/wowr-website/map/wowr.w3x/war3map.w3u -o test.j > out.txt
Trim Aspt.
function GetUtraCount takes integer objectId returns integer
local Finteger f = LoadInteger(fieldsHashTable, objectId, 'utra')
if (f == 0) then
return 0
endif
return f.count
endfunction
If it is a single value like ucam it does not need a struct behind it.
Finteger[10000]
./wc3objectdataextractor -vFp -c ~/privaterepos/wowr-website/objectdata -f umki,usei,ureq,urqa,ures,useu,utra,uupt,upgr,ucam,uhab,uabi -l 500 -i ~/privaterepos/wowr-website/map/wowr.w3x/war3map.w3u -o test.j > out.txt
Parsing SLK files with wc3lib seems a bit slow.
Use the new data for Trains, Researches, Items and Upgrades to lists.
There is a bug: If the field is not modified for an object type with a custom ID, the standard values from the base ID are not generated.
To extract gold and lumber base for upgrades use:
tdauth@ubuntu:~/privaterepos/wc3lib-build/src/app$ ./wc3objectdataextractor -vFp -c ~/privaterepos/wowr-website/objectdata -f umki,usei,ureq,urqa,ures,useu,utra,uupt,upgr,ucam,uhab,uabi,glmb,gglb -l 500 -i ~/privaterepos/wowr-website/map/wowr.w3x/war3map.w3u -i ~/privaterepos/wowr-website/map/wowr.w3x/war3map.w3q -o test.j > out.txt
The ItemMetaData.slk file is missing. I need to add it to extract igol and ilum.
Extracts item abilities, gold and lumber cost as well. The meta data for items is in UnitMetaData.slk.
./wc3objectdataextractor -vFp -c ~/privaterepos/wowr-website/objectdata -f umki,usei,ureq,urqa,ures,useu,utra,uupt,upgr,ucam,uhab,uabi,glmb,gglb,iabi,igol,ilum -l 500 -i ~/privaterepos/wowr-website/map/wowr.w3x/war3map.w3u -i ~/privaterepos/wowr-website/map/wowr.w3x/war3map.w3q -i ~/privaterepos/wowr-website/map/wowr.w3x/war3map.w3t -o test.j > out.txt
Nice idea but go back to registering in JASS which is easier to maintain in trigger editor and without a separate script.
Add the tool to wc3ib. Usage:
ucam utran etc.
Generated JASS code:
Add options:
Example call: