H4ResourceEditor

The old Heroes games developed by New World Computing. Please specify which game you are referring to in your post.

Moderator: Moderators

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 611
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Nov 18 2020, 3:40

Another update has been uploaded. What's new?

- I've added a mass import feature for .ora files. This is to significantly speed up importing sprites if you have a lot of h4d objects that you are replacing the sprites for.

You will be prompted to select three directories: 1) A directory where your .ora files are located, 2) a directory where your .h4d files are located, and 3) a directory to store the output (each file chooser will have a title to tell you which directory you are choosing if you forget).

The directory for .ora and .h4d files can be the same directory, but the output directory must be different.

Naming: If you have "actor_sequence.archangel.combat.melee.e.h4d", you will need "actor_sequence.archangel.combat.melee.e.ora" with the only difference being the extension.

All of the ora files will be imported into their respective h4d files and then saved to the specified output directory.

- I've finally added support for importing and exporting png files.

How it works: For exporting, each of the frames is drawn onto an image which is the size of the overall canvas, not just the size of the frame itself.

When importing, the H4 Resource Editor will expect each of the pngs being imported to be the size of the overall canvas with the frames drawn in the correct location.

.png files are more difficult to handle since they don't contain the offset info for each of the individual frames, so there will unfortunately need to be more restrictions on importing / exporting.

You will also need to make sure the png files are properly named (frame 001, frame 002, etc. for actor sequences and adventure objects).

User avatar
Pol
Admin
Admin
Posts: 9354
Joined: 29 Nov 2005
Location: IN SOMNIS VERITAS
Contact:

Re: H4ResourceEditor

Postby Pol » Nov 18 2020, 21:23

@iLiVeInAbOx05
Thanks, you need to remind me. I have just one head. And pretty busy sometimes. Added. ;)
"We made it!"
The Archives | Collection of H3&WoG files | Older albeit still useful | CH Downloads
PC Specs: A10-7850K, FM2A88X+K, 16GB-1600, SSD-MLC-G3, 1TB-HDD-G3, MAYA44, SP10 500W Be Quiet

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 611
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Nov 18 2020, 22:20

Pol wrote:@iLiVeInAbOx05
Thanks, you need to remind me. I have just one head. And pretty busy sometimes. Added. ;)


Thanks Pol!

Might I request a sticky here as well? ;)

Also just added another small update:

- Can now preview battlefield_preset_maps.

- Can now preview (many) combat_objects.

User avatar
Pol
Admin
Admin
Posts: 9354
Joined: 29 Nov 2005
Location: IN SOMNIS VERITAS
Contact:

Re: H4ResourceEditor

Postby Pol » Nov 19 2020, 7:30

Stickied ;)
"We made it!"
The Archives | Collection of H3&WoG files | Older albeit still useful | CH Downloads
PC Specs: A10-7850K, FM2A88X+K, 16GB-1600, SSD-MLC-G3, 1TB-HDD-G3, MAYA44, SP10 500W Be Quiet

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 611
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Nov 19 2020, 16:43

Pol wrote:Stickied ;)


Thanks Pol!

Added the viewing panels for battlefield_preset_maps and combat_objects, so those can be opened up to look at their other info now (though I may have forgotten to upload to google drive).

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 611
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Nov 23 2020, 4:28

More updates:

- battlefield_preset_maps are now viewable and editable (I haven't tested importing, but it should work).

- combat_objects are now viewable and editable (same as above, I haven't actually tested swapping out images). There are some combat objects that I can't open at the moment, so there is more work to be done there.

- Added threading for some of the bigger tasks like the mass import feature and importing a folder of png's.

- Finally discovered what the end of file offsets for adventure objects represents. Basically, these offsets correspond to the 3-dimensional height of the object. A larger negative number means a larger 3-dimensional height. A value of 0 means it is flat on the ground.

Each offset applies from left to right across the object, and helps the game determine which object should display on top when objects overlap.

- Got major / minor / sub type codes mapped to their names for the adventure objects in heroes.h4r. This and figuring out the offsets are two big steps toward creating objects from scratch.

I think after I make the footprint size editable, we will be extremely close to creating objects from scratch.

- Castle objects are now viewable. These contain the various offsets for various parts of the castles.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 611
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Dec 5 2020, 4:15

The H4 Resource Editor has been updated again (link in the original post).

What's new?

- New Mod Manager feature. This particular feature is still pretty new and doesn't have a lot of functionality, but it's intended to help package various mod files (h4r). For example, Karmakeld's object package has been included and the mod manager can pack it into new.h4r, which you can then place into the data folder.

If you have your own h4r file, you can package yours and Karmakeld's object file into a single h4r file to place into the data folder (you would need to put your h4r file in the mod directory of your H4ResourceEditor installation).

The plan is to eventually be able to pack up any number of h4r files with different types of objects, create new.h4r, and install it into the data folder for you.

Also, there will be restrictions on what you should and should not put into an h4r file that you place into the mod folder, since packaging up multiple h4r files can have conflicts if the same file is in both places. Currently I have only very basic outlines for this, but as I get further with this feature I will be able to provide a better outline for the format.

Basically any h4r to be placed in the mod folder should be for associated types of files, such as files needed to replace a creature, or files needed to replace a town screen and the buildings for example.

- Town screen viewing and editing has been implemented.

How it works: Open up heroes4.h4r and expand layers, town, faction. For whichever faction you expanded, double click the "layout" layer file. It might take a few seconds, but the town screen with all of the buildings will pop up. Make the window full screen to get a better view.

You can switch between the different backgrounds, and you can edit the location of the buildings by selecting the building or shadow and then updating the number spinners. You will see the building move on screen.

You can extract backgrounds here (a couple options for this), or extract the buildings layer (using File->save).

You can import your own background town screen. I haven't yet included an option to import the same background to the town screen for each terrain, so you have to do it one at a time if you want to use the same one for all. These can be png or ora.

You can import your own buildings now, and use the number spinners to move them where you want them. These can also be png or ora. If png, you should make sure the png is the size of the background image with your building placed at the correct location. Otherwise it will be placed at 0, 0 (top left corner) and you will need to use the number spinners to move it in place.

Note. if the building you are trying to replace has an animation, then when you view the town in game the old object will appear (because the animation is displaying).

There is still more work and testing to be done to see if packing an empty animation.h4d file (meaning an image consisting of all transparency) will override the one in heroes4.h4r so that nothing shows.

Of course, if someone wanted to help out and test that out, I would appreciate it :D

- The footprint for adventure objects can now be changed. Caveat on the footprint size being adjustable: Namerutan never got around to figuring out the size of the passability / interactivity mask array for objects with 5x2 and 2x5 footprints, so if you happen to resize to one of those, the resource editor will throw an exception and you may need to restart it. At the very least you'll need to reopen the adventure object.

Bug Fixes:

- So I found a color Quantizing algorithm that seems to be significantly better than the first one I found, and I've updated to use that one now.

The old one had trouble quantizing larger numbers of colors, so it had trouble quantizing images such as Nimostar's pirate town screen.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 611
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Dec 6 2020, 6:48

Just put out another small update:

- Added the ability to update combat actor action groups (the names of the actor sequences for various actions such as melee, ranged, spell_cast, etc.)

- Added the ability to rename individual layers in layers type objects. Simply open up the layers file, switch the combo box to the layer you want to update the name for, edit the text in the combo box to what you want, and hit enter.

At the moment the combo box will default back to the first element, but that's a minor annoyance that I'll look into. (Just fixed this minor annoyance as well).

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 611
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Dec 6 2020, 19:20

Edit. For anyone that was interested, I pushed all of my changes to the open source repository (link in the original post).

***********************************************************************

Another small update:

- Added the ability to update adventure action groups (the names of the actor sequences for various actions on the adventure map).
Last edited by iLiVeInAbOx05 on Dec 7 2020, 3:55, edited 1 time in total.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 611
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Dec 16 2020, 16:25

Another small update:

- Added support for viewing and modifying table and strings files.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 611
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Dec 30 2020, 20:30

Small update:

- For the mod manager feature, added a check box to install the packed new.h4r file into the H4 data directory when checked, and added another check box to launch the game when checked.


Return to “Heroes I-IV”

Who is online

Users browsing this forum: No registered users and 5 guests