Heroes IV Defmaker is needed!

Mods and development for mods. Including WoG & Equilibris (RU) subforums.
User avatar
Baronus
Assassin
Assassin
Posts: 288
Joined: 06 Jun 2015

Heroes IV Defmaker is needed!

Unread postby Baronus » 20 Jan 2016, 19:59

I want tell all programist about modding defs in Heroes IV! Its very important to build program to packing df2(h4d). In Heroes IV we have defs df2 (not music files extension but def2) in Resedit and h4d(ef) in others programs. An no program to replacing offset inside :o(((( All graphic offset is in h4df2. Only menu in bmp.raw. First step replacing campaign pictures. Its def with only one picture. How to ad our picture to campaign?
Can they someone build? Its most important thing.

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

Re: Heroes IV Defmaker is needed!

Unread postby iLiVeInAbOx05 » 17 Feb 2016, 18:18

Which file in particular are you talking about?

User avatar
Baronus
Assassin
Assassin
Posts: 288
Joined: 06 Jun 2015

Re: Heroes IV Defmaker is needed!

Unread postby Baronus » 18 Feb 2016, 16:22

First step is adding campaign images.
bmp --> layers/campaign/splashscreen converter.
All who make campaign will can ad own picture to map!
This is only one picture def and I think that is simplest to do. Tool to converting bmp in def.
Image

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

Re: Heroes IV Defmaker is needed!

Unread postby iLiVeInAbOx05 » 18 Feb 2016, 16:31

Yes, but which file actually contains these pictures? I'm still new to the modding stuff so I need to know where to look :D

User avatar
Baronus
Assassin
Assassin
Posts: 288
Joined: 06 Jun 2015

Re: Heroes IV Defmaker is needed!

Unread postby Baronus » 18 Feb 2016, 19:06

heroes4.h4r basic campaigns
storm.h4r storm campaigns
x2.h4r winds campaigns
Best to viev and search is Resedit2. There is logical order of folders and viever.
Best to extract and to pack is Mh4096.

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

Re: Heroes IV Defmaker is needed!

Unread postby iLiVeInAbOx05 » 18 Feb 2016, 23:32

Thanks. I'll try to take a look later. I'll probably start out using a hex editor, rather than Resedit / Mh4 since I won't be using those if I do start trying to write a program to modify / allow users to replace pictures or whatever else is feasible.

User avatar
Baronus
Assassin
Assassin
Posts: 288
Joined: 06 Jun 2015

Re: Heroes IV Defmaker is needed!

Unread postby Baronus » 19 Feb 2016, 07:16

What about extract one picture def by Mh4096 and then using hexd editor? Is it simplest than editing all gigantic file?
I think about converter bmp to def. And then using Mh4096 to pack it. Mh works perfectly.
I tried and if you build file new.h4r with only one def it works. All h4r file is no needed.

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

Re: Heroes IV Defmaker is needed!

Unread postby iLiVeInAbOx05 » 19 Feb 2016, 15:51

I guess that would be an easier place to start :D

Could you provide me with the instructions to extract one picture def? I've got a couple versions of ResEdit and Mh4096.

User avatar
Baronus
Assassin
Assassin
Posts: 288
Joined: 06 Jun 2015

Re: Heroes IV Defmaker is needed!

Unread postby Baronus » 19 Feb 2016, 17:11

Open Mh4
Open x2.h4r
Select layers (blue colour all layers)
Search campaign splashscreen .
Extract selected file.
...
Now you can use hexd

Open Resedit 2.
Search this file in x2.
See in viever.
Make a screen.
...

Now you have the same file in indexed bmp.
And hexd you can compare. Def with bmp.

H4ResExp
Open x2.h4r
select
extract
...
Open plugin img convert.
Make bmp.
Another wersiin bmp. Not indexed.
You can use hexed.

H4ResExp
http://www.tawerna.biz/pobierz_plik_154 ... resex.html

Pluggins in main folder NOT in pluggin folder! Its fail.

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

Re: Heroes IV Defmaker is needed!

Unread postby iLiVeInAbOx05 » 19 Feb 2016, 17:51

Thanks Baronus, I'll try to take a look today when I get home.

User avatar
Baronus
Assassin
Assassin
Posts: 288
Joined: 06 Jun 2015

Re: Heroes IV Defmaker is needed!

Unread postby Baronus » 19 Feb 2016, 19:30

I found very good description defs in Heroes IV:
http://www.heroesofmightandmagic.es/for ... 2&start=15

File format h4l (layers) * block of images from the game heroes4 * * abenhor (abenhor@tabernaberserker.es) description * * there may be many small images cornered inside a large block. * the game uses the full block to reference the position of an image on a template. * * to calculate the width and height of each image within a block, note that: *-margenizquierdo is actually the first pixel painting, starting from zero. * therefore, if margenizquierdo = 23, it means that the 23 first pixel on the left (from zero to the twenty-second) are left transparent. *-margenderecho is actually the last pixel painting, starting from zero. * therefore, if margenderecho = 54, means that they are painted only the pixels from 23 to 54 (32 in total), leaving the rest transparent. *-the same applies to the top and bottom margins. * * in every image there is an area of image and, optionally, a description of the transparency. 02 bytes - nnnn - numeroimagenes (number of images in the file) {image1: 02 bytes - nnnn - longitudpaleta (number of colors in the palette) 02 bytes - nnnn - coloralfa (color for shadows mix) longitudpaleta * 3 bytes {palette: array [1.. longitudpaleta] of array [1.. 3] of bytes;}} (palette rgb)} 02 bytes - nnnn - longitudnombre (the image name length) nn byte - string - name (name of the image) 01 byte - nn - shadows (to soften (antialiasing) the image on the background overlay) / 0 - without transparent areas (usually, dialog boxes) / 1 - with transparent areas, but without alpha channel / 4 - with transparent areas, and alpha channel (these are those that i have gone mad) 04 bytes - ùùùùùùùù - margenizquierdo (horizontal displacement of the image inside the block) 04 bytes - ùùùùùùùù - margensuperior (vertical displacement of the image inside the block) 04 - ùùùùùùùù - margenderecho bytes (width in pixels = margenderecho - margenizquierdo + 1) 04 - ùùùùùùùù - bottommargin byte (height in pixels = bottommargin - margensuperior + 1) {descripcionlineas: array [1.. high] of record} {{02 - nnnn - inix byte (first pixel of the line, filled with pixels transparent at the beginning of the line) 02 - nnnn - finx bytes (pixel of the line, filled with transparent pixels on the right) 04 bytes - ùùùùùùùù - direccionlinea (data direction of the line, in the matrix datoslineas)}} {datoslineas: array [1.. high] of record {pixels: array [descripcionlineas.finx - descripcionlineas.inix] of bytes;}} (colour indices of each pixel, from left to right and from top to bottom.) (apply the index to matrix palette to have color components.) {}} [optional {box shadows and transparencies}] / * end of the image1} {image2...} { ..... } {pickkkk...} * box of shadows and transparencies * consists of zero, one or two parties, * depending on \"sombras\" (0, 1 or 4) " The exact formula of the length of the top = (longituddatos + 1) divided 2; the exact formula for the length of the second part = (longituddatos + 131) split 128; and that affects the acceleration. each byte of the second part corresponds to 128 bytes of longituddatos. each byte is divided into 4 parts, each part (2 bits), is responsible for 32 pixels. these two pixel values are: 00 - all pixels are transparent and can be omitted. 01 - all pixels are fully opaque (alpha = 255) and it is not necessary that they get mixed up with the base. 10 - all pixels are more opaque (alpha = 255) as the transparent color and no need to mix with the base. 11 - there are pixel with an alpha value variable, different from zero (or 255); the alpha channel should be mixed with the base. with the first three modes is very fast, but the room involves a slow process, so it is only used for the edges of the images. the byte following the size of palette, coloralfa, is the transparent color. all pixels with a color below this number not shown in modes 10 and 11. in cases in which the mask has no acceleration (if the image type is not 4) is for all pixels in 10 mode. It has this. spend 3 or 4 files cmp and a screenshot of the game or something similar where these images are vein. and if there is something that you have clear, starting from a partial description always speeds up the theme. ...

With translator. Maybe it will be usefull?

...

Ok. I paste it because it is a theme about this.


Return to “Modcrafting Guild”

Who is online

Users browsing this forum: No registered users and 3 guests