|
Thread: Heroes 3 - Editing heroes in memory | This thread is pages long: 1 2 3 4 5 · «PREV / NEXT» |
|
avatar
Promising
Supreme Hero
|
posted April 12, 2018 06:41 AM |
|
|
Just zip file and rename extension to .cgm
____________
|
|
seayeah
Tavern Dweller
|
posted April 12, 2018 05:01 PM |
|
|
Can you help me look for first aid in the image? I still can't figure the chart out. The code doesn't really match what this is showing me. That or I just don't know how to properly read it yet.
My Yog in game has, going by order, Pathfinding-Ballistics-Tactics-Offence-First Aid-Air magic-Logistic-Wisdom. All expert.
Just fixed the image. Didn't realize it wasn't showing till now.
|
|
Maurice
Hero of Order
Part of the furniture
|
posted April 12, 2018 08:48 PM |
|
Edited by Maurice at 14:01, 13 Apr 2018.
|
I've taken your picture and edited it to show different data entries. I hope you can see it:
Edit: image link is botched, will need to try something else. The below text should still be accurate and self-explanatory. End edit
First you have the blue entry, which is 13 bytes long and starts with "Yog" and then ten 00's. This is the Hero name.
Following it, in red, you get 28 bytes that detail the skill level. Each position represents a specific skill, where the position is as follows (counting the first position in the listing as 00):
00 Pathfinding
01 Archery
02 Logistics
03 Scouting
04 Diplomacy
05 Navigation
06 Leadership
07 Wisdom
08 Mysticism
09 Luck
10 Ballistics
11 Eagle Eye
12 Necromancy
13 Estates
14 Fire Magic
15 Air Magic
16 Water Magic
17 Earth Magic
18 Scholar
19 Tactics
20 Artillery
21 Learning
22 Offense
23 Armorer
24 Intelligence
25 Sorcery
26 Resistance
27 First Aid
As such, your Yog has 8 skills, each at Expert level (I count 8 03's in that section), and to be precise, the following skills:
- Pathfinding
- Logistics
- Wisdom
- Ballistics
- Air Magic
- Tactics
- Offense
- First Aid
Yes, it's possible to edit your Hero to be expert in all 28 skills this way and yes, that works.
The next 28 bytes, in the green frame, detail the position of each skill, in the Hero Skill slots as displayed in the Hero paper doll, when you open the Hero detail screen ingame. The general layout is as follows:
1 2
3 4
5 6
7 8
Based on your image, again counting positions in the 28 byte string and relating them to the skill list I detailed above, your Yog has the following layout:
1 = Pathfinding
2 = Ballistics
3 = Tactics
4 = Offense
5 = First Aid
6 = Air Magic
7 = Logistics
8 = Wisdom
|
|
Beezerturnip
Tavern Dweller
|
posted May 20, 2018 05:16 AM |
|
|
So, ironically, I found this thread while trying to figure out what to do what Seayeah is attempting, modifying the Shadow of Death hero figures, playing the GOG version, although in my case it's more to be in line with their stats at the end of the individual heroes' respective campaigns.
I've been using 7zip to unzip the .CGM files and then to re-zip them after editing Yog's stats. (I wanted to do a simple edit to test concept before fixing up the skills and things like XP) As per the recommendation of Baronus and Maurice, I have ignored the CRC error, and then renamed the extension to .CGM.
This has yielded a new file that Homm 3 cannot read, even though it's listed as a CGM. I'm sure I've messed something up, but I'm not entirely sure what. Any help would be greatly appreciated.
Best wishes,
The Turnip.
____________
|
|
Alyx182008
Adventuring Hero
|
posted May 20, 2018 07:49 AM |
|
|
Haven't tried it myself, but try using different levels of compression. It's possible that if you use the wrong settings when recreating the archive, the game won't be able to open it.
|
|
Beezerturnip
Tavern Dweller
|
posted May 21, 2018 01:09 AM |
|
|
Alyx182008, that was enormously helpful. At least with 7-zips format, formatting in gzip works, whereas the other ones I tried did not. I am uncertain as to why, but as a practical matter, I don't care all that much.
Best wishes,
The Turnip.
____________
|
|
catshy
Tavern Dweller
|
posted January 31, 2019 05:40 PM |
|
|
Hello, I want to back to this topic, because I think that its very interesting topic for modders.
I have recently tried to read the number of units in the castle, but this is very complicated for me, because there are no hooks in the memory to find this information.
In the case of the hero's army, I am looking for information by name, but in the case of a castle, searching by name does not give a good result here.
Do anybody know how to do it?
|
|
Razi
Tavern Dweller
|
posted February 12, 2020 02:56 PM |
|
Edited by Razi at 18:28, 12 Feb 2020.
|
catshy said: Do anybody know how to do it?
Place the units in the first unit slot of the castle, without a hero in the castle, and search for the number of units.
Also from castle unit quantity minus 240 bytes is found Hero ID in castle.
from slot 1 of castle unit quantity minus:
-250 bytes: Construction was done on that day; values: 00: Can build; 01: Can't build
-240 bytes: Hero ID in castle
-236 bytes: Hero ID for Host in castle
-230 bytes: available quantity of level 1 units in fort
-228 bytes: available quantity of level 2 units in fort
-226 bytes: available quantity of level 3 units in fort
-224 bytes: available quantity of level 4 units in fort
-222 bytes: available quantity of level 5 units in fort
-220 bytes: available quantity of level 6 units in fort
-218 bytes: available quantity of level 7 units in fort
or if not all units are upgraded, then
-230...-218 bytes: available quantity of level 1-7 not upgraded units in fort
-216...-192 bytes: available quantity of level 1-7 upgraded units in fort
-184 bytes: 1-st spell id level 1 in castle
-180 bytes: 2-nd spell id level 1 in castle
-176 bytes: 3-rd spell id level 1 in castle
-172 bytes: 4-th spell id level 1 in castle
-168 bytes: 5-th spell id level 1 in castle
-164 bytes: 6-th spell id level 1 in castle
-160 bytes: 1-st spell id level 2 in castle
-156 bytes: 2-nd spell id level 2 in castle
-152 bytes: 3-rd spell id level 2 in castle
-148 bytes: 4-th spell id level 2 in castle
-144 bytes: 5-th spell id level 2 in castle
-140 bytes: unknown
-136...-124 bytes: spells 1,2,3,4 level 3 in castle
-112...-104 bytes: spells 1,2,3 level 4 in castle
-88..-84 bytes: spells 1,2 level 5 in castle
from slot 1 of castle unit quantity minus 64 bytes: change this value to 05 to open magic spells of level 1 in castle (in the magic guild)
-64 bytes: open level 1 spells; max value = 6
-63 bytes: open level 2 spells; max value = 5
-62 bytes: open level 3 spells; max value = 4
-61 bytes: open level 4 spells; max value = 3
-60 bytes: open level 5 spells; max value = 2
So, to open all spells in the magic guild -64...-60 bytes change this values to: 05 04 03 02 01 for castle that can build level 5 magic guild, but it requires to build atleast magic guild of level 1
from slot 1 of castle unit quantity minus:
-28...-4: unit type slot 1-7 (in castle without Hero)
0...+24: unit quantity slot 1-7 (in castle without Hero)
____________
|
|
Baronus
Legendary Hero
|
posted February 12, 2020 04:53 PM |
|
|
I suggest weird number
1113 peasants 1237 pikemans etc. You can see where it is. 12,14,16 may be a lot of times.
|
|
AlexSpl
Responsible
Supreme Hero
|
posted February 12, 2020 05:30 PM |
|
Edited by AlexSpl at 17:32, 12 Feb 2020.
|
You can follow the next steps to find a town garrison's army (for SoD 3.2 EN):
Quote: For SoD 3.2 / HD mod:
Let GameMgrAddr = DwordAt(0x699538);
TownAddr = DwordAt(GameMgrAddr + 0x21614) + Town_ID * 0x168;
Then, GarrisonAddr = TownAddr + 0xE0;
As you can see, town's structures start from DwordAt(GameMgrAddr + 0x21614) and the size of each structure is 0x168 = 360 bytes.
|
|
Razi
Tavern Dweller
|
posted February 12, 2020 06:13 PM |
|
|
Baronus said: I suggest weird number
1113 peasants 1237 pikemans etc. You can see where it is. 12,14,16 may be a lot of times.
All this is done in memory when the game is running.
Need to put the units in the first unit slot of the castle and search for the number of units, then change the number of units in the first unit slot of the castle and search for the changed number of units. The number of units can be found in 5 seconds, when the game is running.
____________
|
|
AlexSpl
Responsible
Supreme Hero
|
posted February 12, 2020 06:26 PM |
|
Edited by AlexSpl at 18:29, 12 Feb 2020.
|
Yeah, hexadecimal search is the fastest way to find something for humans. But, you can never be sure if you've found what you searched for. The more bytes you search for, the higher chance to find exactly what you need.
Also, search won't work for towns which you don't own. So, it's better to use the algorithm above to locate a town in memory. Especially, it's good for scripts.
|
|
Razi
Tavern Dweller
|
posted February 12, 2020 07:12 PM |
|
Edited by Razi at 20:28, 12 Feb 2020.
|
AlexSpl said: Yeah, hexadecimal search is the fastest way to find something for humans.
No, this is a decimal search. Just need to use memory scanning application, something like cheat engine or similar. We can change found value to be sure if we found what we searched for. Yes, if you don't own town, then it's better to use the algorithm above.
Do you happen to know how to add the ability of auto-magic, which Enchanters have, to another creature (for Angel or Monk) in memory?
Or, do you know how to add the ability to Hero, to use magic (Slow,Curse,Weakness) at the start of the battle without Armor of the damned?
____________
|
|
AlexSpl
Responsible
Supreme Hero
|
posted February 12, 2020 07:44 PM |
|
|
Quote: Do you happen to know how to add the ability of auto-magic, which Enchanters have, to another creature (for Angel or Monk) in memory?
Or, do you know how to add the ability to Hero, to use magic (Slow,Curse,Weakness) at the start of the battle without Armor of the dammed?
I doubt it can be achieved with just memory editing, unless you use some really weird and not recommended tricks or workarounds (with hidden artifacts, for example). You'll have to mess with code in this case. For such tasks I recommend to write plugins.
|
|
catshy
Tavern Dweller
|
posted February 13, 2020 05:17 PM |
|
|
Hello guys!
I have a question about secondary skills which u can choose when hero get a level up - in H3 SOD.
Maurice wrote infos about editing all data about any hero, but it is possible to read from these data which two other secondary skills will be available during level up?
|
|
AlexSpl
Responsible
Supreme Hero
|
posted February 13, 2020 05:28 PM |
|
Edited by AlexSpl at 17:39, 13 Feb 2020.
|
No, you can't change them in memory (you, actually, can but that's what I call a dirty trick). To alter the algorithm which generates a secondary skill pair, you definitely need to write a plugin. Also, for programmers, I can share LMOracle.SkillTreeAPI (API to work with skill trees).
LMOracle.SkillTreeAPI
From there you can import the following functions:
BYTE GetSkillOffer(const THero *Hero, const TWeights *Weights, const BYTE Level, const TSkillExcept *SkillExcept, const BYTE MinLevel, const BYTE MaxLevel, const BYTE LeftSkill, DWORD &R)
int LevelUp(void *HeroRecord, const void *WeightsRecord, void *SkillOfferRecord, const BYTE Option, const BYTE SlotCount)
|
|
catshy
Tavern Dweller
|
posted February 13, 2020 05:42 PM |
|
Edited by catshy at 17:43, 13 Feb 2020.
|
AlexSpl, thanks for answer. Im a newbie in write plugins, so Im trying just edit memory for now, and use some of ASM. can u tell me please (can be in private message if u need) how to do it without write plugins?
Edit:
I actually care about reading the data itself - without editing
|
|
AlexSpl
Responsible
Supreme Hero
|
posted February 13, 2020 06:00 PM |
|
Edited by AlexSpl at 18:08, 13 Feb 2020.
|
Well, the info about secondary skills at the next level-up isn't stored in memory before that level-up triggers. You can read skills only when the skill choice dialogue is shown. To predict skills you need an algorithm. There are no other ways to know which skills will be offered before leveling-up.
It's really so complicated. There are no easy ways.
* * *
You can use the aforementioned library or you'll have to write your own to predict skill offers.
|
|
catshy
Tavern Dweller
|
posted February 13, 2020 06:05 PM |
|
|
I see, thanks for answer maybe I will return to this when I acquire more skills
|
|
AlexSpl
Responsible
Supreme Hero
|
posted February 13, 2020 06:19 PM |
|
Edited by AlexSpl at 18:28, 13 Feb 2020.
|
|
|
|