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 4 - Lands of Axeoth > Thread: Roadblock with map-replacing town images
Thread: Roadblock with map-replacing town images This thread is 2 pages long: 1 2 · NEXT»
NimoStar
NimoStar


Responsible
Legendary Hero
Modding the Unmoddable
posted October 18, 2017 03:13 AM
Edited by NimoStar at 03:14, 18 Oct 2017.

Roadblock with map-replacing town images

So,I have found replacing map images for towns gives the "Map file is bad" error when trying to use that town ingame.

Upgrading towns to changed images works fine (example, old citadel to new Castle map appearance); it's just at the beggining of the game, if the "new castle" or other replaced phase is present, the map will not start.

Probably there are techniques to go around it, but I was bummed by this because it's a block to add new towns.

As for the cause, Town objects have extra information in them compared to regular map objects (Dwellings, hero modifiers, etc.), so this is probably related to that.

In other news, towns are the only map objects that change appearance, so it may have to do as well. All other objects are "one file, one object, one appearance"; but Towns are one single object which can change to up to four dynamic files/appearances, in the same game, and updated accordingly, while keeping unique info and continuity (as most objects have no dynamic properties such as Oasis or Learning Stone, they require no "saves")

Heroes 3 had a similar problem, whereas all object images were changeable effectively except towns (even in WOG map editor)

Unless this roadblock is passed, any potential new towns we can make will still look like the old towns on the map.
If anyone knows how to fix it or has additional info, it would be welcome.

BTW I would have released my new version of mod weeks ago if not for this problem.
____________
Never changing = never improving

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


Promising
Known Hero
posted October 18, 2017 11:30 AM
Edited by radmutant69 at 14:13, 18 Oct 2017.

According to my quick research it can be done:





I think you should not use the original town objects. Change an other map object instead to town type and replace its image with yours. That should work in that way.

Also there is no extra info in town objects (as far as I know). Their file header is longer than other objects' only because they bigger than any other stuff.

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


Responsible
Legendary Hero
Modding the Unmoddable
posted October 18, 2017 04:51 PM
Edited by Nimostar at 16:52, 18 Oct 2017.

Ingame there is more info. If you hex edit .aop files you will see what I mean.

In any case, your idea is sort of cool.
I didn't like most of the times how Heroes 4 map town imges are HUGE squares compared to their H3 counterparts.
(And it's not only that they are huge - but that they are boring squares).
3.55 objects allow you to manually add wall appearance if you like, so there is no reason to have such big town images. we could use custom images from H3 extra objects patches or other isometric ones downloaded from the internet.

What I tried this time is to change life castle into order castle and viceversa.

I was planning on using new images later.

in the townscreen it worked, in the map it didn't.

I found my problem anyways: My "academy" file still had "life" data on the hexes.

Replacing this to "order" should fix it.



_________________


In any case, I wonder how the game would handle extra castle appearances files. Say, two files of these with the same header data and different names and images. (which would allow alternative appearances to starting castles, so that not all look the same)
____________
Never changing = never improving

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


Promising
Known Hero
posted October 18, 2017 05:11 PM
Edited by radmutant69 at 17:36, 18 Oct 2017.

Nimostar said:


In any case, I wonder how the game would handle extra castle appearances files. Say, two files of these with the same header data and different names and images. (which would allow alternative appearances to starting castles, so that not all look the same)


I tried it at once but it works only in the editor. In the game all extra castles will change back to the first town's appereance (I mean that one what have the original town's file name). What I never tried is what if you remove the original castle objects somehow from the heroes4.h4r file and use only new files with new names instead.

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


Legendary Hero
posted October 18, 2017 06:26 PM

Game reads adventure objects another than from name. Often you change name but editor still know its first building! Buildings are numbered as heroes! And game read from this numbers! ALL MAP OBJECTS ARE NUMBRES! Extract map by 7zip. There are only numbers! To change look you must inject inside def ONLY picture! Nothing more.

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


Responsible
Supreme Hero
posted October 18, 2017 06:43 PM
Edited by Karmakeld at 18:46, 18 Oct 2017.

NimoStar said:
In other news, towns are the only map objects that change appearance, so it may have to do as well. All other objects are "one file, one object, one appearance"; but Towns are one single object which can change to up to four dynamic files/appearances, in the same game, and updated accordingly, while keeping unique info and continuity (as most objects have no dynamic properties such as Oasis or Learning Stone, they require no "saves")


Now that's not quite true. You're forgetting about Veins (unbuild mines) as well as Abandoned Mines. These also change appearance once you either claim it, construct it or defeat the guards. Yet these only change image once -although we know they had planned exhausted mines as well.

It quite sad, but it seemed they had originally intended for map makers to be able to place objects in a map through scripts. But I doubt we'll ever be able to do so, or get the possibility of changing one object into another.

Wouldn't it be enough to pack it in a new file? From what I've understood, the h4r files are read in alphabetic order, thus the updates files. So wouldn't placing new town objects inside a h4r 'replace' the original, simply 'coz they're being read instead?
____________

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


Responsible
Legendary Hero
Modding the Unmoddable
posted October 18, 2017 07:03 PM

Quote:
Wouldn't it be enough to pack it in a new file? From what I've understood, the h4r files are read in alphabetic order, thus the updates files. So wouldn't placing new town objects inside a h4r 'replace' the original, simply 'coz they're being read instead?


That's a given. We already are doing it correctly, the problem is not that; the problem is ONCE you replace it, they don't work like other objects.

Quote:
Game reads adventure objects another than from name. Often you change name but editor still know its first building! Buildings are numbered as heroes! And game read from this numbers! ALL MAP OBJECTS ARE NUMBRES! Extract map by 7zip. There are only numbers! To change look you must inject inside def ONLY picture! Nothing more.


You can have different appearances with the same "number". For example there is only one object with the name of "bones". AKA they all share the same "number".
Yet you can have many "bones" objects with different names and passabilities.

Same seems to be true for most map objects.


Quote:
Now that's not quite true. You're forgetting about Veins (unbuild mines) as well as Abandoned Mines. These also change appearance once you either claim it, construct it or defeat the guards. Yet these only change image once -although we know they had planned exhausted mines as well.


Abandoned mine is not the same object as restored mine. In this case you change object, not appearance of the same object. But town stays the same object ("castle" town is the same object as "fort" town), only internal data switches.

Quote:
It quite sad, but it seemed they had originally intended for map makers to be able to place objects in a map through scripts. But I doubt we'll ever be able to do so, or get the possibility of changing one object into another.



Source code
____________
Never changing = never improving

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


Legendary Hero
posted October 18, 2017 09:57 PM
Edited by Baronus at 22:00, 18 Oct 2017.

Baronus

??? Dont understand what are you talking about!
All def has own number. If you place it on map its saved as number not def name. And its terrain, I told abuot objects not ground. Ground defs are more complicated.

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


Responsible
Legendary Hero
Modding the Unmoddable
posted October 19, 2017 03:16 AM

Ah you mean only about grounds.
I was talking about map objects.
You can have many map objects with the same function, and different passability and image... is what I was saying.

It is your grammar which is confusing :V
____________
Never changing = never improving

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


Legendary Hero
posted October 19, 2017 03:56 PM
Edited by Baronus at 15:57, 19 Oct 2017.

Baronus

No.
1. Grounds
2. Ground objects.
3. ADVENTURE OBJECTS! Its completly another thing.
I mean first interacrive buildings second decorative buildigns.

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


Responsible
Legendary Hero
Modding the Unmoddable
posted October 19, 2017 05:00 PM
Edited by Nimostar at 17:02, 19 Oct 2017.

Interactive buildings can have different passability and image.

Look at "garrison". There is Hexis garrison.

Also look at "alternate" looks for, say, Potion of Immortality (the grey version)

Also look at quest huts. They are all really the same object type, showing the same object type can support multiple images and passabilities.

There seems to be difficulties for this with Town images, though.
____________
Never changing = never improving

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


Promising
Known Hero
posted October 19, 2017 06:03 PM
Edited by radmutant69 at 18:06, 19 Oct 2017.

Yeah it has some difficulties indeed. Today I've played a lot with town objects but I had no luck at all with duplicating towns. The last thing I did was I changed an Asylum's subtype to some invalid crap and the town changed to be a Haven anyway. It seems that is the 'default' town type in the game.

Also I changed a tavern's type to 'town', it had no subtypes and no other details and it still changed to be a Haven. I don't know how could we solve this problem.

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


Legendary Hero
posted October 19, 2017 07:45 PM

If you use eg. (adv obj trologite hut) which is number 1122 and you copy paste new picture to new object named eg. golden pyramide this object had the same 1122 number in def. Right? Now game has two 1122 objects, right? If game wants load object 1122 in map which object will be load?
2 options.
1. Game always load one of them.
2. Crash.
We must know where is this number. Im affraid all of it is hardcodded so only replacing is possible.

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


Responsible
Legendary Hero
Modding the Unmoddable
posted October 19, 2017 07:49 PM

Maybe Sunday I can experiment a bit myself.

Like changing image on an existing town type and it's filename, then placing it into object palette and on a map.

You say this would go back to default image for that town type ingame?

____________
Never changing = never improving

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


Promising
Known Hero
posted October 19, 2017 08:46 PM
Edited by radmutant69 at 21:06, 19 Oct 2017.

Yes. You can have only one town appearance per faction. All the other versions will change back to the original town's look (or if you changed the original then that new town's look).

@Baronus: if you were right  we couldn't make a single mirrored map object what we made dozens so far. The same would be with any 'new' objects because those are all just cloned old objects with new look. Also I have at least four Parapets in my game:



These are all exactly the same object with changed images. What you're talking about is true only in case of towns and maybe the mine veins (I didn't looked them yet).

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


Legendary Hero
posted October 19, 2017 09:05 PM

So we must know which objects are loaded by def name and which by number. I think that all interactive by number. New can be only decorative. Town is interactive ofcourse.

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


Promising
Known Hero
posted October 19, 2017 09:29 PM

Well I don't know anything about how the game loads the objects. But I'm really sure duplicating is working with almost any object in H4 except the towns for some (likely hardcoded) reason.

But I can't help on it I think. We really need that damn source code.

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


Responsible
Legendary Hero
Modding the Unmoddable
posted October 19, 2017 09:31 PM
Edited by Nimostar at 23:00, 19 Oct 2017.

-__-
Look, parapet is obviously interactive, and is loaded "by name" besides any theoretical "Number", so are quests, artifacts, etc.

If there are any "Numbers" in town that make them special they are likely to be these:

00- Life
01- Order
02- Death
03- Chaos
04- Nature
05- Might

Or something like that.
____________
Never changing = never improving

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


Promising
Known Hero
posted October 19, 2017 09:35 PM

Yes but those numbers have no effect on the town objects at all. I tried it. You have to change their subtype if you want to change their faction.

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


Honorable
Famous Hero
posted October 19, 2017 09:52 PM
Edited by iliveinabox05 at 21:55, 19 Oct 2017.

For objects in .h4c map files, they don't each have their own separate number. They have their major / minor / sub types, and then the name text and any additional information.

Things like heroes, creatures, and alignments have their own numbers associated with them.

At least as far as I remember I never figured out what every single byte meant, but I'm pretty sure I would have noted somewhere the different numbers that were associated with different objects. I did map all numbers for creatures, hero portraits, and alignments for the different objects.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 2 pages long: 1 2 · NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0661 seconds