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 10 pages long: 1 2 3 4 5 6 7 8 9 10 · «PREV / NEXT»
myocytebd
myocytebd


Hired Hero
posted October 29, 2020 08:37 AM

Phoenix4ever said:
myocytebd said:

It is simple to re-implement creature speciality.
This code around +1 speed serves for both combat data and visual data, the only remaining place is speed calc for map-movement, which is even simpler.
I felt that creature level only matters for speciality, upgrading and AI cheating. Random map spawning seems mostly relevant with spawn number and  AI value and in txt.

So would it work if I just changed their level to 2?

Except that skeletons will not be upgradable in towns. (unsure for hill fort).
As I said, level affects upgrading.
For upgrading a level-X creature in town, SoD logic is:
1. Test if level-X upg. building is built;
2. Test if town's level-X creature equal to selected creature.
Hence step.2 will fail, and almost cannot be fixed without code editing (SoD use an array indexed by town+level, same level->same address)

BTW for such kind of editing, ERA is a good choice.

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


Legendary Hero
Heroes is love, Heroes is life
posted October 29, 2020 08:56 AM

Okay so it won't work, thanks anyway.

Yeah, but I don't think ERA is compatible with HotA.

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


Supreme Hero
Heroes 3 Fan
posted October 29, 2020 11:34 AM

Soon Cove and Factory will be in ERA+ .
____________

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


Hired Hero
posted November 03, 2020 08:02 AM
Edited by myocytebd at 08:03, 03 Nov 2020.

Quote:
How to (un)set/edit the following enemy abilities:
Immunity to Jousting (Troglodites/Pikemen)
Jousting (Cavaliers)

Here starts creature check for if attacker is Cavalier.
Quote:
// ebx: attacking stack. edi: defending stack.
00443066  |.  83F8 0A       CMP EAX,0A

Followed by check for if defender is Pikemen.
And then damage calculation. Easy to rewrite.

However, one caveat: flying units has move distance as zero.
To workaround this problem, we can manually write a as-is move distance:
Quote:
// edx: source grid. edi: destination grid. esi: attacking stack.
004456E2 - 74 34                 - je 00445718

This where the flying vs. non-flying move branches.
Flying/non-flying code are different and only non-flying code update the  distance.
Write a distance to dword ptr [esi+0x490] here can serve as a solution. [esi+0x490] is already cleared to 0 before reaching here.

The direct grid distance (moving by grids) function is:
Quote:
00469250 // Fastcall. ecx/edx: src/dst grid.


BTW:
When hovering mouse over the target, the game uses the direct grid distance between source/destination.
Therefore charge damage is often wrong in mouse hint (under estimation for champion).
So for flying units, I think it had better also use default distance, instead of the true Euclidean distance. (Well, shooters have similar problems)

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


Famous Hero
Moist & Creamy
posted November 03, 2020 09:52 AM

Damn, dude, thanks for looking in to all of this. You're really helping the cause along.

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


Legendary Hero
Heroes is love, Heroes is life
posted November 09, 2020 11:44 PM

BTB I read in your guide about First Aid.
Do you know if/how it's possible to make First Aid Tent mass heal?, and maybe only if you have the skill?
Alternatively can it be made to resurrect/animate or affect war machines?

I already have improved the healing amount and removed the dice roll, but anything to make it better would be appreciated.

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


Responsible
Supreme Hero
posted November 10, 2020 05:55 PM

Only via plugin.

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


Legendary Hero
Heroes is love, Heroes is life
posted November 28, 2020 11:32 AM

BTB I see you have a few questions about the grail yourself, but do you know if it's possible to alter gold and growth bonusses or remove the unique grail bonusses entirely?

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


Famous Hero
Moist & Creamy
posted December 23, 2020 07:34 PM

Just realized I missed your question (to answer it: no)

I have discovered a few things lately, which I'll eventually update the guide with. I've learned how to shift immunity to Poison/Aging over to an unused bit so you can specifically give immunity to them (and other effects) as a separate ability from just living. Paralyze and petrify are included, but since those don't actually check anything for immunity, it does involve some trickery and/or sacrifice.

I've learned how to edit the lookup tables for building dependencies by faction, meaning you can take data away from one to add to another.

Finally, I've learned how to make Dispel simply target all enemies rather than the entire battlefield (much more useful this way, I think).

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


Legendary Hero
Heroes is love, Heroes is life
posted December 23, 2020 11:28 PM

Okay, but thanks for the answer anyway.
I've decided to disable the grail in my map for now, it's too powerful and also kinda ruins some skills.

It's cool you keep learning stuff about the code though, maybe you or others can put it to good use.

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


Adventuring Hero
posted December 31, 2020 11:38 AM
Edited by DarkAtom at 12:05, 31 Dec 2020.

In the guide you say that it is impossible to add new shooters. Not sure if you learned how to do it in the mean time, but if you still didn't, here is how I successfully replaced the Gnoll Marauders with Gnoll Shamans:

Artwork: First, you need a creature def that has a shooting animation, I decided to use the Fortress WoG commander because it fits very well. You also need to add the shooting sound (I used the Lich shot). This is only the artwork that is required in order to not crash the game, but of course you will need to edit the adventure map defs, descriptions etc.

Creature data: You need to give the creature shots in crtraits.txt. Additionally, you need to add the shooter flag in the table at 0x2703B8. To get the correct byte to change, the address is (0x2703C8+0x74*[creature_id]). Bit 2 must be set to make the creature a shooter. Finally, you need to select a shooter missile in the table at 0x3DBA4 (please note that, unfortunately, the table starts from Archers at index 0, so it is impossible to make Pikemen and Halberdiers shoot without some extra work). The possible missiles are:

0. Archer
1. Monk
2. Elf/Sharpshooter
3. Master Gremlin
4. Mage
5. Titan/Storm Elemental
6. Gog
7. Lich
8. Medusa
9. Orc
10. Cyclops
11. Lizardman
12. Ice Elemental
13. Halfling
14. Catapult
15. Ballista
16. N/A

Note 1: Arch Magi, Beholders and Evil Eyes use beams which are set in the table at 0x3F5C4 (unfortunately, like the missiles table, this table doesn't start from ID 0, but rather starts directly with Arch Magi). It also seems like Psychic and Magic Elementals have this beam, maybe they were supposed to shoot in the early stages of development? I don't know how to make a creature use the beam, though, probably it is related to the No Obstacle Penalty flag.

Note 2: Enchanters use a Magic Arrow missile, regardless of the missile set in the table. I don't know where that can be changed.
____________
"If you get scared of doing what's right you might as well lay down and die" - Wulfstan, Heroes of Might and Magic V: Hammers of Fate

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


Famous Hero
Moist & Creamy
posted December 31, 2020 02:09 PM

Thanks for that list!

And yes, I figured the one last step I needed to do was have an actual shooting animation in the .def, but that's the line where I bowed out because graphics editing just isn't happening with me.

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


Adventuring Hero
posted January 02, 2021 01:42 PM

I tried to make the Dragon Flies have vampire's Life Drain (just for fun, no balance). I tried adding it via a plugin, but it didn't work, however, hex-editing the exe worked.

Specifically, in the plugin, I wrote the byte 0 (was 3 before) at address 0x441302. Somehow, however, it didn't work. Editing the executable at address 0x41302 worked just fine.

This seems weird since editing other tables via plugin seems to have no problem. Maybe somebody who knows more about plugins can help me?
____________
"If you get scared of doing what's right you might as well lay down and die" - Wulfstan, Heroes of Might and Magic V: Hammers of Fate

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


Famous Hero
Moist & Creamy
posted January 03, 2021 06:39 PM

So after sitting down and actually looking through the immunity code, it finally hit me that fire immunity could be re-written to only block offensive fire magic instead of beneficial spells. There are a few caveats:

It uses the standard resistance table, so certain creatures are ineligible (i.e. Rust Dragon)

It overwrites Meteor Shower immunity entirely

It removes Armageddon immunity, as well(*)

That last one is the big one and it can actually be put back in if so desired - the sacrifice would be removing immunity to the Thunderbird special ability from Lightning immunity.

Anyway, I haven't tested the code yet, but I don't see any reason why it wouldn't work. I can post if here if anyone is interested.

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


Legendary Hero
Heroes is love, Heroes is life
posted January 04, 2021 12:35 AM

^^ I am interested.
I always thought it was really annoying how fire immune creatures were immune to positive fire spells. (Inteus and Bloodlust for example.)
If possible they should be immune to negative fire spells or damaging fire spells, but not immune to positive fire spells, lightning or Meteor Shower.
You think that is possible?

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


Famous Hero
Moist & Creamy
posted January 04, 2021 12:56 AM
Edited by BTB at 09:21, 05 Jan 2021.

Phoenix4ever said:
^^ I am interested.
I always thought it was really annoying how fire immune creatures were immune to positive fire spells. (Inteus and Bloodlust for example.)
If possible they should be immune to negative fire spells or damaging fire spells, but not immune to positive fire spells, lightning or Meteor Shower.
You think that is possible?



(EDIT: see below post for code that doesn't suck)

The above code just covers immunity to directly offensive spells - for Blind/Berserk, mind immunity covers that. No guarantees made for whatever snowing snowing goddamn snow snow snow snow that HotA decides to do with it.

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


Legendary Hero
Heroes is love, Heroes is life
posted January 04, 2021 01:58 PM
Edited by Phoenix4ever at 13:59, 04 Jan 2021.

Thanks, but have you actually tested it yourself?
So only the damaging fire spells will be blocked and mind immunity is needed for Blind, Berserk and Frenzy?

Lol you were allowed to say goddamn, between all the snowing snow.

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


Famous Hero
Moist & Creamy
posted January 04, 2021 07:43 PM

Phoenix4ever said:
Thanks, but have you actually tested it yourself?


I haven't had a chance. I just got finished work a three-week shift, so I haven't had a chance to do much of anything.

Phoenix4ever said:
So only the damaging fire spells will be blocked and mind immunity is needed for Blind, Berserk and Frenzy?


Yep! And you have to be undead to avoid curse.

Phoenix4ever said:
Lol you were allowed to say goddamn, between all the snowing snow.


What a bunch of Goddamn snow

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


Famous Hero
Moist & Creamy
posted January 05, 2021 09:20 AM
Edited by BTB at 09:21, 05 Jan 2021.

Ok, here's the code, but it actually works because I'm a snowing idiot and the code I posted before subtracted from the pointer instead of added.

Quote:

; Immunities

4A4EE ~ 4A54B

8B 45 F0 ; move spell ID into EAX
83 F8 0D 74 0A ; if Fire Wall jump to immunity, else continue
83 F8 15 74 05 ; if Fireball jump to immunity, else continue
83 F8 16 75 C5 ; if not Immolate exit, else continue
D9 05 64 AC 63 00 5F 5E 5B 8B E5 5D ; immunity
C2 08 00 ; return

8B 45 F0 ; move spell ID into EAX
83 F8 11 74 0A ; if Lightning Bolt jump to immunity, else continue
83 F8 13 74 05 ; if Chain Lightning jump to immunity, else continue
83 F8 4C 75 A4 ; if not Thunder exit, else continue
D9 05 64 AC 63 00 5F 5E 5B 8B E5 5D ; immunity
C2 08 00 ; return

8B 45 F0 ; move spell ID into EAX
83 F8 10 74 05 ; if Ice Bolt jump to immunity, else continue
83 F8 14 75 88 ; if not Ice Blast exit, else continue
D9 05 64 AC 63 00 5F 5E 5B 8B E5 5D ; immunity
C2 08 00 ; return

04A64C: 0A A5 44 00 -> 0F A5 44 00 ; moves O-Lightning exit pointer


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


Famous Hero
Moist & Creamy
posted January 06, 2021 09:40 AM

I've also figured out how to make disease more effective. Downside is that I'm pretty sure the static value of 2 is shared since it gets set before a pretty massive jump table. So, to be safe, we jump to some unused code (10 bytes are required) and THEN to the disease routine.

This is a downside insomuch as this is unused code I've created for myself - you'll have to find your own.

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

Page compiled in 0.0580 seconds