H4ResourceEditor

The old Heroes games developed by New World Computing. Please specify which game you are referring to in your post.
User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 07 Sep 2018, 03:26

So it seems simply unsetting the info at the end of the file will cause the object to always appear behind others, so that info at the end of the file has something to do with how to display the object's image partially above / below another object, in addition to somewhere including the canvas size. Still more research to do here.

Another quick update. I have been able to create a .ora file and open it with gimp, but I believe I need to "crop" each of the layers so that the .png file for each layer is the size of the layer, and not the size of the canvas with the layer in its proper place.

After that, I need to figure out the issue I've been having with parsing the alpha data because this will affect what is exported.

Importing should work fine, since I can correctly use the alpha data there when packing it into H4 format.

After more work I got it working when using the layer size for the png file of each layer, so next is either working on importing a .ora file or finally figuring out what is going wrong with parsing the alpha data!

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1126
Joined: 12 Nov 2011

Re: H4ResourceEditor

Unread postby Karmakeld » 09 Sep 2018, 20:48

I will try to help look into the end file info's soon...
looking so much forward to being able to import ora and make animated objects :D
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground

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

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 30 Oct 2018, 18:46

Support for importing .ora files was the next task selected for implementation.

Currently I have imported a .ora file that Namerutan's program exported, to an object and it was (mostly) successful at least as far as my program is concerned. I haven't yet tested dropping the object on a map for use because right now the shadows didn't seem to make it in, so I'll have to take a look at that but it should be a simple bug to find / fix.

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

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 18 Feb 2019, 16:28

Original post updated to include a download link for the H4 Resource Editor.

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1126
Joined: 12 Nov 2011

Re: H4ResourceEditor

Unread postby Karmakeld » 18 Feb 2019, 20:01

Great to see it released for the public. That took about a year, still :applause: :tsup: hoping others will find it useful.
Also I'll post a news article about it's release.. fyi..
Last edited by Karmakeld on 18 Feb 2019, 20:01, edited 1 time in total.
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground

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

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 08 May 2019, 15:42

OP updated with link to the latest H4 Resource Editor.

- Added major and minor type mappings so that the correct minor types are loaded when selecting a specific major type (Fields changed from text to combo boxes)
- Fixed a bug which broke the "update" button
- Added the ability to open adventure objects when the selected file filter is "obj" or "all files".

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1126
Joined: 12 Nov 2011

Re: H4ResourceEditor

Unread postby Karmakeld » 12 May 2019, 18:57

Great. We'll have a news update about this I guess.
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground

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

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 13 May 2019, 04:53

OP updated with the link to the latest H4 Resource Editor.

- Fixed a memory issue when opening large files, such as heroes4.h4r

Not everyone had this issue when trying to open heroes4.h4r. It seemed to be an issue on machines with a smaller amount of memory available, and I was using a method that I later found out was not intended for large files.

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

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 29 May 2019, 02:56

OP Updated with the link to the latest.
- Updated to view the file list for an h4r file as a tree, instead of a list, to make searching for what you want more manageable.
- Added the ability to extract (save) any item from an .h4r file as a .h4d file
- Added a preview of the item selected (currently only works for adventure objects)

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

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 30 May 2019, 03:43

OP updated again with another small update.
- Removed the "Update" and "Close" buttons, so there is no more ambiguity with how to actually save your changes. Simply File->Save and any changes you made will be saved with the object.
- Finished moving over to the new mask parsing classes, which will make it easier to do the foot print stuff.

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1126
Joined: 12 Nov 2011

Re: H4ResourceEditor

Unread postby Karmakeld » 05 Oct 2019, 17:50

note possible typ-o: creature_dwelling -> saytr_dwelling, also curious as to why MegaDragon, Mermaid and SeaMonster dwellings aren't listed, as they're coded. And I think adding colors to the teleport/gateway numbers would be useful :)
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground

Sir Beormin
Leprechaun
Leprechaun
Posts: 1
Joined: 05 Apr 2019

Re: H4ResourceEditor

Unread postby Sir Beormin » 23 Mar 2020, 10:08

To anyone who's interested in the source code and maybe wants to contribute, a Git repository has recently been published: https://gitlab.com/iLiVeInAbOx05/heroes ... pen-source
Shout out to iLiVeInAbOx05

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

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 24 Mar 2020, 17:41

To add, this repository also contains the H4 Advanced Options Map Editor. I copied my private repository and made it open for all to look at.

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

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 18 Oct 2020, 02:12

I've updated the H4 Resource Editor to handle actor_sequence objects (contain the sprites for the various creatures). Download link in the original post.

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

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 18 Oct 2020, 05:48

I have a new update: I've fixed the alpha (transparency) bug with exporting images! That bug owned me for so long, so it's great to finally have it out of the way!

Fixing this bug also enabled me to use the correct transparency when showing the selected sprite. The current background color makes it look like pixels are missing, but they are not.

I also did a little test since this is now working. I opened up bandit combat east, exported the image set as .ora, then opened bandit combat west, imported the .ora from east, saved the h4d file, and placed it in the data folder.

When fighting with bandits facing to the west, the animation for the east attack shows :D

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

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 25 Oct 2020, 04:21

I've uploaded the latest version of the H4 Resource Editor.

What's new:
- You can now extract an entire actor_sequence to a directory of your choice. For example, open up heroes4.h4r, expand the actor_sequence node, then right click on a unit node, and select extract sequence. You will be prompted to select a directory to save in (make sure the directory for the unit you are extracting does not exist there).

- I've added file type associations to make it easier to view and edit h4 resource files. Simply double click on an h4r or h4d file and choose H4ResourceEditor.bat as the default program to open these file types (you'll have to navigate to your H4ResourceEditor folder). Now double clicking these file types will start up a new instance of the H4 Resource Editor and open them. Note. if you change the location of the H4ResourceEditor folder you will need to redo the file type association.

- I finally fixed the issue with displaying shadows and partial transparency for viewing in the H4 Resource Editor.

- Fixed a bug where the resource editor couldn't display a sprite where the frames were named "frame 1 2" instead of "frame 001 002"
Last edited by iLiVeInAbOx05 on 25 Oct 2020, 06:14, edited 1 time in total.

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

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 31 Oct 2020, 01:50

Another update has been added (same link in the original post).

Bug fixes:
- Fixed an issue when importing an image caused shadows to not display.

- Fixed a bug where the sprite would display over the footprint when importing an image.

Quality of life updates:
- The H4 Resource Editor will now remember the last used directory.

- Default file filter is h4d

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

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 15 Nov 2020, 20:51

Just added a pretty big update for the H4 Resource Editor.

What's new?

- You can now view and edit layers files.

- You can now view and edit bitmap raw files (you'll need to package these into new.h4r or new_mod.h4r for Equilibris and place it in the data folder if you want to see a new main menu screen).

- You can play and modify sounds (these all need to be packed into an h4r file as mentioned above and placed into the data folder to hear changes in game).

- You can now package h4r files. You can either create a new h4r file with File->New and then use File->Add to add an h4d file, or open another h4r file and use File->Add. Make sure to File->Save As after with the h4r extension selected. Note. At the moment I would not use this to try repacking heroes.h4r or other h4r files that have file redirection (links), as I haven't tested that and it probably won't work.

- There is now an Advanced menu option, with a menu item called "Package Creature." This is for those who would like to reskin creatures or heroes. What this will do is let you select a directory with the following file structure:

-selected directory
--icons
--sprites
--sounds

Under the icons directory you'll want an extracted copy of layers.icons.creatures.52 and layers.icons.creatures.82, and you can include png files of any updated unit portraits. The png files should be named after the creature who's portrait you would like to replace, ie. "air elemental.png"

The sprites directory should include any actor sequences (sprites) for creatures or heroes.

The sounds folder can include .wav or .mp3 files for the creature / hero sounds. These should also be named the same as the sound you would like to replace. .wav files should be 22050 sample rate (might be okay to use others but I haven't tested) and can be mono or stereo. .mp3 files should be 44100 sample rate.

The combat actor file for your unit(s) should go in the top level directory (at the same level as the icons, sprites, and sounds folders).

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

Re: H4ResourceEditor

Unread postby Pol » 16 Nov 2020, 17:57

So, where we can download it?

Do you plan to update the public git also?
https://gitlab.com/iLiVeInAbOx05/heroes ... pen-source
"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: 773
Joined: 21 Jul 2014

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 16 Nov 2020, 18:26

Pol wrote:So, where we can download it?

Do you plan to update the public git also?
https://gitlab.com/iLiVeInAbOx05/heroes ... pen-source
Hi Pol. The beginning of the original post here has a link in it to the latest version.

I do plan to eventually update the public git, but I have some work to do still.

Sir Boermin was nice enough to contribute some parsing classes for different types of resource objects, so I need to finish getting through all of Namerutan's documentation first to find the overlap before bringing all of my changes over to the public repository.

Namerutan left some very nice and detailed documentation for most, but not all, of the files. So I want to finish creating the parsing classes based on Namerutan's notes, then find the stuff Boermin worked on which Namerutan did not document, and finally I will get the public git repository updated.


Return to “Heroes I-IV”

Who is online

Users browsing this forum: No registered users and 11 guests