GPTP DatExtend Repo
PyMS: https://github.com/poiuyqwert/PyMS
Right click list in PyDAT and add entries.
More details in this post: http://www.staredit.net/377086/
Previous post:
Update:
Uploaded a modified DatCC so you can decompile dat files to ini and recompile them to have more entries with a -n command-line option. Also updated the plugin, at clokr's request, to have sprites.dat have every value for every entry. No real progress on the plugin itself, but at least now it is usable!
* Fixed DatCC so that images.dat's blank entry won't crash when loading SC. It's not a huge issue, unless you don't use the images you add.
Here is a demo of the dat extender plugin. The plugin lets you specify how many entries are in each dat file. It just creates some new memory and replaces all references to the existing dat arrays to the new memory, and replaces a few other things to make it work.
The only dats I have working currently are units.dat, flingy.dat, sprites.dat and images.dat.
There are some thing about Units.dat, though:
- Every property in the extended units.dat is available to every entry. DatEdit won't show them except for the ones they are normally limited to.
- The flingy.dat ID (graphics) is normally 1-byte, so there is a patch that expands it to 2 bytes so you can have more than 256 flingies. This probably should just always be done, but right now it's an option.
- Due to some of SC's code that reads several entries at a time (for some reason), units.dat must be a multiple of 12.
- IDs 228 to 250 are used for special cases (as seen in FireGraft), so instead of finding and changing all of them these IDs have been reserved as special use and should not be used.
- Because of how FireGraft works, I had to copy the button tables to some unused memory (unit count tables, kill count table, and death table) which gives a maximum limit of 912 units. I could probably find new memory if this is ever a problem, but I don't imagine it will be necessary.
Some of the other dats I haven't done yet might have similar things, but I haven't looked in to them fully yet.
Using the plugin currently is a bit awkward. There's not really an easy way to add entries to a dat file (if only there were a dat editor that would let you add entries...). DatEdit is pretty easy to change to read an expanded dat file, other than the previously mentioned problem with units.dat, by just changing the .def files, add entries to the data lists and add them to the origins lists. FireGraft is a bit tricky though. Increasing the unit counts and adding to the unit lists is easy enough (found in fgd file and unitlist.txt in the data.mpq), except FG reads data directly from the EXE so I had to make a modified EXE with the data copied to the corresponding location so it wouldn't break.
Once you actually have the .dat files, the plugin is pretty straightforward. Just add it to MPQDraft or FireGraft and hit Configure and it will let you enter the new entry counts (or save/load them from a config file). I would have just automatically counted them from the filesizes, except the plugin runs before the MPQs are loaded.. I could probably add a bunch of code in to SC to do it, but this is easier.
I attached a demo I've been using to test. It has 252 units (2 usable ones), +10 flingies, +1 sprite, and +1 image. The two new units are buildable at a supply depot. They're just random units I created to be usable and test it out.
If anybody wants, either just play around with it in games to see if anything crashes or if anyone can think of places unit counts or IDs are that I missed. One obvious one visible is the extended units don't have names. Other ones is I haven't modified triggers in any way to read them. Or tell me which files I should focus on next.
Attachments:
Post has been edited 12 time(s), last time on Oct 26 2022, 6:03 am by FaRTy1billion.
TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!