|
Thread: is there any way to find all the object names for a map? | |
|
fred79
Disgraceful
Undefeatable Hero
|
posted November 29, 2015 01:12 AM |
|
|
is there any way to find all the object names for a map?
i have some maps i want to release, but they're not made after my object patch(primarily, because the object patch came during, and later than these maps have existed). what i want to do, is extract every object used(by name) i need for all these maps, to put into it's own .pac.
i have looked at the tools in the era/tools folder already, but i don't know if any of those tools will do what i need to release these maps. anyone ever work with something like this? thanks in advance.
|
|
fred79
Disgraceful
Undefeatable Hero
|
posted December 03, 2015 02:34 AM |
|
|
anyone? i'm considering copy+pasting 3 maps into one xxl map(if it doesn't make the game crash, anyway. i understand you have to use an erm code to upgrade from 30000 to 60000, but i'm not sure if even that'll be enough. and i don't understand if that is "all objects minus castles", or not).
i'll also need to find the number of objects on a map(both sides).
|
|
potmdehex
Known Hero
professional ERM™ scripter
|
posted December 03, 2015 08:35 AM |
|
|
What do you mean with name? Def name? Object name as shown in map editor?
If the latter, I do not know much about WoG, but from what I have seen even the map editor does not really know the names for non-standard objects (tooltip when hovering over objects in object selection has always been wrong when I have looked). Does such names for WoG objects exist at all?
Anyway, I have a database of names (as shown in map editor) for every single RoE, AB and SoD object which can link them to their standard object attributes (e.g def name, passability etc):
https://github.com/potmdehex/homm3tools/blob/master/h3m/h3mlib/gen/object_names_hash.in
I don't understand exactly what you want to do, but that database could possibly be of use. If you could specify more clearly what exactly you mean by "name" I would probably be able to give a better answer.
Regarding number of objects:
Finding the number of objects on a map is not hard to do even manually with a hex editor. The first four bytes that come after object attributes section is the amount objects on the map. The simplest way to do this is to do a backwards search for ".def" starting at the bottom of the file, then go forwards 42 bytes from the end of that last .def name (this is the last object attributes of the map, AKA directly after it starts the object details section of which the first four bytes is object count). You can also just manually look to see where the object attributes section ends (end of repeating <len><name><+42 bytes> pattern).
|
|
fred79
Disgraceful
Undefeatable Hero
|
posted December 03, 2015 08:51 AM |
|
Edited by fred79 at 08:52, 03 Dec 2015.
|
i mean the actual def name, so that i can know what to keep/extract from the lod for the pac file.
i have no knowledge whatsoever of hex-editing, either.
|
|
potmdehex
Known Hero
professional ERM™ scripter
|
posted December 03, 2015 09:05 AM |
|
|
You do not need to have prior knowledge of hex editing to find number of objects if you follow what I said in my previous post. Just last def name + 42 bytes. At that place comes a 4 byte long hex value which is the amount of objects on the map (as every other value in the file, to put it simply, the value is in reverse order. This means that for example 01 00 00 00 is the hex for 1 as opposed to 00 00 00 01)
It would not be very hard to code a utility to get all .def names from a map and have them extracted using e.g MMArchive. But if you don't know how to do that and it sounds overwhelming you could simply just open the map in a hex editor and go through the .def names one by one and then extract them manually using MMArchive from your lod.
If you have never looked at a .h3m map in a hex editor before, I will also mention that they are compressed by default. This means you have to uncompress them before you open them in a hex editor, which you can do e.g by right clicking them in Explorer->7-zip->Extract here if you have 7-zip installed.
|
|
fred79
Disgraceful
Undefeatable Hero
|
posted December 03, 2015 05:56 PM |
|
|
i see. thanks, i'll see if i can get what i need this way.
|
|
|