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: 598
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Sep 7 2018, 3: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: 1117
Joined: 12 Nov 2011

Re: H4ResourceEditor

Postby Karmakeld » Sep 9 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: 598
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Oct 30 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: 598
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Feb 18 2019, 16:28

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

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

Re: H4ResourceEditor

Postby Karmakeld » Feb 18 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 Feb 18 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: 598
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » May 8 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: 1117
Joined: 12 Nov 2011

Re: H4ResourceEditor

Postby Karmakeld » May 12 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: 598
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » May 13 2019, 4: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: 598
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » May 29 2019, 2: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: 598
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » May 30 2019, 3: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: 1117
Joined: 12 Nov 2011

Re: H4ResourceEditor

Postby Karmakeld » Oct 5 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

Postby Sir Beormin » Mar 23 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-4-modding-open-source
Shout out to iLiVeInAbOx05

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

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Mar 24 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: 598
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Oct 18 2020, 2: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: 598
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Oct 18 2020, 5: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: 598
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Oct 25 2020, 4: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 Oct 25 2020, 6:14, edited 1 time in total.


Return to “Heroes I-IV”

Who is online

Users browsing this forum: No registered users and 11 guests