Skip to content

Posts from Attempt to add new spells and skills.

5.0 (1 rating)
Auto-translated
We are discussing the addition of new spells and skills in this topic!

psatkha
Well, if that's the case, here are the offset addresses for these three fixes in the .exe version 3.1

1) 0044bf40

2) 00446cb0 ... here for DD the address is 00446cb1

3) 00988c10 ... here for DD the address is 00988с1f

Here are two versions for the clean 3.1 and for NCF with one skill added, i.e., I replaced DD with DE ... just to verify functionality, so to speak.

Let's figure this out in more detail, it's not entirely clear to me.
So I have the standard NCF.exe version 3.1 of the game, the file is 12 783 KB - 13089792 bytes, unchanged by me after download. No Quantomas or anything else.

In other words, in my executable, you mention bytes with ordinal numbers 0044bf40, 00446cb0, 00988с10.
The file contains 15292 occurrences of byte 221

OK, let's dig through it using this pattern.

DD 00 00 00 8D 44 24 24  50 8D 4C 24 1C 51 68 FC to 
DE 00 00 00 8D 44 24 24 50 8D 4C 24 1C 51 68 FC

If we put all this into an array of numbers to search in the file, it's
[221, 0, 0, 0, 141, 68, 36, 36, 80, 141, 76, 36, 28, 81, 104, 252]
My NCF executable doesn't have this combination anywhere (not at all)
I checked 0044bf40 +16 and I have it looking like this:

[221, 0, 0, 0, 141, 68, 36, 36, 80, 141, 76, 36, 28, 81, 104, 220]

which differs only in the last byte (DC).

B8 DD 00 00 00 C3 CC CC  CC CC CC CC CC CC CC CC to
B8 DE 00 00 00 C3 CC CC CC CC CC CC CC CC CC CC CC CC

Let's move on. The combination above
[184, 221, 0, 0, 0, 195, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204]
Exists only at byte number 4484272, or 0x446cb0, generally as you wrote.

28 E8 5A AC FF FF 8D 4C  24 24 51 8B 4E 04 68 DD to 
28 E8 5A AC FF FF 8D 4C 24 24 51 8B 4E 04 68 DE
The combination above
[40, 232, 90, 172, 255, 255, 141, 76, 36, 36, 81, 139, 78, 4, 104, 221]
I don't have it either. At address 00988c10 +16 it looks like this for me:
[40, 232, 138, 172, 255, 255, 141, 76, 36, 36, 81, 139, 78, 4, 104, 221]

which differs in the third byte (8a).

So it turns out the combination specified on the website might be incorrect. But, apparently, if I change the bytes at positions 0044bf40, 00446cb1, 00988с1f
(in standard decimal: 4505408, 4484273, and 9997343) from b'\xdd' to b'\xff'
+ modify the xmls, then theoretically the skill limit will increase to 255. (as mentioned above, these skills are dummies with no logic)

But thanks to your info, for this change no special tools or Quantomas are needed, got that sorted.

So how to get around 255?

Added 4 minutes later
dredknight
How did you achieve this?
Creature.xdb -> /GameMehanics/Creature/Creatures/X_TOWN/CREATURE_XXX.xdb

Entry
2

By changing value 2 to a larger size.
Generally, the result indicates you shouldn't do this, because the creature won't be able to move and will have an unattractive view in combat.

Added 18 minutes later
Gerter
Thank you. I'll try it now.
Artifact-wise, it's all straightforward + you can easily expand their number
I'll also check that, although I prefer reading text. Here, I'd also like to know which byte(s) needs to be changed and how, so that the standard NCF starts supporting this, if you know it?
I don't have any ideas for creating any artifacts, but surely there will be someone from whom I can borrow a ready-made one and add it for in-game use
User Avatar
Auto-translated
vasik

Let's look into this in a bit more detail, I don't quite understand.
I have the standard NCF.exe 3.1 version of the game, file size 12 783 kb - 13089792 bytes, which hasn't been modified by me since downloading. No Quantomas or anything else is present.

In other words, in my exe you mention bytes with ordinal numbers 0044bf40, 00446cb0, 00988с10
There are a total of 15292 occurrences of bit-221 in the file

Ok, let's dig through using this pattern.

DD 00 00 00 8D 44 24 24  50 8D 4C 24 1C 51 68 FC to 
DE 00 00 00 8D 44 24 24 50 8D 4C 24 1C 51 68 FC

If you put all this into an array of numbers to search the file, it's
[221, 0, 0, 0, 141, 68, 36, 36, 80, 141, 76, 36, 28, 81, 104, 252]
In my ncf exe, such a combination does not exist (at all)
I checked 0044bf40 +16 and for me it looks like this:

[221, 0, 0, 0, 141, 68, 36, 36, 80, 141, 76, 36, 28, 81, 104, 220]

where there is a difference in the last byte (DC).

B8 DD 00 00 00 C3 CC CC  CC CC CC CC CC CC CC CC to
B8 DE 00 00 00 C3 CC CC CC CC CC CC CC CC CC CC

Moving on. The combination above is
[184, 221, 0, 0, 0, 195, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204]
It only exists at byte number 4484272 or 0x446cb0, generally as you wrote.

28 E8 5A AC FF FF 8D 4C  24 24 51 8B 4E 04 68 DD to 
28 E8 5A AC FF FF 8D 4C 24 24 51 8B 4E 04 68 DE
The combination above is
[40, 232, 90, 172, 255, 255, 141, 76, 36, 36, 81, 139, 78, 4, 104, 221]
I don't have that one either. At address 00988c10 +16 it looks like this for me:
[40, 232, 138, 172, 255, 255, 141, 76, 36, 36, 81, 139, 78, 4, 104, 221]

it differs by the third byte (8а)

As a result, it turns out that the combination specified on the site might be incorrect. But apparently, if I change the specified bytes at numbers 0044bf40, 00446cb1, 00988с1f
(in normal decimal system these are 4505408, 4484273 and 9997343) from b'\xdd' to b'\xff'
+ change the xmls, then in theory the skill limit will be increased to 255. (as mentioned above, these are dummy skills without logic)

But thanks to your info, no special tools or Quantomas are needed for this change; I've figured that out.

Now, how do you bypass 255?
Let's start with the fact that nobody did anything with bits here, and all manipulations were performed exclusively with bytes (a bit is the smallest unit of information measurement in the binary system capable of taking one of two permissible values - 0 or 1, a component part of a byte... there are eight bits in a byte)!

What was provided in your link is absolutely correct, but that correctness applies exclusively to the Quantomas version, and it's foolish to look for a full signature consisting of 16 bytes in other versions!

All these bytes should be perceived not just as a set of bytes, but as machine code; for example, this signature:
B8 DD 00 00 00 C3 CC CC  CC CC CC CC CC CC CC CC to
B8 DE 00 00 00 C3 CC CC CC CC CC CC CC CC CC CC
B8 DD 00 00 00 C3 - all subsequent cc are no longer code

translated into assembler, this will be:

mov eax, 000000DDh - places the value 221 (decimal) into processor register EAX
retn - returns to the calling procedure
DD 00 00 00 8D 44 24 24  50 8D 4C 24 1C 51 68 FC to 
DE 00 00 00 8D 44 24 24 50 8D 4C 24 1C 51 68 FC
here, the code 68 is off-screen before DD

68 DD 00 00 00
8D 44 24 24
5D

push 000000DDh - places the value 221 (decimal) on the stack, i.e., puts the value in a memory cell pointed to by the ESP register
lea eax,[esp+24h] - loads into EAX the address of the value located at address ESP + 24h (36 decimal)
push eax - allocates space at the top of the stack and places the value from register EAX there

and so on.
28 E8 5A AC FF FF 8D 4C  24 24 51 8B 4E 04 68 DD to 
28 E8 5A AC FF FF 8D 4C 24 24 51 8B 4E 04 68 DE
Here, the code we need is located with three bytes - 00 00 00 off-screen before the code 68 DD

push 000000DDh - places the value 221 (decimal) on the stack, i.e., puts the value in a memory cell pointed to by the ESP register

---

Bypassing 255 is possible; you just need to enter something larger than 000000FFh... let's say 1000 - 000003E8h

But first, we need to find out if the esteemed comrade Gerter managed to add new functionality to the 222nd skill!
С уважением, Psatkha (Псатха)

---------------------------------------------

Неудачное планирование ведёт к неудаче ...

NCF - мод, добавляющий дополнительных существ в HeroesV 3.1
Auto-translated
yes, it's actually byte 221, I just named it wrong.

All of this can be changed without assembly code, simply by replacing bytes (read the file as a set of bytes, change the necessary ones, and write it back to another file; it will be even easier).
I'll try it tonight too.
In reply to vasik
User Avatar
Auto-translated
vasik
Is changing the zeros guaranteed to produce the desired effect?
Can all of this be changed without assembly code, simply by replacing bytes (read the file as a set of bytes, change the necessary ones, and write them back to another file; this would actually be easier).
I'll try it tonight as well.
Damn... I wrote a complete code for this specific DD! For whom?

68 DD 00 00 00

push 000000DDh - this is a 4-byte value; it's not certain that the game engine will handle an array of this size, but two bytes might work, meaning that the second byte is already used for 256! Increasing it to 1000 in the .exe file is not a problem at all! The main thing is to be able to add functionality for this 1000!

Added 1 hour 23 minutes ago
Gerter
Scripted mechanics will work normally, including for the AI, so if it's really possible to add new IDs (255 will work fine) to version 3.1, I would gladly add something like that.
Listen, is it possible to add new spells using scripts?
С уважением, Psatkha (Псатха)

---------------------------------------------

Неудачное планирование ведёт к неудаче ...

NCF - мод, добавляющий дополнительных существ в HeroesV 3.1
In reply to psatkha
User Avatar
Auto-translated
psatkha

Hey, is it possible to add new spells using scripts?!
Only if they are used on the map; unfortunately, it's not possible to add combat spells. (You can, however, add a new mechanic to existing spells using workarounds.)
Нет войне.
User Avatar
Auto-translated
Gerter
only if used on the map, it won't work for combat spells, unfortunately (you can add a new mechanic to existing ones using workarounds, but that's it).

So, if in the types.xml file

after the code:
				
SPELL_EFFECT_FIRST_AID_TENT_PLAGUE
352
you add something like:
				
SPELL_NEW_SAMPLE_SPELL
353


And, of course, increase the total number of spells in the .exe file – will that have no effect?

С уважением, Psatkha (Псатха)

---------------------------------------------

Неудачное планирование ведёт к неудаче ...

NCF - мод, добавляющий дополнительных существ в HeroesV 3.1
In reply to psatkha
User Avatar
Auto-translated
psatkha

So, if in the types.xml file

after the code:
				
SPELL_EFFECT_FIRST_AID_TENT_PLAGUE
352
you add something like:
				
SPELL_NEW_SAMPLE_SPELL
353


And, of course, increase the total number of spells in the .exe file – will that have no effect?!

The problem is that on the map, for example, you can track whether a hero has a new skill/spell and, depending on this, write a script to define the logic of this new skill. But it will not be possible to track the use of a new spell in battle, so there is no way to define the mechanics. However, it will be possible to add a new active ability to creatures if you increase their number.
Нет войне.
In reply to Gerter
User Avatar
Auto-translated
Gerter
But here, it will be possible to write a new active ability for creatures if their number is increased.
What about this:
Table_CreatureAbility_CombatAbility

175 is the limit for the number of creature abilities... is it possible to add new functionality using scripts?

P.S.

The file GameMechanics\RefTables\UndividedSpells.xdb contains all the spells:

there are SPELL_ABILITY_CUSTOM1 ... SPELL_ABILITY_CUSTOM4, and the esteemed comrade Dyrman uses three out of four CUSTOM_ABILITY for heroes in NHF (Valafar, Nergal, Biara), you know that... so, if you add a few more up to SPELL_ABILITY_CUSTOM9, will you be able to add new functionality to them?!

С уважением, Psatkha (Псатха)

---------------------------------------------

Неудачное планирование ведёт к неудаче ...

NCF - мод, добавляющий дополнительных существ в HeroesV 3.1
In reply to psatkha
User Avatar
Auto-translated
psatkha
What about this:
Table_CreatureAbility_CombatAbility

175 is the limit for the number of creature abilities... is it possible to add new functionality using scripts?

No, you can only create activatable abilities. I tried to create something like this from an existing spell: here, for example, a new zombie ability has been added - if the number of enemy units falls below 30%, the zombie gains a spell that, when activated, allows them to attack that unit regardless of distance.
Video
If the number of spells is expanded, it will be possible to create abilities like this, with normal descriptions and everything.
Нет войне.
In reply to psatkha
Auto-translated
psatkha
That is, if in the types.xml file

after the code:
				
SPELL_EFFECT_FIRST_AID_TENT_PLAGUE
352
you add something like:
				
SPELL_NEW_SAMPLE_SPELL
353


And, of course, increase the total number of spells in the .exe file – will it have any effect?

It seems that this might not be enough, but it should work in theory.
* In types, there is also ; it needs to be added here as well.
* Then, you need to add a link to /GameMechanics/Spell/Combat_Spells/something_there in /GameMechanics/RefTables/UndividedSpells.xdb.
* Then comes the most difficult part – animations, two files in /GameMechanics/Spell/Combat_Spells/something_there, damage / duration.
* And a couple more files in Effects and Sound (similar to existing spells).

In addition to this, there is also map.xdb, and you will most likely have to manually add the new spell to the list of spells (at least for old maps). I don't know if the new spell will appear in newly created maps...

That is, it is most likely possible to do. You need to know the byte / bytes that store the maximum number of spells, and then a lot of hassle with animations / music.

Added 3 minutes ago
In general, if you think about it, there is a Devil's Strike spell that visually works like a meteor shower. You can create new spells with animations from old ones; it won't be as beautiful, but it will save you a lot of trouble, and you can reference existing working spells for effects and music. But which byte is responsible for this?

Added 7 minutes ago
By the way, it's not entirely clear how the AI will use them in battle. It probably won't. But at least you can create a water and earth super spell.

Another point: there are Fire Wave and Devil's Chain. ORCS CAN use them. It seems that they will also be able to use water and earth spells if you do it similarly...
The AI rarely uses Fire Wave in auto-battle; it only does so when it can't do anything else. But it quite consciously throws the chain and very often, especially orcs. I don't know how to handle this
User Avatar
Auto-translated
vasik
You need to know the byte number/bytes that store the maximum number of spells.
Well, they aren't secret; I found them... I'll also increase them by one for testing!

Will you take on editing types.xml and all the related .xdb files?!

Regarding the visual effects, I have some ideas in my collection, so I don't consider further work on improving the visuals to be a problem at all!

The same goes for the sounds...
С уважением, Psatkha (Псатха)

---------------------------------------------

Неудачное планирование ведёт к неудаче ...

NCF - мод, добавляющий дополнительных существ в HeroesV 3.1
In reply to psatkha
Auto-translated
I don't know if changing the byte will work, but I might be able to try adding 2 top-tier spells and testing them out. However, whether they will automatically be added to every map is uncertain. So, what is the byte number and its values?
In reply to vasik
User Avatar
Auto-translated
vasik
I don't know, if the byte modification works, I might be able to try adding 2 top spells and test it, but whether they will be automatically added to each map is not certain. So, what is the byte number and its values?
Here are two versions of the .exe file - a clean 3.1 and NCF, respectively!

Here, the maximum possible number of spells has been increased from 353 to 354, i.e., the number of skills remains unchanged, only the spells!

Here are the addresses: 00446с91 and 0044bdc0.
Attachments 2
2 files attached • Total size: 25.0 MB
С уважением, Psatkha (Псатха)

---------------------------------------------

Неудачное планирование ведёт к неудаче ...

NCF - мод, добавляющий дополнительных существ в HeroesV 3.1
In reply to psatkha
User Avatar
Auto-translated
psatkha

Here are two .exe versions – a clean 3.1 and an NCF version!

The maximum possible number of spells has been increased from 353 to 354; the number of skills remains unchanged, only the spells!

Here are the addresses: 00446с91 and 0044bdc0

With your knowledge of these bit systems, you should create a high-quality .exe file once, expanding the skills, spells, creatures, artifacts, and levels, and upload it as a separate file in a separate thread. That would be a real celebration!
Ссылка на мой мод Heroes 5 Armageddons Blade

Ссылка на мои уроки по модостроению в Героях 5

Ссылка на мой Artstation
Auto-translated
I couldn't get it to work.

According to the specified value, I have byte 97, while in your version it's 98 (+1). It's not entirely clear why it's 97+, and not 353 - 354.

I've attached the modified file that I used, changing the extension from zip to h5u. I added extra spells, but they didn't appear anywhere. Maybe you just need to replace the XML file in the data folder, and not add a new h5u file. Maybe I missed something, or maybe it's not working, or maybe the byte is incorrect?
Attachments 1
1 file attached • Total size: 125.6 KB

Statistics

Welcome our newest member: Emil