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: H4ResourceEditor
Thread: H4ResourceEditor This thread is 18 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 · «PREV / NEXT»
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted October 18, 2020 07:47 AM

Glad to see you're still around Baronus

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

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


Famous Hero
(Andruids for short)
posted October 20, 2020 03:26 AM

I recently used your tool to extract a few sprites from H4, iliveinabox. So thanks for your work!

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


Honorable
Famous Hero
posted October 20, 2020 05:59 AM bonus applied by Galaad on 23 Nov 2020.
Edited by iliveinabox05 at 02:50, 31 Oct 2020.

Edit 2. 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

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

Edit. 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"

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

AncientDruids said:
I recently used your tool to extract a few sprites from H4, iliveinabox. So thanks for your work!


Awesome, I'm glad to hear it!

If you find something not working, or can think of a feature that would be nice to add, please let me know here.

Currently I'm working on Combat Actor objects (contains the footprint size in combat, animation speed, and more). I've got all the code to open them up, just need to work on a panel to display / edit the info.

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


Honorable
Famous Hero
posted November 15, 2020 09:50 PM bonus applied by Galaad on 23 Nov 2020.

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

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


Responsible
Supreme Hero
posted November 18, 2020 12:21 AM

That is just so cool that SO MANY options has been added tp the editor. Good job helping modders ease their work
____________

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


Honorable
Famous Hero
posted November 18, 2020 04:37 AM
Edited by iliveinabox05 at 23:20, 18 Nov 2020.

Edit1. Just added another small update:

- Can now preview battlefield_preset_maps.

- Can now preview (many) combat_objects.

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

Karmakeld said:
That is just so cool that SO MANY options has been added tp the editor. Good job helping modders ease their work


Thanks Michael!

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

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


Adventuring Hero
Nothing is impossible
posted November 20, 2020 06:20 PM

I hope the menu can be in another language.
It would be better if the text of the menu could be read from TXT.

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


Honorable
Famous Hero
posted November 23, 2020 05:26 AM
Edited by iliveinabox05 at 17:02, 23 Nov 2020.

kkfkkkfk said:
I hope the menu can be in another language.
It would be better if the text of the menu could be read from TXT.


After I get the various features working, then I'll be able to tackle localization. Unfortunately that will likely take some time to do, so the features will come first.

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 multi-threading for some of the bigger tasks like the mass import feature and importing a folder of png's, which drastically reduces the time these processes take.

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

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


Hired Hero
posted November 25, 2020 07:06 PM

Quote:

- Got major / minor / sub type codes mapped to their names for the adventure objects in heroes.h4r. This and the 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.



It will be amazing progress towards improving game graphics. Go ahead, thanks for your effort.

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


Responsible
Legendary Hero
Modding the Unmoddable
posted November 25, 2020 08:06 PM

Is the option to rename l.ayers already added. ? ...
____________
Never changing = never improving

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


Honorable
Famous Hero
posted November 25, 2020 08:33 PM

mciric said:
It will be amazing progress towards improving game graphics. Go ahead, thanks for your effort.


Getting closer!

NimoStar said:
Is the option to rename l.ayers already added. ? ...


So that feature isn't in there yet, but the H4 Resource Editor can properly read layers files. It doesn't rename any of the layers when reading a layers h4d file, so whatever the h4d file has as the layer name is what it will be when you open it up and take a look. Those are also the names for layers used when exporting.

When you import, the layers are just named whatever you called them in the .ora file. I would have to take a look at what I did for importing folders of pngs, but I think I just stipulated that you should ensure the names are properly formatted, which doesn't really matter for layers.

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


Responsible
Supreme Hero
posted November 26, 2020 04:00 PM

NimoStar said:
Is the option to rename l.ayers already added. ? ...


Just curious, but what would be the purpose of this option?
All layer names are also stored in the exe, so renaming a layer would require a renaming in the exe aswell for it to be read, and a layers name in most cases aren't visable in the game.
Adding new layers will require a dll extension.
Creatures, artifacts and building I believe you can just rename in their proper txt file, so enlighten me here, as I'm missing the purpose.
____________

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


Honorable
Famous Hero
posted November 26, 2020 06:08 PM

Karmakeld said:
Just curious, but what would be the purpose of this option?
All layer names are also stored in the exe, so renaming a layer would require a renaming in the exe aswell for it to be read, and a layers name in most cases aren't visable in the game.
Adding new layers will require a dll extension.
Creatures, artifacts and building I believe you can just rename in their proper txt file, so enlighten me here, as I'm missing the purpose.


If I remember correctly, this was requested because Namerutan's tool didn't fully support layers files and would rename the first layer to frame 001 in some cases.

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


Responsible
Legendary Hero
Modding the Unmoddable
posted November 28, 2020 07:43 PM
Edited by NimoStar at 19:44, 28 Nov 2020.

The layers file is due to the layer name bug in namerutan's tool, which will wreck your file, and furthermore

It is not true all layers are codified in the exe

The artifact sellers for example (the ones inside towns as well as the single neutral one) can sell *any* artifact, it just depends on the name of the layer in the h4l file.

team spell books can also contain any spell, but it depends in the name of the layer in the spell icons file if it is displayed or not...

And so on.

So names of the layers adds huge flexibility and diminishes workload to rename everything manually with hex editors or GIMP (which are also RAM memory hogs) in the workflow, not to mention the prevention of a graphic-breaking bug.
____________
Never changing = never improving

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


Honorable
Famous Hero
posted December 03, 2020 09:37 PM
Edited by iliveinabox05 at 22:59, 04 Dec 2020.

Edit. Just a quick 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.

Just a quick update:

I did make the footprint for adventure objects resizable, but I haven't been able to figure out how to generate the correct number of height offsets needed for any particular adventure object. So, I decided to move onto something else for the moment.

I'm currently working on town screen viewing and editing. I am able to show the town screen backgrounds with the buildings drawn on top, and you can move the buildings around.

I'm currently working on getting import / export operations setup so that town screens can be replaced, as well as the buildings.

I have tested moving the buildings around, and that worked just fine.

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


Responsible
Supreme Hero
posted December 03, 2020 10:05 PM

Guess you could look into the renaming of layers next on
____________

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


Honorable
Famous Hero
posted December 05, 2020 05:13 AM bonus applied by Galaad on 19 Dec 2020.
Edited by iliveinabox05 at 06:26, 18 Jun 2021.

Edit 5. Small Update:

- Added a mass export feature for actor sequences. This is similar to the extract sequence feature, except it extracts the sprites for each actor sequence into ora files.
   - Fixed a bug in the mass export feature where the filenames did not remove the h4d extension before appending the ora extension.

- Added mega dragon, mermaid, and sea monster to the list of dwelling options.

Bug fixes:

- Fixed a bug where loading an object in the resource frame did not update the title to the name of the file that was opened.

- Fixed a bug where any frame with "animation" in it was getting set to blending mode 0, when it should have been "animation_offset"

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

Edit 4. 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.

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

Edit3. Latest update:

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

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

Edit2. Another small update:

- Added the ability to update adventure action groups (the names of the actor sequences for various actions on the adventure map).

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

Edit1. Just put out another small update:

- Added the ability to update combat actor action groups (the names of the actor sequences for various actions in combat 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).


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

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). The animations need to be replaced as well.

- The footprint for adventure objects can now be changed. See my caveat in my previous post.

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.

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


Legendary Hero
posted June 18, 2021 08:30 PM

Great! And selection is important too. Sellect alll. Select by name. Select by extension. Select some etc.

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


Honorable
Famous Hero
posted July 16, 2021 12:22 AM
Edited by iliveinabox05 at 18:12, 19 Jul 2021.

Next big update!

Features:
- Implemented mass extraction for any object type via right clicking the node in question, and selecting "mass extract"

- Implemented mass exporting of .ora files at the object type level. So you can export .ora files for actor_sequence and adv_obj. I plan to extend this feature to any object type that contains a sprite.

- Implemented mass exporting of png folders. Like the mass exporting .ora feature, but for pngs instead. This will create a directory named after the object being exported from, and in that directory will be the png files named for their layer.

- Implemented mass importing of folders containing the layers as png files. Works like mass importing for ora format, but the directory containing the png files must be named the same as the h4d object you wish to import into.


Bug Fixes:
- Fixed a bug with animation objects where sometimes the additional offsets can still be present when the bit map layer field is 0x01.

- Fixed a bug for mass extracting actor_sequence.hero where having two sequences with the same name but different cases was causing issues (Windows no likey same directory name with different cases).

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


Adventuring Hero
posted July 16, 2021 01:28 PM

iliveinabox05 said:
Next big update!

Features:
- Implemented mass extraction for any object type via right clicking the node in question, and selecting "mass extract"

- Implemented mass exporting of .ora files at the object type level. So you can export .ora files for actor_sequence and adv_obj. I plan to extend this feature to any object type that contains a sprite.

- Implemented mass exporting of png folders. Like the mass exporting .ora feature, but for pngs instead. This will create a directory named after the object being exported from, and in that directory will be the png files named for their layer.

- Implemented mass importing of folders containing the layers as png files. Works like mass importing for ora format, but the directory containing the png files must be named the same as the h4d object you with to import into.


Bug Fixes:
- Fixed a bug with animation objects where sometimes the additional offsets can still be present when the bit map layer field is 0x01.

- Fixed a bug for mass extracting actor_sequence.hero where having two sequences with the same name but different cases was causing issues (Windows no likey same directory name with different cases).


That sounds very exciting !! I haven't tried to use it yet, I struggle with wether to install java or not (with the whole security weakness thing with Java), but still I find all the work that goes into the tool creation and the mods it allows t omake insane <3 !

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 18 pages long: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1077 seconds