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 ]
New Server | HOMM1: info forum | HOMM2: info forum | HOMM3: info forum | HOMM4: info forum | HOMM5: info forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 4 - Lands of Axeoth > Thread: [TUT] Make and use unlimited independent mods - No overwrites
Thread: [TUT] Make and use unlimited independent mods - No overwrites
NimoStar
NimoStar


Promising
Famous Hero
Modding the Unmoddable
posted September 30, 2016 04:59 AM bonus applied by kiryu133 on 30 Sep 2016.
Edited by NimoStar at 05:03, 30 Sep 2016.

[TUT] Make and use unlimited independent mods - No overwrites

[First, I would like to say something: I doubted if making a new thread, because I have already made a lot of them and almost nobody posts here. However I decided to open this new topic because if simply put on one of the modding already opened, nobody would notice. And I want to contribute to the community so that everyone knows how to make their own mods that do not overwrite any other mods or the original game. Specially as it is rather simple.]

Note: This topic doesn't deal on the specifics of how to mod things in the game. The modding topics are for that. This topic covers file types and their contents.

In a more particular way, this topic deals with the general ability to make mods separate from the original game and eachother, in the way they will not overwritte any other mod at all.

You can have unlimited different mods in a single installed Heroes 4 folder this way, and none will overwrite anything from the others or from the original game. You launch them separately from their executable files!

We will be using codes from Equilibris 3.51 as example (3.55 is almost the same, except it aditionally uses a campaign .dll and a separate text .h4r) - but new mods will NOT carry on the non-exe characteristics of equilibris (objects, etc.) unless you would specifically include them.

My tutorial is based on hex editing. I used Hex Editor Neo (it has a free version) for the demonstrations. it is good for this because it can search for ANSI characters in a file (plain text) and modify them directly. You don't need adress, just use the search function for the text indicated in the images (mind up/down search and type of characters, though).

Any hex editor will do if you know what you are doing. For programming editing, hiew32 is better because it can convert hexes into assembly code. Assembly editing is not used on this tutorial (it is hard enough even for programmers).


Now,  let's make an overview of the file components of any generic independent mod:


1- .exe file : Pretty self-explanatory, this is the executable for the game. Give it any name you want, the code doesn't care. You can also change the icon to suit your tastes and image you like. I use a program called Resource Hacker, it's free IIRC. you can download icons from the internet and append them to the file. As for the contents, all of the engine and hardcoded features are originally here. It also includes skill menues (in equi) and cheats menues(useful for testing) which can be enabled. On my Greatest Mod the cheat menu is enabled (and modified) by default as of version 0.09.


2a- .h4r file (on /Data): Heroes IV resources, as its name implies, are stored here. All the tables, texts and graphics of your mod will be put inside this file. It has to be called by the .exe by name. Give it any four letter name, and then call for it Hex Editing your .exe file:

Note: NEVER write extra characters when hex editing. This means, if there was four spaces, write over them but no more and no less. Otherwise you will mess up all locations and thus destroy the file.

2b- secondary .h4r file (on /Data): These are marked in equi as new_mod.h4r, and by changing that name on the exe and on the further .h4r files, you change your mod moddability. They are basically a mod for your mod. You can combine .h4r mods (only two) this way without extracting and re-bundling. New_mod has priority over the main .h4r file.

3- .dll file : This file was introduced with Equilibris and it compliments/replaces some of the .exe functions. it is called on by the .exe too, so copy and rename your .dll file, and then change the call (only two characters here).


Optionally, you can add independent editor functionality to your mod...

4- Campaign Editor .exe : Sure, you have your mod, but if you included any extra objects, you will want them to be listed, right? So, create a copy of the Equilibris campaign editor and rename it to your liking. You will have to edit it to read your resources, so...

5- .aop files (/Data) : Inside the data folder like.h4r files, these are referenced by your campaign editor.exe to know which objects to display and how to arrange them in the menus. So rename the file before editing them for your mod. Also, rename the reference on the editor .exe file so it knows what to look for.

You can also change others like "expansions":


6- Maps: Maps are separate, but you can include them in a maps folder. Remember that you can't play maps incompatible with the mod you are running (also, as you may know, you cannot play maps with special/equilibris objects in default game. It works the same for different mods). You can make them compatible by the new_mod technique or by extracting and re-bundling.

7- Saves: You can include them just as maps can, and you can even hex edit the save files for weird effects if you know what do you. The maps there will not able to be edited, though.

* * *

And... that's pretty much it!

Fundamentally speaking, only the game .exe and .h4r differentiation are strictly neccesary. The rest are extra features.

With just those files you can make unlimited different modular mods!

I will be implementing this system fully for all further releases, starting with the next version of Greatest Mod and additionally with the alternate Conflux mod. That will serve as example here...


How a mod folder could look before install. Just zip or rar it, and people should extract it over their main Heroes IV folder. If you did everything as instructed here, nothing will be overwritten.

All images used on this post (and a few others) except the last, are hosted here: http://old.postimg.org/gallery/2ca1l5vuu/27c1e2bb/

So, what do you think? Does this make you want to mod and share your mods? It certainly did it for me
You may share mini-mods here done like this if you so wish!
____________
CLICK on the image to discover H4 Greatest Mod!

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


Famous Hero
posted September 30, 2016 01:14 PM
Edited by Baronus at 15:12, 30 Sep 2016.

Yes its necessary. I thinked about it but you overtake me. Good work.
If you want mod WoW HIV go to adress:
0x66f670 (+ 4**** for Ida, Hiew etc)
Game load files in order:
1.heroes4.h4r
2.storm.h4r
3.x2.h4r
4.text.h4r
5.updates.h4r
6.storm_override.h4r
7.storm_updates.h4r
8.x2_override.h4r
9.x2_updates.h4r
10.new.h4r
UFFF! Alot!
New is on the top and all in there is in game.
7,9,10 are not used and you can. You can rename too at it will be worked for your exe.
Last txt tables are in updates.h4r. So you must put your tables in updates or higher.


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


Hired Hero
posted September 30, 2016 05:47 PM

Thanks for posting this Nimostar! Good work

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


Promising
Famous Hero
Modding the Unmoddable
posted October 01, 2016 02:49 AM

Very nice info about the unused updates, Baronus!

But you forgot two files:
movies.h4r
and
music.h4r
You can rename some of these, specially Music, to replace the game music with your own .h4r and thus your tracks. I will try this replacing with some h2/h3 music.

Also, all you mentioned and those two too, are also called on the Equilibris .exes, so this gives us the possibility to combine even more extra mods (by changing names too).
(i wish someone would see if this works)

These are the default unused files then, in increasing priority:
3- Storm_updates
-[Used]
-[Used]
2- X2_updates
1- New

With Equilibris they become:
4- Storm_updates
-[Used]
-[Used]
3- X2_updates
2- New
1- New_mod

All are .h4r files.
I don't know if "new_mod" is extra to "new" or overwrites it.This has to be tested as well.

Also one could change the text.h4r (including the name) to translate the game or simply to give own flavor to it. But loading the text files in other will also work.
Although there is a problem. The table for texts (strings.text) is corrupted if you use textedit (or any text editor), because it doesn't have the same structure as the others (tables of creatures, etc.). It would be nice if someone can fix it. As of now, you can only hex edit it, which limits you to use the same number of characters in everything or it becomes useless.
____________
CLICK on the image to discover H4 Greatest Mod!

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


Known Hero
posted October 22, 2016 10:05 PM

The new.h4r file is std/wow version of new_mod.h4r which is Equilibris version. Say you change some portraits using the FaceTool. Saving your changes creates a new_mod file. Changing the name to just 'new' will mean the standard version of the game can now read your changed portraits. I guess you still gotta test if standard game can read in other changes/modifications.

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


Promising
Famous Hero
Modding the Unmoddable
posted October 23, 2016 01:09 AM

It can read all modifications, in fact the only that changes is the name of the file.-

For example, my Greatest Mod 0.11 reads new mods from "nim_mod.h4r", they are added to the rest of the content that way.
____________
CLICK on the image to discover H4 Greatest Mod!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0450 seconds