• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[C/C++] Load object editor data programatically

Status
Not open for further replies.
Level 23
Joined
Apr 16, 2012
Messages
4,041
How hard(I know it is possible, but Ive never tried extracting programatically stuff from mpq archives before) is it to load the default object editor data(so for instance like Footman and stuff, like if you open fresh map in editor) in C/C++? And because "how hard is it" is very shit question, any hints on how to achieve doing so? What file to look in, what to try loading from mpq archieves?

Thank you for your time
 

peq

peq

Level 6
Joined
May 13, 2007
Messages
171
I would say it is a lot of work, but not too difficult.

I think Barade has already done a lot of this stuff in his wc3lib. I have not looked at it exactly, but this file seems to do something with units: https://gitorious.org/wc3lib/wc3lib...74fbda63df75b5bee0024:src/map/customunits.cpp

If you want to do it yourself you can read the documentation of the file formats, of which I have a backup here: http://peeeq.de/temp/InsideTheW3M.html

You can also look at the Java implementation we have in Wurst: https://github.com/peq/WurstScript/...wurstscript/src/de/peeeq/wurstio/objectreader

Those resources are all about the format in map archives. For the values of the default units, I think you have to look at the slk files, for example Units/unitUI.slk or Units/UnitData.slk. Slk files are just tables with newlines and semicolons as separators, so they should be quite easy to read. Looks like Barade also reads those files in https://gitorious.org/wc3lib/wc3lib...ee0024:src/editor/objecteditor/uniteditor.cpp (uses https://gitorious.org/wc3lib/wc3lib...74fbda63df75b5bee0024:src/editor/metadata.cpp)
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
well better question would be, in which file in the mpq are the default unit data stored in? unitUI.slk?

edit: Yea what I am looking for is located inside unitUI.slk. The thing is, how to extract it programatically :D but I will try something not just uselessly ask questions
 
Status
Not open for further replies.
Top