|
|
Jagerfeld
Tavern Dweller
|
posted June 21, 2021 08:28 PM |
|
|
iliveinabox05 said:
I can always use some help, as there is lots and lots to study and get implemented in the resource editor.
Would you be interested in helping me figure out where the origin point is for objects placed on the castle battle grid?
I'm interested, but I'm a beginner. If you explain to me in which direction to move, then I can try.
I have looked at several topics and have a little idea of how some aspects have been modified. But I'm afraid I will still have a lot of questions.
More specifically about object placements. What should I do? Is there any info where exactly the positions of the objects are written? Is it written in exe or maybe in dll files? Are there already some progress in this work, or should we start from absolute zero? Is there any search method already available?
|
|
iliveinabox05
Honorable
Famous Hero
|
posted June 21, 2021 08:37 PM |
|
|
Jagerfeld said: I'm interested, but I'm a beginner. If you explain to me in which direction to move, then I can try.
I have looked at several topics and have a little idea of how some aspects have been modified. But I'm afraid I will still have a lot of questions.
More specifically about object placements. What should I do? Is there any info where exactly the positions of the objects are written? Is it written in exe or maybe in dll files? Are there already some progress in this work, or should we start from absolute zero? Is there any search method already available?
Sent you a private message.
The offsets are in the resource files (Data folder). There are two main offsets: 1) The offset in the object itself, 2) The offset in the castle resource file.
The first one is an offset to draw the image on a canvas (left/right and up/down), while the second is an offset on the battle grid (up right / down left, and up left / down right).
The problem I'm having is figuring out the starting point for everything.
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted June 22, 2021 05:24 AM |
|
Edited by NimoStar at 05:25, 22 Jun 2021.
|
Castles have layout files that tell the game which objects to use in the castle attack screen. Here is one:
These are ".spr" files, they are made of hex text. Objects are separate and invoked by this code.
The files are like
castle.death.fort
castle.death.citadel
castle.death.castle
castle.nature.fort ...
It's rather likely I can decipher this in the same way I deciphered the creature sequences: Just looking at it really, really hard - On the other hand, I'm less smart and older than 5 years ago, so who knows.
However, of course you will have to decipher how to edit the combat objects themselves to do stuff like changing the tower graphics. I could only switch the graphics with other previously existing invoked ones in the code.
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted June 22, 2021 06:27 AM |
|
|
Oh the formats of both the castle objects and combat objects are known and the resource editor can open and view both. You should be able to import into the combat objects just like any of the other objects with sprites in them (though admittedly I haven't tried it yet).
What I meant was making the resource editor able to actually show you what the castle layout looks like on the battlefield. If you open up heroes.h4r and double click on one of the castle objects, you'll get a scramble of the various combat objects on the screen.
This is because I'm still trying to figure out how the image offsets and battlefield offsets work together to place an object at the desired location.
The plan is to make the castle battlefields editable, so you can move, add, remove the various castle objects, instead of having to do it by hand like you will now.
To do it by hand, you just need to open up the castle object for the castle, look for the tower, copy its hex code, then go to the castle object for the citadel, and paste it in there. You'll need to increment the number of objects in the file header by 1 (second and third bytes of the castle object file).
Each of the listed objects in the castle file are as follows: 2 bytes for the length of the name, followed by the name, followed by two 4 byte integers for the battlefield grid offsets.
To move the object around, change these two 4 byte numbers. one of them moves the object diagonally to the top left or bottom right, while the other moves the object to the top right or bottom left. Can't recall at the moment which is which, so you'll have to play around with it.
See below.
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted June 22, 2021 07:17 AM |
|
|
Thanks for the explanation, that will really save some trouble of "looking really hard at it"
On the other hand, the offsets are not so direct I found, since copying something I got this "but where is the tower?" turns out outside the usable map, lol...
But, will keep trying.
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted June 22, 2021 07:25 AM |
|
|
NimoStar said: Thanks for the explanation, that will really save some trouble of "looking really hard at it"
On the other hand, the offsets are not so direct I found, since copying something I got this "but where is the tower?" turns out outside the usable map, lol...
But, will keep trying.
Haha yep, that's exactly what I was talking about that I haven't completely figured out yet.
Just remember the battle grid isn't left / right and up / down. The castle offsets move the objects diagonally.
|
|
karmakeld
Responsible
Supreme Hero
|
posted June 22, 2021 07:56 AM |
|
|
Jagerfeld said: Hello everyone, I'm new to this forum.
A few years ago I was playing homm 4 and was thinking how bad it was. I recently discovered the equilibrium mod and was quite interested that the game can be modified. Finished several campaigns, the game really sparkled with new colors.
Then I discovered this forum. You guys are awesome.
I dig deeper into the game resources with tools from the forum, looked at how everything was arranged there, but did not really understand anything.
I have a few questions.
1. Is it possible to add new buildings to the city? As I understand it, slots for buildings in cities are strictly prescribed. Is it possible to add new slots somehow?
2. Is it possible to add new properties to buildings. For example, doubling the creature growth for the castle?
3. Is it possible to add new creatures to the game? Draw a model, make sprites out of it, and somehow shove it into game resources?
4. Is it possible to change the contents of the battle location? Here I am more interested in changing the siege. It would be interesting to move the towers to where they should be - along the edges of the wall. And I also don't like the fact that the creatures are fighting through the wall. Maybe it would be possible to somehow create blocks of the wall, on which creatures can climb, like on towers, and from there fight the besiegers. As if the creatures are really on the walls.
So far, all the questions. Of course, I have a lot of ideas (or rather dreams), but I will not clutter up the topic too much.
1) Town building layout can be changed. Cant remember if Nimo or someone else fully changed the looks or only replaced/switched with other existing buildings, but you can edit most images/animations in the game.
2) changing the creature growth is rather simple. Editing a number /value in a text document. Requires a proper tool to read and edit, simply using txt format will break it. Go look at www.celestialheavens.com for various useful H4 modding tools (sorry for missing link, but I'm on my phone).
3) you can change the looks/skin of all creatures and heroes but no adding new creatures atm. You can also easily make a specific heroes appear like a creature or add a customized skin to the game. For creatures it will replace, for heroes you can change a specific hero. Look for the Creature Hero tread for more info.
So you can edit or replace existing models or draw your own model and create a new sprite, and link that sprite to a hero.
____________
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted June 22, 2021 01:29 PM |
|
|
I noticed the Order citadel/castle/etc. uses Life graphics. How boring!
I wonder if there is unused Order specific graphics?
If there aren't, we should definitely make them.
This is obviously something unfinished.
____________
|
|
karmakeld
Responsible
Supreme Hero
|
posted June 22, 2021 02:21 PM |
|
|
NimoStar said: I noticed the Order citadel/castle/etc. uses Life graphics. How boring!
I wonder if there is unused Order specific graphics?
If there aren't, we should definitely make them.
This is obviously something unfinished.
Are we talking the combat screen graphics?
Gates, towers, ground etc.. your image suggests so. Things should be different. Have you checked ingame, coz there def seperate animations for Order. Perhaps patched..
____________
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted June 22, 2021 03:19 PM |
|
|
I think so, I have found thatthere are separate files, But I haven't found the order castle .spr file (which I show there) calls for them.
There are no patched files that I can find either but perhaps I have missed extracting something like H4_updates
PS: Hmmm I found it. Maybe I was mistaken then, and did copy the wrong file.
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted June 22, 2021 04:20 PM |
|
|
karmakeld said: 1) Town building layout can be changed. Cant remember if Nimo or someone else fully changed the looks or only replaced/switched with other existing buildings, but you can edit most images/animations in the game.
Yeah he reskinned the background and building animations, so replaced, not new.
As you said, we can replace the animations for pretty much anything in the game at the moment, just not add.
karmakeld said: 2) changing the creature growth is rather simple. Editing a number /value in a text document. Requires a proper tool to read and edit, simply using txt format will break it. Go look at www.celestialheavens.com for various useful H4 modding tools (sorry for missing link, but I'm on my phone).
Oh is it just in one of the tables/strings files? In that case, the resource editor is able to view and edit those.
|
|
Jagerfeld
Tavern Dweller
|
posted June 24, 2021 11:30 AM |
|
|
Why is it impossible to add new buildings and creatures, but only replace them?
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted June 24, 2021 12:17 PM |
|
|
Jagerfeld said: Why is it impossible to add new buildings and creatures, but only replace them?
Common problem of some old game engines.
Each unit and building is directly coded in the the game's binary (.exe)
So you need to hack all the executable relevant locations to do it.
Currently we don't know all the locations and there is no such plugin.
Though there are hints for doing it with creatures, the immediate plugin that we can already write is for mass spells now.
____________
|
|
Jagerfeld
Tavern Dweller
|
posted June 24, 2021 12:31 PM |
|
|
NimoStar said:
Common problem of some old game engines.
Each unit and building is directly coded in the the game's binary (.exe)
So you need to hack all the executable relevant locations to do it.
Currently we don't know all the locations and there is no such plugin.
Though there are hints for doing it with creatures, the immediate plugin that we can already write is for mass spells now.
What exactly is coded in exe? Available positions for buildings on the town screen?
|
|
iliveinabox05
Honorable
Famous Hero
|
posted June 24, 2021 05:33 PM |
|
|
Jagerfeld said: What exactly is coded in exe? Available positions for buildings on the town screen?
It's because the game is coded to look for certain asset names where buildings are concerned, so it won't look for anything new added to the resource files because it doesn't know to look for it.
For creatures, they are coded in an enumerated type (in the exe), so we would need to be able to add to that enumerated type, as well as any other table which uses the creature enum.
|
|
leadcrow
Hired Hero
|
posted September 21, 2021 07:33 AM |
|
|
brink99 said:
2.01. Creature Offsets
(taken from: http://equilibris.celestialheavens.com/forum/viewtopic.php?p=17405)
----------------------------------------------------------------------
.654820 Air elemental
.654832 Angel
.654842 Ballista
.654856 Bandit
.654864 Beholder
.654876 Behemoth
.654884 Black dragon
.654896 Bone dragon
.6548AA Centaur
.6548BC Cerberi
.6548CC Champion
.6548DC Crossbowman
.6548EC Crusader
.6548FC Cyclop
.65490C Venom spawn
.65491C Devil
.65492E Dragon golem
.654940 Gnome
.65494E Earth elemental
.65495E Efreet
.654972 Elf
.654984 Fairy dragon
.654996 Fire elemental
.6549AA Gargoyle
.6549BC Genie
.6549CC Ghost
.6549E0 Berserker
.6549F0 Gold golem
.654A00 Gryphon
.654A10 Halfling
.654A20 Harpy
.654A32 Hydra
.654A42 Ice demon
.654A54 Imp
.654A64 Leprecon
.654A72 Mage
.654A80 Mantis
.654A92 Medusa
.654AA6 Mermaid
.654AB4 Minotaur
.654AC2 Monk
.654AD2 Mummy
.654AE2 Naga
.654AF0 Nightmare
.654AFE Nomad
.654B0C Ogre mage
.654B1A Orc
.654B2C Peasant
.654B3A Phoenix
.654B4E Pikeman
.654B5E Pirate
.654B6C Satyr
.654B7A Sea monster
.654B88 Skeleton
.654B98 Squire
.654BA6 Sprite
.654BB6 Thunderbird
.654BC6 Titan
.654BD8 Troglodyte
.654BE6 Troll
.654BF4 Unicorn
.654C02 Vampire
.654C16 Waspwort
.654C26 Water elemental
.654C3A White tiger
.654C48 Wolves
.654C56 Zombie
.654C66 Goblin knight
.654C78 Evil sorceress
.654C8A Gargantuan
.654C9E Dark champion
.654CB2 Catapult
.654CC6 Frenzied gnasher
.654CD6 Megadragon
how do i find this offsets in hd editor? i dont have hiew on my laptop
|
|
iliveinabox05
Honorable
Famous Hero
|
posted September 22, 2021 03:30 AM |
|
|
leadcrow said:
how do i find this offsets in hd editor? i dont have hiew on my laptop
You could open up the exe in a hex editor and go to the offsets, copy a portion of the hex code, then open up the game's editor in a hex editor and search for that hex code.
That's how I was able to locate the creature table in the editor.
|
|
karmakeld
Responsible
Supreme Hero
|
posted September 22, 2021 06:27 PM |
|
|
iliveinabox05 said:
leadcrow said:
how do i find this offsets in hd editor? i dont have hiew on my laptop
You could open up the exe in a hex editor and go to the offsets, copy a portion of the hex code, then open up the game's editor in a hex editor and search for that hex code.
That's how I was able to locate the creature table in the editor.
In case he uses a hex.editor which shows diffenrent code, he should be able to just search the creature names inside the exe..they should all be listed after eachother. Just to say if you dont know the offset code/placement it can be searched for
____________
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted September 22, 2021 09:48 PM |
|
|
some editors add exactly 400000
so
.654CD6
becomes
.254CD6
in other editors, if the first one had the added mode
____________
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted October 19, 2021 03:51 PM |
|
Edited by NimoStar at 17:42, 19 Oct 2021.
|
I discovered something midly interesting aboput the Staff of Mayhem
It says
"All Chaos direct damage spell do 50% more damage"
But in truth, I could check it didn't affect the Fireball spell. (of all things...)
So, I concluded that instead of looking at the table like many other skills and upgrades, the thing they did with this is to enumerate the upgraded spells manually.
Sure enough, in my HEROES 4 ULTIMATE mod, I discovered the spell was upgrading Implosion for example, even though it is now in Death.
***
The spells upgraded I could find are:
- Sparks
- Magic Arrow
- Fire Aura
- Fire Bolt
- Fire Ring
(But NOT Fireball)
- Implosion
- Inferno
- Disintegrate
- Chain Lightning
These continue being upgraded, no matter if reskinned and changed school
***
Why is this midly interesting? Well, one could find the list of upgraded spells that must be somewhere in the .exe
From there, changing one hex code to another can change which spell gets the 50% bonus
By choosing different sets of spells to upgrade, we may "reskin" the rod to fullfill different ingame roles in mods.
For example: "All Animate Dead spells raise 50% more creatures"
Will keep researching stuff...
UPDATE NOTE:
Although the Staff of Summoning looks from the table, I strongly suspect the Staff of Death has preestablished spells like the Staff of Mayhem. New Spells moved towards the Death school aren't counted for upgrading.
____________
|
|
|