• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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