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 ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: Heroes 3 Hacking Reference Guide
Thread: Heroes 3 Hacking Reference Guide This thread is 37 pages long: 1 2 3 4 5 ... 10 20 30 ... 33 34 35 36 37 · «PREV / NEXT»
BTB
BTB


Famous Hero
Moist & Creamy
posted November 10, 2022 02:54 AM

Were you still wanting to make Tactics, Leadership, and Luck specialists? I just got done adding them to my mod.

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


Adventuring Hero
posted November 10, 2022 07:56 AM

Always interested in changes! Is it in the newest ah3m mod?
____________

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


Famous Hero
Moist & Creamy
posted November 10, 2022 02:30 PM

Not yet. Got a few things in the pipeline and I'm really hoping that this will be the last of it, so I'm planning on the next update being 1.3.

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


Adventuring Hero
posted November 10, 2022 09:32 PM
Edited by Parascus at 22:19, 10 Nov 2022.

Hallo @all,

I try to get between the spellcasting of creatures to apply some more conditions to check, e.g. I want the petrify spell, cast by greaer basilisk only work on creatures of level 4 and below. For this I have a hook at 0x5A896A, right before the spell cast work chance is calculated. Using H3API I don't know how to get the creature the spell is put on. I have the H3CombatManager as well as the attacking creature. Also I have the side (where I don't could figure out if it is left/right or the active creature is always 0).
There are properties names currentMonSide, currentMonIndex, currentActiveSide, activeStack but I don't understand their meaning. And when I try to get the army (array with two elements of H3Army at offset 54c4) I just get the (origin) number of creature in this stack.

Has anyone of you a way to get the H3CombatCreature of the H3CombatManager which is target of a creature spell?

And additionally I want to change attack and defense when a hero enters a combat in dependence of the opposing hero and the opposing army. I thought the speciality check of where the static creature bonus (speciality type 4) would be a good place for a hook. But at this point I no less than nothing about the enemy. Any suggestions?

Best regards

Parascus
____________

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


Responsible
Supreme Hero
posted November 11, 2022 05:55 PM

Btw, you might be interested in my latest plugin which cancels secondary skills. Just left-click that useless Eagle Eye and cancel it. Enjoy.

ForgetSecSkill

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


Adventuring Hero
posted November 11, 2022 09:59 PM
Edited by Parascus at 23:45, 11 Nov 2022.

Hi AlexSpl,

that comes in handy and I we will enjoy it. E.g. a boosted Scouting is a real good skill at the beginning but when the cover of darkness is lifted oter skills are more usefull.

Regarding the start of combat I found the function SetupCombat (004635D0) where I can hook in at the end. But finding one answer always leads to the next wuestion. Having two heros in the battle I get both armies of the heros of the registers edi and ebx. But if the defending party is an army itself I get an "unknown" hero without further information. How do I get the creature stacks?

The pseudo code looks like this:

  DWORD baseAddress = 0x00400000;

  battleHeroAttacker = (h3::H3Hero*)c->edi;
  battleHeroDefender = (h3::H3Hero*)c->ebx;

  h3::H3Army attackerArmy = (h3::H3Army)battleHeroAttacker->army;
  h3::H3HeroSpecialty* attackerSpeciality = (h3::H3HeroSpecialty*)(baseAddress + h3::NH3Heroes::eHeroSpecialityAddress:rrin + battleHeroAttacker->id * 0x28);
  DWORD* attackerProperties = (DWORD*)(baseAddress + h3::NH3Heroes::eHeroPropertyAddress:rrin + battleHeroAttacker->id * 0x5C);

  if (battleHeroDefender != 0)
  {
     h3::H3Army defenderArmy = (h3::H3Army)battleHerDefender->army;
     h3::H3HeroSpecialty* defenderSpeciality = (h3::H3HeroSpecialty*)(baseAddress + h3::NH3Heroes::eHeroSpecialityAddress:rrin + battleHerDefender->id * 0x28);
     DWORD* defenderProperties = (DWORD*)(baseAddress + h3::NH3Heroes::eHeroPropertyAddress:rrin + battleHeroDefender->id * 0x5C);
  }
  else
  {
     h3::H3Army defenderArmy = (h3::H3Army)???->army;
  }

Any help is appreciated

Have a nice evening

Parascus
____________

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


Responsible
Supreme Hero
posted November 12, 2022 04:10 PM

You should use managers. In your case, combatManager. Just an example:

#define o_BattleMgr (*(_BattleMgr_**)0x699420)

void showSpells()
{
_Hero_* hero = o_BattleMgr->hero[o_BattleMgr->current_side];

   if (hero && hero == heroToLearn)
   {
       int id = o_GameMgr->GetMeID();
       if (!o_NetworkGame || hero->owner_id == id)
       {
           o_ActivePlayerID = hero->owner_id;
           showSpellDlg(hero, spells, n);
           o_ActivePlayerID = id;
       }

       n = 0;
       heroToLearn = 0;
   }
}

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


Adventuring Hero
posted November 13, 2022 12:23 PM
Edited by Parascus at 16:48, 13 Nov 2022.

Hi @all,

thanks to the support of AlexSpl (also for your last hint) and BTB I have teached my heros to hate!

Hate is a hero speciality which is in effect when fighting against another hero or against creatures. It needs the town type and an attack bonus, e.g. 08 00 00 00 03 00 00 00 04 00 00 00 at 0x678790 gives Clancy the ability to hate Inferno town and everything of it. That means he hates all heretics and demoniacs, he hates all creatures and also if another hero is of this race (Efreeti).

The effect is that a factor is calculated based on the enemy hero and creatures and this is mutliplied by the (attack bonus - level of the creature). So the higher level a creature is the less it's influenced by the hate speech of the hero. Also some creature properties influence the factor e.g. creatures alive have a 10% higher factor but with mind imunity it is reduced to 10% of the total bonus.

in the end the result is added to the attack strength and half of it is added to defence.

But beware of taking any of the hated creatures into yoour army, than the effect is turned around and you lose the corresponding attack and defense.

The funny thing is, that if you hate e.g. Tower you will also gain attack and strength fighting against Yog because he is a Genie.

At this moment the code is a little bit entangled in other stuff but if you are ineressted, I can unhinge it or I can paste the corresponding functions here (allthough it is not really neat coded). I also have un32 and un44 images at start.

I still have problems with the spell calculation in case a creature (e.g. Greater Basilisk casts Petrify). Where do I best get my hook when I want to react on the creature information to calculate the possibility depending on both source and target of a creature spell? >>> Just found out that I could do a hook at 0x5A8950 (combatManager::SpellCastWorks) and there I have a CombatManager ... I will look, what I can do there

Best regards and thanks to you all.

Parascus
____________

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


Famous Hero
Moist & Creamy
posted November 15, 2022 04:02 AM

Made some fourth-tier graphics for luck and morale bonuses to go along with my new caps:

https://cdn.discordapp.com/attachments/692895170722660434/1041902272143183932/image.png
https://cdn.discordapp.com/attachments/692895170722660434/1041902397187956766/image.png
https://cdn.discordapp.com/attachments/692895170722660434/1041907903990333481/image.png
https://cdn.discordapp.com/attachments/692895170722660434/1041907990850187264/image.png

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


Adventuring Hero
posted November 15, 2022 07:30 AM
Edited by Parascus at 08:03, 15 Nov 2022.

I officially announce my interest in this mod

Has anybody an idea how I can add a complete new artifact? By now I found out that I need:
1. An AVA0xxx.def and AVA0xxx.msk in h3sprite.lod
2. An image in Artifact.def
3. An image in ArtifBon.def
4. A line in Objects.txt
5. A "line" in artraits.txt and in artevent.txt
6. The function coded in a dll or directly in hex.

Point 4 and 5 is a little tricky. I copied the row of anoeher artifact e.g. the line with AVA0110 and tried to find out the meaning of the columns. The third column from the right seams to point to the text in file artraits so I changed the value to 144 (for it is the artifact No. 145 and added a line to the artevent. But my artifact is called Head and finding it crashes.

Can someone tell me how to solve this?

Best regards

Parascus
____________

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


Adventuring Hero
posted November 15, 2022 10:01 PM
Edited by Parascus at 09:18, 20 Nov 2022.

Hallo chef modders,

Yesterday was the great day. We played my modded version with own images, specialities, your modds. Many thanks to you all. We also had only two crashes whichI think I know how to fix. THANKS TO YOU ALL!

There is only one thing troubeling me. The calculated damage is extremely dependent on (I think) the creture levels. We had fights with 5 Rocs against 100 Pikemen and gained a flawless victory. Has somebody a hint where I can find the formular in the code to check this? Has there been something changed with HD+?

Best regards

Parascus
____________

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


Famous Hero
Moist & Creamy
posted November 25, 2022 12:25 PM

I've updated the guide with everything that I've been doing lately, including a LOT of optimizations. Even if you don't actually remove anything from the game, there's plenty of free space to be had at this juncture.

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


Adventuring Hero
posted November 25, 2022 10:01 PM
Edited by Parascus at 22:02, 25 Nov 2022.

hello BTB,

thanks for your update. I immediately tried to implement the mage guild expansion. But unfortunatelly I do not manage to get the new levels. Some questions:
1. How can I calculate the dependency address of Mage Guild 5 of Castle.  Unlike other Mage Guild sequeces (where there is always 8 or 12 bytes gap) at Castle the addresses seam to be out of line, having Mage Guild 1 the same address ass Mage Guild 5. Is it correc that the next address should be 23ECAC having two DWORDs for dependency and 1 for FFFFFFF?
2. The second address is the address of the graphics table. Further down below you mention that the name of the TOCSN501 is stored at a free space and this address is written to 28A3EC. This is something I do not understand.
3. How do you edit the sptraits? When I do this in notepad++ it always destroys the n, converting them into rn. Afterwards the game does not start anymore.
4. I have the effect that the castle is still limited to lavel 4. Stronghold and Fortress show a gray build button with the text that this construction cannot be build in this game. The image is the one of the first level. Any clue where I should look for the error? Missing images, solved by dendency table, wrong address uasge?

Best regards and thanks fr your work

Parascus
____________

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


Legendary Hero
Heroes is love, Heroes is life
posted November 25, 2022 11:26 PM
Edited by Phoenix4ever at 23:30, 25 Nov 2022.

Wait, BTB you found a way to build MG4 in Stronghold and Fortress?
That sounds completely awesome.

Is it also possible to decide how many spells are in each level of the Mage Guild? Could I for example reduce level 1 and 2 spells by 1?

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


Famous Hero
Moist & Creamy
posted November 26, 2022 02:52 AM
Edited by BTB at 03:29, 26 Nov 2022.

Parascus said:
1. How can I calculate the dependency address of Mage Guild 5 of Castle.  Unlike other Mage Guild sequeces (where there is always 8 or 12 bytes gap) at Castle the addresses seam to be out of line, having Mage Guild 1 the same address ass Mage Guild 5. Is it correc that the next address should be 23ECAC having two DWORDs for dependency and 1 for FFFFFFF?


It really doesn't matter as long as it's in there - that's why I suggest just rewriting the tables wholesale to make it easier on yourself. I remove Resource Silos in my hack, which gives me some free space. Also, some dependencies are actually not needed: I freed up some space by removing the Fort dependency from Citadels because there's still no way to build them without first building a Fort.

Parascus said:
2. The second address is the address of the graphics table. Further down below you mention that the name of the TOCSN501 is stored at a free space and this address is written to 28A3EC. This is something I do not understand.


So, I wrote 54 4F 43 73 4D 35 30 31 00 to 0C8A0E~16 (Tavern advice free space). 0C8A0E is 4C8A0E in runtime. If we invert that address to make it a DWORD pointer, we get 0E 8A 4C 00. This is what needs to be written to 28A3EC.

Parascus said:
3. How do you edit the sptraits? When I do this in notepad++ it always destroys the n, converting them into rn. Afterwards the game does not start anymore.


Use TxtEdit. There is a link to it in the guide.

Parascus said:
4. I have the effect that the castle is still limited to lavel 4. Stronghold and Fortress show a gray build button with the text that this construction cannot be build in this game. The image is the one of the first level. Any clue where I should look for the error? Missing images, solved by dendency table, wrong address uasge?


The build image is because HallStrn/HallCstl/HallFort need to be updated. I'd guess that the limitation is because you haven't properly added the building dependencies yet.

Phoenix4ever said:
Wait, BTB you found a way to build MG4 in Stronghold and Fortress?
That sounds completely awesome.


Yeah, the WoG portal even put up a video about it:

https://www.youtube.com/watch?v=FJPNCP84POc

Phoenix4ever said:
Is it also possible to decide how many spells are in each level of the Mage Guild? Could I for example reduce level 1 and 2 spells by 1?


Probably. I'd just have to find wherever the Library is called and work from there.

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


Famous Hero
Moist & Creamy
posted November 26, 2022 01:41 PM

Updated to fix a teeny tiny error in the Eagle Eye to Learning artifact conversation that was crashing the game

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


Famous Hero
Moist & Creamy
posted November 27, 2022 07:10 PM

https://cdn.discordapp.com/attachments/692895170722660434/1046422336569622620/conflux.jpg

Added a second Conflux horde building... that ended up being more of a pain in the ass than I was hoping it would be

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

Tavern Dweller
posted November 29, 2022 11:14 AM

Is it possible to change growth per week to growth per 2 weeks, or per month?

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


Famous Hero
Moist & Creamy
posted December 03, 2022 04:03 PM

LGBT_Lover_Boy said:
Is it possible to change growth per week to growth per 2 weeks, or per month?


I imagine that would be pretty simple. I haven't looked into it, but it should probably be as simple as finding a check for day 1 and adding in a check for week 1.

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

Tavern Dweller
posted December 06, 2022 05:46 PM

BTB said:
LGBT_Lover_Boy said:
Is it possible to change growth per week to growth per 2 weeks, or per month?


I imagine that would be pretty simple. I haven't looked into it, but it should probably be as simple as finding a check for day 1 and adding in a check for week 1.


Can you show me how to do it, please?
I have no idea.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 37 pages long: 1 2 3 4 5 ... 10 20 30 ... 33 34 35 36 37 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0917 seconds