H4ResourceEditor
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: H4ResourceEditor
Okay so I think I've got importing mp3's settled for real this time.
The field I didn't know was already known and I either meant to come back around and finish it up, or just missed it here.
The field is the decoded length in bytes of all samples in the file. So, by getting the duration of the file in seconds and multiplying it by the sample rate and 4, you get the number of bytes. (multiplying by 4 since 32 bits per sample is 4 bytes per sample). I'm now figuring out what the bits per sample for the imported track is in case it's different than the usual 32 bits per sample.
The only thing I need to figure out is getting the number of channels from the mp3 library I'm using since it just has a string with channel names instead of just a number of channels. Might be overthinking that, but I don't really know much about music format so right now it's just assuming Stereo (2 channels).
I should probably test out .wav files again just to make sure I didn't break anything there, but then I'll upload the updated resource editor with fixed importing of mp3's
The field I didn't know was already known and I either meant to come back around and finish it up, or just missed it here.
The field is the decoded length in bytes of all samples in the file. So, by getting the duration of the file in seconds and multiplying it by the sample rate and 4, you get the number of bytes. (multiplying by 4 since 32 bits per sample is 4 bytes per sample). I'm now figuring out what the bits per sample for the imported track is in case it's different than the usual 32 bits per sample.
The only thing I need to figure out is getting the number of channels from the mp3 library I'm using since it just has a string with channel names instead of just a number of channels. Might be overthinking that, but I don't really know much about music format so right now it's just assuming Stereo (2 channels).
I should probably test out .wav files again just to make sure I didn't break anything there, but then I'll upload the updated resource editor with fixed importing of mp3's
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: H4ResourceEditor
Went ahead and updated the resource editor (link in original post).
Fixed importing and exporting mp3's.
Fixed importing and exporting mp3's.
- Grythandril
- Leprechaun
- Posts: 19
- Joined: 06 Jan 2006
- Location: Grythandril
Re: H4ResourceEditor
Hi still having problems
Donloaded the latest progam
tried to change 2 tracks combat 5 and grass by imporing the mp3
I then save as h4r file
but when i open it up in in H4ResourceEditor it wont play
what am i doing wrong?
Donloaded the latest progam
tried to change 2 tracks combat 5 and grass by imporing the mp3
I then save as h4r file
but when i open it up in in H4ResourceEditor it wont play
what am i doing wrong?
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: H4ResourceEditor
Grythandril wrote: ↑17 Jul 2023, 22:13 Hi still having problems
Donloaded the latest progam
tried to change 2 tracks combat 5 and grass by imporing the mp3
I then save as h4r file
but when i open it up in in H4ResourceEditor it wont play
what am i doing wrong?
Again, please upload the files somewhere, specifically the mp3's you're trying to import, so that I can access them and figure out what's going on. I can't help you if I can't see the problem. If the tracks won't play in the resource editor, then I feel like you're not actually using the latest.
What exactly are you doing? Try listing out all of the steps you are taking, starting with which file you are opening first. Are you using file association with H4ResourceEditor.bat, so that you can double click h4r / h4d files to open them easier? Or are you double clicking H4ResourceEditor.jar and then File->Open to open music.h4r?
If you're opening the h4r file, and then opening the music track from there, are you remembering to save the h4d file after importing your mp3? You need to create the modded h4d files that you then pack into new.h4r (new_mod.h4r for Equilibris). Then you put a copy of your new.h4r / new_mod.h4r into your data folder and it will work.
I just imported a bunch of Lord of Magic mp3 tracks to all combat and town tracks, as well as the main menu, and they all worked just fine.
- Grythandril
- Leprechaun
- Posts: 19
- Joined: 06 Jan 2006
- Location: Grythandril
Re: H4ResourceEditor
will do and give a step by step list of what i am doing
One question - when you uploaded your new music files are you meant to keep to the same length as orginal heroes 4 music files?
One question - when you uploaded your new music files are you meant to keep to the same length as orginal heroes 4 music files?
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: H4ResourceEditor
Grythandril wrote: ↑18 Jul 2023, 07:11 will do and give a step by step list of what i am doing
One question - when you uploaded your new music files are you meant to keep to the same length as orginal heroes 4 music files?
Nope, file length and track length don't matter. I just downloaded all the Lords of Magic faction, battle, adventure map, and menu themes and imported them into the town, battle, adventure map, and menu h4d files.
- Grythandril
- Leprechaun
- Posts: 19
- Joined: 06 Jan 2006
- Location: Grythandril
Re: H4ResourceEditor
I manage to get this done but not sure if that was the right process
This is the steps I took
1. Downloaded latest H4sresourceEditor program
2. Put H4sresourceEditor into my documents folder
3. Created new sound files for the H4
4. Made sure .Mp3 file are 32bit,128kbps & bit rate of 44100hz like originals.
5. Renamed new according to the file name of H4
H4 file name--------------------------Music from
sound.combat.lose-------------------Heroes 4 original
sound.combat.music.1--------------Heroes 4 original
sound.combat.music.2-------------- Heroes 4 original
sound.combat.music.3--------------Heroes 4 original
sound.combat.music.4--------------Heroes 3 combat 2
sound.combat.music.5--------------Heroes 1 combat 1
sound.combat.music.6--------------Heroes 6 Haven Siege
sound.combat.start------------------Heroes 4 original
sound.combat.win--------------------Heroes 4 original
sound.credits--------------------------Heroes 6 Credits 02
sound.end_turn-----------------------Heroes 1 & Heroes 2 AI turn
sound.main_menu--------------------Heroes 4 original
sound.terrain.Dirt--------------------Heroes 2 Dirt
sound.terrain.grass------------------Heroes 4 Wandering (unused)
sound.terrain.Rough-----------------Heroes 2 Rough
sound.terrain.Sand-------------------Might & Magic Heroes Online Fang bay Harbour
sound.terrain.Snow------------------Heroes 4 Shades of Darkness Snow
sound.terrain.Subterranean------- Heroes 6 Underground
sound.terrain.Swamp--------------- Heroes 6 Swamp 02
sound.terrain.Volcanic--------------Heroes 2 Lava
sound.terrain.Water-----------------Heroes 4 original
sound.town.chaos--------------------Heroes 3 Dungeon
sound.town.death--------------------Heroes 3 NecroTown
sound.town.life ----------------------Heroes 6 Haven
sound.town.might--------------------Heroes 6 Stronghold
sound.town.nature-------------------Heroes 5 preserve
sound.town.order--------------------Heroes 5 End credits
6. Double click to Open H4ResourceEditor
7. Click file
8. Click New an select H4r container press ok
9. This creates a new.h4r directory
10. Click File then Add and change to all file types select all the mp3
11. Click save
12. this will create a sub directories for the music names.
13. Click file and save
14. Save as new.h4r
15. I had to close down the program as it would not open each music name
16. Double click to Open H4ResourceEditor again
17. Click file
18. Click Open and changed file type to .h4r and selected new.h4r and clicked open
19. Clicked each track file in the directory
20. Right Click and click open
21. A popup box appears with the sound file name in .h4d
Press Play to make sure the you hear the sound
If you do then click file save as .h4d
22. If sound does not play then
click file then import sound and select required mp3 and click open
Press Play to make sure the you hear the sound
if you hear music the click file save as filename.h4d
23. Keep doing this until all tracks are save as h4d
24. For some reason the original heroes mp3 work when doing (step 21)
25. For new music tracks I had to follow (step 22)
26. I made sure the file names were the same in the pop box for each music track.
27. Once all the h4d are loaded in
28. I save the file as music.h4r
29. Then moved them into the data folder in the game
but thanks
It great to hear different music tracks for heroes 4
This is the steps I took
1. Downloaded latest H4sresourceEditor program
2. Put H4sresourceEditor into my documents folder
3. Created new sound files for the H4
4. Made sure .Mp3 file are 32bit,128kbps & bit rate of 44100hz like originals.
5. Renamed new according to the file name of H4
H4 file name--------------------------Music from
sound.combat.lose-------------------Heroes 4 original
sound.combat.music.1--------------Heroes 4 original
sound.combat.music.2-------------- Heroes 4 original
sound.combat.music.3--------------Heroes 4 original
sound.combat.music.4--------------Heroes 3 combat 2
sound.combat.music.5--------------Heroes 1 combat 1
sound.combat.music.6--------------Heroes 6 Haven Siege
sound.combat.start------------------Heroes 4 original
sound.combat.win--------------------Heroes 4 original
sound.credits--------------------------Heroes 6 Credits 02
sound.end_turn-----------------------Heroes 1 & Heroes 2 AI turn
sound.main_menu--------------------Heroes 4 original
sound.terrain.Dirt--------------------Heroes 2 Dirt
sound.terrain.grass------------------Heroes 4 Wandering (unused)
sound.terrain.Rough-----------------Heroes 2 Rough
sound.terrain.Sand-------------------Might & Magic Heroes Online Fang bay Harbour
sound.terrain.Snow------------------Heroes 4 Shades of Darkness Snow
sound.terrain.Subterranean------- Heroes 6 Underground
sound.terrain.Swamp--------------- Heroes 6 Swamp 02
sound.terrain.Volcanic--------------Heroes 2 Lava
sound.terrain.Water-----------------Heroes 4 original
sound.town.chaos--------------------Heroes 3 Dungeon
sound.town.death--------------------Heroes 3 NecroTown
sound.town.life ----------------------Heroes 6 Haven
sound.town.might--------------------Heroes 6 Stronghold
sound.town.nature-------------------Heroes 5 preserve
sound.town.order--------------------Heroes 5 End credits
6. Double click to Open H4ResourceEditor
7. Click file
8. Click New an select H4r container press ok
9. This creates a new.h4r directory
10. Click File then Add and change to all file types select all the mp3
11. Click save
12. this will create a sub directories for the music names.
13. Click file and save
14. Save as new.h4r
15. I had to close down the program as it would not open each music name
16. Double click to Open H4ResourceEditor again
17. Click file
18. Click Open and changed file type to .h4r and selected new.h4r and clicked open
19. Clicked each track file in the directory
20. Right Click and click open
21. A popup box appears with the sound file name in .h4d
Press Play to make sure the you hear the sound
If you do then click file save as .h4d
22. If sound does not play then
click file then import sound and select required mp3 and click open
Press Play to make sure the you hear the sound
if you hear music the click file save as filename.h4d
23. Keep doing this until all tracks are save as h4d
24. For some reason the original heroes mp3 work when doing (step 21)
25. For new music tracks I had to follow (step 22)
26. I made sure the file names were the same in the pop box for each music track.
27. Once all the h4d are loaded in
28. I save the file as music.h4r
29. Then moved them into the data folder in the game
but thanks
It great to hear different music tracks for heroes 4
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: H4ResourceEditor
Grythandril wrote: ↑22 Jul 2023, 17:07 I manage to get this done but not sure if that was the right process
Looking at your process I'm not sure how you got it to work, though it isn't your fault. There isn't a nice written how-to-use write up for the h4 resource editor. The way you should be doing things is as follows:
1) Open music.h4r and extract the h4d files for the tracks you want to replace. Ie expand the node tree and right click on sound.combat.music.4, and extract it to the directory of your choice.
2) For each of the h4d files you extracted, do the following: Open the h4d file. I use file association so I can just double click the h4d file to open it. If you're not using file association you'll need to use the resource editor, File->Open and select the h4d file. Once the music file is open, from the music file window File->import sound. Select the mp3 file you want for the sound. File->Save.
2.5) After you have done the import AND saved for the new mp3 file, you can click "play" to hear the track. There may be a bug where playing it directly after import won't let you save over the file when File->Saving, so check them after you have imported AND saved the sound files.
3) After you have done the previous for each of the h4d files you are replacing, create a new h4r file. File->New in the h4 resource editor, select h4r container.
4) File->Add each of the updated h4d files. If they are all in the same directory, you can ctrl + click each file in the file chooser dialogue.
5) File->Save as new.h4r
6) Place new.h4r in the Data folder and profit.
- Grythandril
- Leprechaun
- Posts: 19
- Joined: 06 Jan 2006
- Location: Grythandril
Re: H4ResourceEditor
i did what you suggested and it worked which was easier than the way was doing it
However i noticed that when you replace the sound file file you have to save it as a new h4d file because it will not overwrite the existing one.
So i was able to change the terrain music with heroes II terrain music and change the towns music to heroes III music.
Thanks
Much apprreciated
However i noticed that when you replace the sound file file you have to save it as a new h4d file because it will not overwrite the existing one.
So i was able to change the terrain music with heroes II terrain music and change the towns music to heroes III music.
Thanks
Much apprreciated
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: H4ResourceEditor
Grythandril wrote: ↑25 Jul 2023, 20:13 i did what you suggested and it worked which was easier than the way was doing it
However i noticed that when you replace the sound file file you have to save it as a new h4d file because it will not overwrite the existing one.
So i was able to change the terrain music with heroes II terrain music and change the towns music to heroes III music.
Thanks
Much apprreciated
Yeah, if you played the sound right after importing it, instead of saving first, I believe that locks the file for some reason. It could be something else though, since I haven't really tried to figure it out yet. I always save right after importing. Hmm, or maybe it's because I don't save the files in the same place. I keep a directory for the un-modded h4d files and a directory for the updated h4d files to make it easy for me to redo anything I need to.
I'll pay closer attention to this issue when I update my Lords of Magic music mod and see if I can at least figure out what's causing it. Then there's also a Final Fantasy music mod I'll be putting together
Either way, glad the resource editor was able to help you get your desired music tracks into the game!
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: H4ResourceEditor
Hello!
The resource editor has been updated.
- The resource editor has been updated to no longer require users to install Java. The necessary JRE is now included with the resource editor, and the main jar file is now wrapped by an exe. This means that everything is ready to go once you download and unpack the resource editor.
- Updated to use the system look and feel. No more default Java (metal) look and feel.
- Added text coloring indicators. Blue text indicates the file is a redirection to another file. Red text indicates a missing file or bad format.
- Many other minor fixes and updates.
The resource editor has been updated.
- The resource editor has been updated to no longer require users to install Java. The necessary JRE is now included with the resource editor, and the main jar file is now wrapped by an exe. This means that everything is ready to go once you download and unpack the resource editor.
- Updated to use the system look and feel. No more default Java (metal) look and feel.
- Added text coloring indicators. Blue text indicates the file is a redirection to another file. Red text indicates a missing file or bad format.
- Many other minor fixes and updates.
Re: H4ResourceEditor
Hey, not sure if still is still alive since I stumbled upon this only today, but for some reason H4ResourceEditor still requires Java Runtime Enviroment 1.8.0_0 - 1.8.0_381.
Also unrelated to this, but the site heroescommunity is dead? I can't access it, I have blank white page with: Access denied for user ''@'localhost' (using password: NO)
The only thing I wanted from this is to change hero portraits, in the past(like 5 years ago), I used H4fk095 from http://modhomm3.free.fr/heroes4/h4_face_kit.htm , but today I can't seem to run it, it just tells me: Name length is overflow!
Any help would be much appreciated!
Also unrelated to this, but the site heroescommunity is dead? I can't access it, I have blank white page with: Access denied for user ''@'localhost' (using password: NO)
The only thing I wanted from this is to change hero portraits, in the past(like 5 years ago), I used H4fk095 from http://modhomm3.free.fr/heroes4/h4_face_kit.htm , but today I can't seem to run it, it just tells me: Name length is overflow!
Any help would be much appreciated!
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: H4ResourceEditor
That's very odd. When I run the resource / advanced editors on my desktop, which does not have any Java installed, they start up right away and work as expected.
Do you have any more information here? Do you have the latest version with an exe instead of a jarfile? What happens when you double click the exe? Screenshots?
It does still use Java 1.8, but the jre is packaged up and distributed along with the resource editor.
HeroesCommunity does seem to still be down. It's been down for a few days now.
I don't know anything about facekit, but the resource editor can easily update / edit portraits. Just extract the hero portraits files and then it depends on your workflow preference.Rejko97 wrote: ↑21 Jun 2024, 18:46 The only thing I wanted from this is to change hero portraits, in the past(like 5 years ago), I used H4fk095 from http://modhomm3.free.fr/heroes4/h4_face_kit.htm , but today I can't seem to run it, it just tells me: Name length is overflow!
Any help would be much appreciated!
If you just want to change a few portraits, you should be able to insert single png files. As long as you use the same name as the layer, it should overwrite the current portrait. Then make sure to save.
The other way is to export either as ora or png, modify the portraits, and then import back into the layers file and save.
After that, create a new h4r file, File->New, add your layers file, save it (new.h4r for Wow, new_mod.h4r for Equi), and drop it in your data folder.
Re: H4ResourceEditor
Yes I have the latest version, although I downloaded the file again today and suddently it works with not java version error, no idea what or how it fixed itself by I'll take it haha.
So I've been fiddling with H4ResourceEditor for a few minutes and got a couple questions. If I want to replace portraits, do I need to do it only in heroes4.h4r? or also storm.h4r or where everywhere do I need to replace it. I've got the game from GOG if that matters. (And the path is I assume Layers, icons, hero and their respective faction right?)
HeroesCommunity it would be a shame if they were to shutdown the site, there was quite a lot of useful info about HOMM games.
So I've been fiddling with H4ResourceEditor for a few minutes and got a couple questions. If I want to replace portraits, do I need to do it only in heroes4.h4r? or also storm.h4r or where everywhere do I need to replace it. I've got the game from GOG if that matters. (And the path is I assume Layers, icons, hero and their respective faction right?)
HeroesCommunity it would be a shame if they were to shutdown the site, there was quite a lot of useful info about HOMM games.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: H4ResourceEditor
Maybe just a corrupted download!
You'll want to follow my instructions above for your question You normally don't want to mess with the game files so that you don't corrupt them, so you should create a new h4r file that you add your modded h4d files to (and name the h4r file correctly for the version you are playing: WoW or Equilibris). You only need your one new h4r file with any modded files inside.Rejko97 wrote: ↑23 Jun 2024, 14:27So I've been fiddling with H4ResourceEditor for a few minutes and got a couple questions. If I want to replace portraits, do I need to do it only in heroes4.h4r? or also storm.h4r or where everywhere do I need to replace it. I've got the game from GOG if that matters. (And the path is I assume Layers, icons, hero and their respective faction right?)
You do need to start with layers file that has all of the expansion portraits, so probably in one of the expansion h4r files. You'll be able to take a look before I have the time to verify
Let me know if you have any more questions!
Re: H4ResourceEditor
You know, life of old sites is pretty rough. Thankfully they are back.
"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
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
-
- Leprechaun
- Posts: 5
- Joined: 23 Aug 2024
Re: H4ResourceEditor
I'm trying to «fix» original vines because I would very much like to «bomb» them but they have footprint on the NE side so it's only possible to bomb both the building and the vines.
Here are my steps, what did I do wrong?
Open heroes4.h4r -> find adv_object.shrubs.Vines.01.h4d -> «Open» ->change footprint x y so that it's on the other side of the vine -> «Save» -> create new file -> add -> save as new_mod.h4r
These steps make equilibris 3.60b map editor crash as soon as it tries to display this vines sprite.
Same steps but save .h4r file under any other name - editor works fine, game says map file is corrupted.
Here are my steps, what did I do wrong?
Open heroes4.h4r -> find adv_object.shrubs.Vines.01.h4d -> «Open» ->change footprint x y so that it's on the other side of the vine -> «Save» -> create new file -> add -> save as new_mod.h4r
These steps make equilibris 3.60b map editor crash as soon as it tries to display this vines sprite.
Same steps but save .h4r file under any other name - editor works fine, game says map file is corrupted.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: H4ResourceEditor
Hi there! Glad to see you're using the resource editor!Zhulikkulik wrote: ↑23 Aug 2024, 20:43 I'm trying to «fix» original vines because I would very much like to «bomb» them but they have footprint on the NE side so it's only possible to bomb both the building and the vines.
Here are my steps, what did I do wrong?
Open heroes4.h4r -> find adv_object.shrubs.Vines.01.h4d -> «Open» ->change footprint x y so that it's on the other side of the vine -> «Save» -> create new file -> add -> save as new_mod.h4r
These steps make equilibris 3.60b map editor crash as soon as it tries to display this vines sprite.
Same steps but save .h4r file under any other name - editor works fine, game says map file is corrupted.
So, the map isn't playable even when you don't put an h4r file in your Data folder with your updated vine object? That makes it sound like there is an issue with the map first of all.
I'd have to take a look, but if the vines file has any height offsets, then updating the footprint could cause the object to be broken. If you want to test if that's what the issue is, simply check the isBackground checkbox. This will ignore all height offsets, but the object will always show underneath other objects.
If it is a height offset issue, then you'll need to add / remove height offsets until you find the correct number for the editor and game to be happy.
-
- Leprechaun
- Posts: 5
- Joined: 23 Aug 2024
Re: H4ResourceEditor
I haven't tried removing the .h4r file without removing the object from the map first. I was still thinking in terms of homm3/hota where sprites actually get baked into the map file and thought there's no reason to try this.iLiVeInAbOx05 wrote: ↑27 Aug 2024, 15:29
Hi there! Glad to see you're using the resource editor!
So, the map isn't playable even when you don't put an h4r file in your Data folder with your updated vine object? That makes it sound like there is an issue with the map first of all.
I'd have to take a look, but if the vines file has any height offsets, then updating the footprint could cause the object to be broken. If you want to test if that's what the issue is, simply check the isBackground checkbox. This will ignore all height offsets, but the object will always show underneath other objects.
If it is a height offset issue, then you'll need to add / remove height offsets until you find the correct number for the editor and game to be happy.
I'll try again and will also take a look at offsets later today after I come home, thanks for the info!
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: H4ResourceEditor
I guess I'm a little confused as to what you've actually tried. Here you said
So I thought that meant you used a different name for the h4r file with your modded object. With a name other than new_mod.h4r, the game would not read the h4r file in, and so the object would just be the normal vines object and the editor / game should have no issues loading the map.Zhulikkulik wrote: ↑23 Aug 2024, 20:43 Same steps but save .h4r file under any other name - editor works fine, game says map file is corrupted.
In the h4c files objects all have a filename that is used to find the object's h4d file in the various h4r files. No baked in sprite info. What can cause objects to make the map unable to be opened are those pesky height offsets in the object's h4d fileZhulikkulik wrote: ↑28 Aug 2024, 08:14I haven't tried removing the .h4r file without removing the object from the map first. I was still thinking in terms of homm3/hota where sprites actually get baked into the map file and thought there's no reason to try this.
I'll try again and will also take a look at offsets later today after I come home, thanks for the info!
Who is online
Users browsing this forum: No registered users and 1 guest