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: Researching how to add new objects
Thread: Researching how to add new objects This thread is 9 pages long: 1 2 3 4 5 6 7 8 9 · «PREV
radmutant69
radmutant69


Known Hero
posted December 24, 2017 10:02 AM

No... I thought you want to make a background object from an existing foreground object...

Next time I should read such requests more carefully I think.

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


Known Hero
posted January 14, 2018 01:48 PM
Edited by radmutant69 at 16:13, 14 Jan 2018.

Hey Karmakeld! Remember this one?



I've just found out how to make it centered via hex editing. I think you no longer need to fix uncentered images manually.



We just have to editing these values at the end of the object file:





These are that 'exactly 8 bytes' before the xx 00 00 00 at the file's end that we need to keep when we make new objects. And these determine the 'coordinates' of the image compared to its entrance.

It works kinda like the moving of the capture flags. Also this means I found another way to to place objects out of the map's border

Edit: beware of potential crash danger if you're experimenting with this btw... backup your .aop files anyway.

Edit2: it worked with the Bone quest hut too (after a lot of crashes and stuff.) So i can guess it is confirmed now.

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


Famous Hero
posted January 15, 2018 09:00 PM

Yeah I remember that portal
Great discovery. So do you have a clue about how those coordinated work/are read or did you watch the changes of your editing till it was right?
Still if I'm not mistaken, that specific portal was centered on the grid, wasn't it? Although it's still great if we can just move the entrance info to the image, rather than having to redo it all..

Editing the entrance code, I've found that seems to (always) be placed at the upper part of the image, like this entrance from the Mansion Quest Hut, inserted into a Sawmill.

That showed me where to place the Mansion - manually and as the image shows, placing the new image in the lower right corner, would just have been too easy..

But only you know which method is the faster, hex vs. image editing.

Still it's great that you found out what the end code does. Now we just have to locate the animation speed
____________

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


Supreme Hero
posted January 16, 2018 09:10 AM

This end! Yes I thought that there must be object size, positon in picture and entrance. Great!

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

Tavern Dweller
posted January 16, 2018 02:52 PM

sounds great. i hope it means we can now repair all my bad objects. am i right?

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


Famous Hero
posted January 16, 2018 07:55 PM
Edited by Karmakeld at 20:06, 16 Jan 2018.

mirage said:
sounds great. i hope it means we can now repair all my bad objects. am i right?


Sorry Mirage, but your objects are simply beyond repair haha.
Sorry, just had to tease you there
We found that a secure method is to extract an image that is about the same size as your new image and/or has the same passability info/size as you want your object to have (you can compare the sizes in the ResHelper if needed).
Then you insert your image in e.g. Rock.Green.26. Save it as h4d file. Open your file as well as the original rock.green.h4d object in hex editor and copy/paste header and footprint. Then your object will be perfectly placed. As I displayed in the screenshot above, if you need larger images you can chance entrance info (if needed), to determine where you need to place your object in the original image.
Alternate method is to edit the code at the end like Radmutant did, but that is only for aligning entrance with image if these two doesn't match - we found that this issue likely comes from inserting images into objects like the snake skeleton, which are larger than the original image.
It seems that objects which are passable can import images that are larger than the original, while objects with entrances/impassable info will crash the editor if new image is larger than original.
But as long as you use a suited object/image as base for your new object, it seems to work in most cases.
A lot of info I know ..
I'll post screenshot guides tomorrow for easier understanding.
But Radmutant is really the one who can answer if he can fix your uncentered images, with just hexediting. My method requires the original images, which I believe you deleted..?

Baronus said:
This end! Yes I thought that there must be object size, positon in picture and entrance. Great!


I don't think any of us questioned wheter or not these info is found within the file or not , but rather where or how they're being read. But by now we know several of the codes and where they're placed, although we still have a few uncertain ones.
I can post some details tomorrow as well.
Perhaps then others can help searching for the remaining ones.

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


Known Hero
posted January 17, 2018 06:04 PM
Edited by radmutant69 at 18:33, 17 Jan 2018.

mirage said:
sounds great. i hope it means we can now repair all my bad objects. am i right?


Well I tried to do my best but some of your objects have another serious problems beside being off-centered. For example a few of them are crashing my editor and your 'quest creatures' are still background objects thanks to the Holy Snake Skeleton...

I think we will have to extract/export these images when I'll have some time and try to import them again.

Also note that I still didn't look into the necropolis objects file but I will I promise


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

Tavern Dweller
posted January 17, 2018 08:41 PM
Edited by mirage at 21:35, 17 Jan 2018.

Karmakeld said:
Sorry Mirage, but your objects are simply beyond repair haha.
Sorry, just had to tease you there


lol

Karmakeld said:
We found that a secure method is to extract an image that is about the same size as your new image and/or has the same passability info/size as you want your object to have (you can compare the sizes in the ResHelper if needed).
Then you insert your image in e.g. Rock.Green.26. Save it as h4d file. Open your file as well as the original rock.green.h4d object in hex editor and copy/paste header and footprint. Then your object will be perfectly placed. As I displayed in the screenshot above, if you need larger images you can chance entrance info (if needed), to determine where you need to place your object in the original image.


yeah i know and my method is even better cause im using only a few objects to import my images. i can easily change object types after that, right? but this wont help on my old objects and i dont wanna make them again. especially the animated objects.

Karmakeld said:
Alternate method is to edit the code at the end like Radmutant did, but that is only for aligning entrance with image if these two doesn't match - we found that this issue likely comes from inserting images into objects like the snake skeleton, which are larger than the original image.


yeah f*ck the snake skeleton

Karmakeld said:
It seems that objects which are passable can import images that are larger than the original, while objects with entrances/impassable info will crash the editor if new image is larger than original.
But as long as you use a suited object/image as base for your new object, it seems to work in most cases.
A lot of info I know ..
I'll post screenshot guides tomorrow for easier understanding.


no the radmutant told me its a code after the object types like 0101000100030001 etc and that means its a 'background object' and 'allows any images'. but that can have an entrance. i saw a stupid flagable holy ground from h3 and that was a zombie dwelling

Karmakeld said:

But Radmutant is really the one who can answer if he can fix your uncentered images, with just hexediting. My method requires the original images, which I believe you deleted..?


my bad... but he is right we can export it from objects. i just never thought about that...

radmutant69 said:
Well I tried to do my best but some of your objects have another serious problems beside being off-centered. For example a few of them are crashing my editor and your 'quest creatures' are still background objects thanks to the Holy Snake Skeleton...


yeah but at least most of them are centered now huh? thx...
holy snake skeleton lol

radmutant69 said:
Also note that I still didn't look into the necropolis objects file but I will I promise


meh you wont. and i finished the pyramid dwellings but that sucks in  town. i will use the anubis temple stuff instead. and will you ever make the 4th level lich?? cause i dont wanna make the dwelling for 3th and the dark knight one and then again when you change your mind...

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


Famous Hero
posted January 17, 2018 10:13 PM
Edited by Karmakeld at 22:41, 17 Jan 2018.

So you just confirmed that using the Snake Skeleton will most of the time create off-centered objects.
Well here's my guide:

Step 1:
Find and export the object you want to use to insert your new image (both extract (h4d) and export (ora) the object). In this case I want to mirror the Witch Hut. I'll be using the Sawmill R to insert it in.



I've mirrored the Witch Hut, but as it's entrance isn't a quadratic square, simply mirroring it (copy-pasting it to the same position as in the original image) like this,


will leave it off-center like this (the same thing will often happen if using the Snake Skeleton as I did here):




Step 2:
I'll be using the Gem vein's entrance, as it matches how I want the Witch's Hut to be like, when mirrored.




Step 3:
As the Witch Hut's is a single framed object, I've deleted all 'animation' frames and shadows, and renamed base_frame and base_shadow to frame 001 and shadow 001.
I then imported my single framed image and saved that as a h4d file.




Step 4:
I want to replace the entrance of the Sawmill to that of the Gem vein, as it can show me, where the Witch's Hut needs to be placed compared to the Sawmill.



Next I place my new h4d file in the Data folder, and view it in the editor. Now it looks like this and I now know where to place my mirrored Witch's Hut.




Step 5:
Now to replace the Sawmill R image with my mirrored Witch's Hut in Gimp.
To make sure I get right, I'm comparing the original Witch's Hut with the Left Sawmill.



Finished result, saved. Next is to import it with ResHelper and save as h4d file.




Step 6:
Open the 3 objects' h4d files in Hex Editor.
My new mirrored Witch's Hut image looks like this (top image).
As I've used the Sawmill R image to insert my new image, I'll be using the header (middle images) and footprint codes (lower 2 images) of that object. I simply copy and paste them at the start and end of my new image. This will transform it into a readable object.



(footprint v)


So the import worked, but as of now it's typed as a Sawmill and the entrance info isn't how I want it.



So I'll start by replacing the entrance info. I'll copy that of the Gem Vein R and replace it the one of the Sawmill.
Next, I'll replace the type. I replace mine with school and sawmill with witchs hut. Note that I didn't change the 2 bytes between mine and sawmill, doing so will corrupt the object and crash the editor. I left the word right as it doesn't affect my object.



Step 7:
So let's view the result in the editor ....




____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 9 pages long: 1 2 3 4 5 6 7 8 9 · «PREV
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0943 seconds