Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: is there any way to find all the object names for a map?
Thread: is there any way to find all the object names for a map?
fred79
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
fred79
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).

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
potmdehex
potmdehex


Known Hero
professional ERM™ scripter
posted December 03, 2015 08:35 AM
Edited by potmdehex at 08:36, 03 Dec 2015.

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).

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
fred79
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
potmdehex
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
fred79
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0317 seconds