|
Thread: RoseKavalier's creature ability plugin | This thread is pages long: 1 2 · NEXT» |
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 01, 2021 11:18 AM |
|
Edited by NimoStar at 13:50, 05 Apr 2021.
|
RoseKavalier's creature ability plugin
Since there is no dedicated thread for this and it deserves it, I will make one.
(Mods, please mark this as "Project" so first post can be editable. Thanks)
Find it here:
https://github.com/RoseKavalier/H4MS/releases
More info here:
http://heroescommunity.com/viewthread.php3?TID=46056&pagenumber=1
This plugin is intended to patch your H4 file with a creature ability list of your choice. It can let you add 4 abilities to each creature by editing this file inside "Plugins" folder.
__________________________
However, take this into account:
I have been trying to use RoseKavalier's extension with my mod lately (https://www.moddb.com/mods/greatest-mod/downloads/greatest-mod-alpha-019a-testable), but with no sucess.
There are at least two problems:
- The asking of the file name is pretty pointless, since if the file name has spaces and isn't "heroes4.exe", the command prompt will just shut down with "can't open file".
- Worked on default heroes4.exe, but when trying to use with my mod's exe, it says "the provided file is not valid for patching"
But why not?
The adress of creatures abilities is the exact same.
This doesn't just affect my mod however; the same happened when trying to patch the original Equilibris 355 exe.
As many H4 players use Equilibris too, and modders like me use it as a base to add features since they have more artifacts and add mass spells to creatures, this makes the patch quite limited in only working with base, unmodded H4.
I will also add a bug report on github.
Another bug:
In the default list, creature abilities are displaced by one.:
Quote: "Waspwort": [
"Undead",
"Tougness"
],
"Water Elemental": [
"Ranged",
"Weakness"
],
"White Tiger": [
"Elementals",
"Spellcaster",
"Cold Resistance",
"Cold Attack"
],
"Wolves": [
"First Strike"
],
"Zombie": [
"Strikes Twice"
]
Any H4 player can see what's wrong there, waspworts are ranged and weakness, water elementals are the elemental spellcasters, white tigers first strike and wolves strike twice. Zombies are the undead and toughness (which lacks an "h")
_ _
Other problems:
Some abilities work and aren't listed by name. There is no way to use them with the plugin even if you can use them by hex editing. These abilities don't have an ingame icon (appear as empty icon) but work mechanically ingame.
- There is a tested working hex code for "extra shooting attack" (separate and cumulative with Elf one, in fact in my mod elves triple-shoot)
- "extra melee attack" is another one of these alt-abilities that work. They are listed in abilitie's hex lists but there is no way to automatically add them here.
(the first ability is used by a bow relic artifact, the second I am not sure, maybe another artifact or the hero's double melee attack from the skill)
- "Melee giant slayer" and "ranged giant slayer" abilities. (added to heroes by artifacts, usable in creatures too like th others)
* Spelling is inconsistent. Sometimes it says "Resistence" and anothers "Resistance". While this is more minor, it bears mention since it can affect workflow when writing abilities into the file.
Anyone is welcome to help log these into the github or ask RoseKavalier to pass commits.
_____________________
Also, as a reminder to people using this or that would like to use it, I write the following guide:
Quote:
the next abilities do nothing actually, either they are hardcoded in some other place or literally inert.
I write the names as RoseKavalier did:
- "Taxpayer" (the script only counts peasants, even if you put the ability in other creatures)
- "Tougness"
- "Strenght" (seems to make creature weaker, not stronger)
- "Magic Resistence" (the resistance is hardcoded elsewhere; note that "Magic Immunity" does work)
Abilities which "are spells". Spells and spell points and magic power for creatures are actually stored elsewhere, these abilities are just an icon and description:
- "Spellcaster"
- "Terror"
- "Bloodlust"
- "Resurrection"
- "Fortune"
- "Mirth"
Etc. if appliable
Note that this concerns only spells cast by spellbook with creature spell points. Abilities of spells cast by attack (such as Curse, Weakness, Aging, Hypnotize etc.) do work as one would expect.
____________
|
|
Jagulars
Tavern Dweller
|
posted April 01, 2021 12:43 PM |
|
|
Resistence is a typo, incorrect language.
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 01, 2021 01:04 PM |
|
Edited by NimoStar at 14:46, 01 Apr 2021.
|
I know, just pointing it out. I can't correct it in the file as that would make the ability stop working, if has to be corrected in source code.
There is also the typo of "hafling" instead of halfling
____________
|
|
Jagulars
Tavern Dweller
|
posted April 01, 2021 01:55 PM |
|
|
I see. Yes, programmers tend to be sloppy with their language.
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 01, 2021 02:49 PM |
|
Edited by NimoStar at 14:50, 01 Apr 2021.
|
The source code is public, so in theory anyone could fix it in a fork even without RoseKavalier's intervention, but that would unnecessarily divide the project; and also, I am not a programmer and there are no instructions to compile so I can rerelease.
Taking that into account, we must hope RoseKavalier can see this.
I am NimoStar in github too, so if I could have permission in the project, I could make these fixes directly.
____________
|
|
RoseKavalier
Admirable
Supreme Hero
|
posted April 01, 2021 03:53 PM |
|
|
Disclaimer:
I'm not a heroes4 players.
I did not spend more than 5 minutes reverse engineering the executable when doing this initially, mostly to grab alloc/free addresses.
I do not have plans to further reverse engineer the executable.
Let me address the raised issues:
NimoStar said: - The asking of the file name is pretty pointless, since if the file name has spaces and isn't "heroes4.exe", the command prompt will just shut down with "can't open file".
Usually it's not a bad idea not to have spaces in filenames, but this is very simple to fix.
NimoStar said:
- Worked on default heroes4.exe, but when trying to use with my mod's exe, it says "the provided file is not valid for patching"
But why not?
Because heroes4 modders developed a bad habit of adding patches in the exe itself. Additionally, there are several base executables as you cite - not good for a unified modding platform. I wrote in some checks to ensure that patching the exe doesn't suddenly break something and that the specified executable matched the one I used originally. So if you get an invalid exe warning, that's why.
At some point I will complete the current WIP I made 2 months ago and then there will absolutely be no excuse to be hex editing heroes4.
NimoStar said:
In the default list, creature abilities are displaced by one.:
Quote: "Waspwort": [
"Undead",
"Tougness"
],
"Water Elemental": [
"Ranged",
"Weakness"
],
"White Tiger": [
"Elementals",
"Spellcaster",
"Cold Resistance",
"Cold Attack"
],
"Wolves": [
"First Strike"
],
"Zombie": [
"Strikes Twice"
]
Any H4 player can see what's wrong there, waspworts are ranged and weakness, water elementals are the elemental spellcasters, white tigers first strike and wolves strike twice. Zombies are the undead and toughness (which lacks an "h")
I asked for fixed creature abilities yet nobody ever really corrected. When everything is sorted out, I don't mind updating the release.
NimoStar said: Some abilities work and aren't listed by name. There is no way to use them with the plugin even if you can use them by hex editing. These abilities don't have an ingame icon (appear as empty icon) but work mechanically ingame.
There is a tested working hex code for "extra shooting attack" (separate and cumulative with Elf one, in fact in my mod elves triple-shoot)
"extra melee attack" is another one of these alt-abilities that work. They are listed in abilitie's hex lists but there is no way to automatically add them here."Melee giant slayer" and "ranged giant slayer" abilities. (added to heroes by artifacts, usable in creatures too like th others)
As you can imagine, not all abilities are created equally. Hence you have some of them being set to creatures in one place, and others set in specific routines of the code. The creature abilities plugin simply removed the need of hex editing the data that exists in a single function as that was the available information when I made the plugin.
NimoStar said: Spelling is inconsistent. Sometimes it says "Resistence" and anothers "Resistance". While this is more minor, it bears mention since it can affect workflow when writing abilities into the file.
You can thank other H4 posters for all typos, all the data/names/... were simply copy-pasted.
NimoStar said: Anyone is welcome to help log these into the github or ask RoseKavalier to pass commits.
Git has a pull request functionality that lets you indirectly pass commits, anyone is welcome to use it - I made this base for the community but no one went anywhere with it.
You can even fork (clone) the repository and develop it as your own.
That's the current state of things... essentially I created a base and left it in the community's hands to develop further. I can provide technical guidance but I don't have enough time on my hands to dedicate myself to this specifically.
____________
My Let's Plays: Metataxer's Revenge - The Empire of The World 2
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 01, 2021 04:32 PM |
|
Edited by NimoStar at 17:02, 01 Apr 2021.
|
Quote: I asked for fixed creature abilities yet nobody ever really corrected. When everything is sorted out, I don't mind updating the release.
That's factually false since at the time you respond, I have already corrected it... so?
Quote:
Usually it's not a bad idea not to have spaces in filenames, but this is very simple to fix.
Many games and other applications come with spaces in .exe by default...
Quote: As you can imagine, not all abilities are created equally. Hence you have some of them being set to creatures in one place, and others set in specific routines of the code. The creature abilities plugin simply removed the need of hex editing the data that exists in a single function as that was the available information when I made the plugin.
The abilities I mentioned are available by hex editing. They require no special routine or anything else. They are a two-byte code just as the rest of them. I can provide the two-byte code of these abilities if you are interested in adding them.
Since H4 has a relatively limited ability assortment every new ability counts.
Quote: Because heroes4 modders developed a bad habit of adding patches in the exe itself. Additionally, there are several base executables as you cite - not good for a unified modding platform. I wrote in some checks to ensure that patching the exe doesn't suddenly break something and that the specified executable matched the one I used originally. So if you get an invalid exe warning, that's why.
At some point I will complete the current WIP I made 2 months ago and then there will absolutely be no excuse to be hex editing heroes4.
Hex editing is already done. It cannot be reversed. Mods depend on such features. It's not about only more creatures abilities. It is also aboput:
- Extended spells for creatures (h4 spells on creatures aren't ruled by abilities, see my edit on first post)
- More game objects (with functionality, equilibris 3.55 adds many unique treasure lairs, which can't be added without exe edit/hex dll hack)
- More artifacts (3 more in equi 3.51 and 3 additional to those in equi 3.55)
- Expanded game logics (menu for choosing summoning and necromancy creatures)
Thus unless your project adresses all those, there absolutely is excuse to continue using exe hacks.
Which of these would the project adress, if any?
Could not the "check" be disabled, for example with an alternate patcher?
There is a very good probability that the patch will work even in the changed exes.
And your patch also alters the .exe directly, so your hate for this method is not coherent?
Quote: Git has a pull request functionality that lets you indirectly pass commits, anyone is welcome to use it - I made this base for the community but no one went anywhere with it.
You can even fork (clone) the repository and develop it as your own.
I already said this, but at the time I didn't know if you would be active.
And I am going somewhere with it now, am I not? I was not very active in modding at the time you created it. My last release is from september 2018, but now I am active again.
Thus from the release of the file until now, I never had the chance to revise it, as I am doing in the present.
I look forward to a productive exchange that hopefully isn't very taxing for you, since the fixes I proposed including the new abilities whose two-byte hex codes I can send you are fairly innocous.
_________________
PS: Another thing. The plugin is spamming my system with 1 kb text files that only say "acquiring patcher", a new one made every time it is launched.
I would believe that if that is the only content of a log, the file can be auto-deleted for the end user, or otherwise not created.
____________
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 01, 2021 05:42 PM |
|
Edited by NimoStar at 14:04, 05 Apr 2021.
|
PS2:
I "patched" my hex edited Exe manually (with hex edit, ho ho ho) so it accepts the plugin, by doing a revision of differences and applying them. There was no superposition. As far as I can tell, this is working (not enough test to say if bug free, my mod and 3.55 aren't 100% stable by themselves either).
So, I was right and the "check" is just being an unnecesary hurdle in regard to all three versions of gameplay edited exes (equi 3.51, equi 3.55 and Greatest Mod).
Of course there could still be a warning "failed validation", etc. etc. but without stopping the process. The new .exe is already just a copy anyways, so it won't break your game in any case.
It would also be rather possible to make different exe files access differently named "plugin" folders, so as to allow the mods to keep their modular nature, but I do understand that unlike the rest of things that I mentioned which are bugfixes and completion, this is an "extra thing" to ask for the program (feature request).
PS3: On second testing, while in the adventure map and even combat it works, there is something about post-combat processing that seems to crash when all enemies are defeated. so , I will stick to evil "hex editing" for my main mod since there are 15 new creatures with spells, at least for now and unless editing spells for creatures is added.
PS4:
We can put more than 4 abilities in a creature.
Although such abilities work fine, it will crash the game when in the recruit screen, since it has a different ability interface where icons can't overflow:
The screen that crashes. Note the abilities are just 2x2, while in other screns they can be potentially 4x2 and 5x2.
Is that code could be foxed we could have actual usable five+ creature abilities.
As it stands the only one that could be used this way in vanilla H4 are Mermaids and Sea Monsters since they don't have an object to recruit them in either map or town.
____________________________
Also, I found the extra abilities are already added... they just aren't listed with the standard download, only with the source code. This list should be adjuct to the release package and not only source, since it's what permits users to make their custom stuff.
____________
|
|
karmakeld
Responsible
Supreme Hero
|
posted April 09, 2021 09:12 PM |
|
|
NimoStar said: PS2:
The screen that crashes. Note the abilities are just 2x2, while in other screns they can be potentially 4x2 and 5x2.
Is that code could be foxed we could have actual usable five+ creature abilities.
As it stands the only one that could be used this way in vanilla H4 are Mermaids and Sea Monsters since they don't have an object to recruit them in either map or town.
So theoretically, you suggest that simply expending the interface to contain an additional 2 boxes should do the trick of avoiding crashes?
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted April 09, 2021 10:29 PM |
|
|
karmakeld said: So theoretically, you suggest that simply expending the interface to contain an additional 2 boxes should do the trick of avoiding crashes?
Is that the cause of the crash though?
RoseKavalier said:
It looks funny, but it seems to work
Seems to be fine there so maybe something else is causing the crash?
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 10, 2021 12:32 AM |
|
|
iliveinabox05 said:
karmakeld said: So theoretically, you suggest that simply expending the interface to contain an additional 2 boxes should do the trick of avoiding crashes?
Seems to be fine there so maybe something else is causing the crash?
Different thing though.
Those are two rows of icons, each row is 4 icons wide. The second is "invisible" but it's there.
When there are two rows of two icons already occupied, the game can't go to "third row" because it isn't programmable, thus the crash.
That's my explanation but I have been right before
A way of knowing would be putting in nine abilities.
If I am correct, that should cause the 4x2 interface to crash as well.
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted April 10, 2021 12:39 AM |
|
|
Well yes, of course they are different interfaces, but it looks 4x1 to me with the additional abilities wrapping around? Maybe I'm tired or missing something.
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 10, 2021 12:44 AM |
|
Edited by NimoStar at 01:17, 10 Apr 2021.
|
That you can see 4 doesn't mean that more rows aren't scripted. In other words, the coding is different.
However I did test 9 abilities and they wrap to a third
So perhaps the "wrapping" isn't written for the recruit dialog, and instead it gives "coordinates" for the four squares (and no more).
I know it is GUI related because this only happens when YOU want to recruit the creatures. The AI can recruit the creatures just fine, since their dialog never appears on any screen. And as mentioned the creatures work just as expected in and out of combat, just so long you don't try to open any recruit dialog for them.
Thus, it is no at functional crash, it is a graphic rendering crash.
PS: Also, see this here:
Do you notice how there is more space between the first and second icon than between the second and the third, even on the first row?
It gives credence this spacing is done manually in the code. In the full image, you can see why this was probably a "fix" to cover the entire bar, which is a bit more wide than four icons on default spacing. Not sure how this would help, but it's good to have in mind.
____________
|
|
Karmakeld
Responsible
Supreme Hero
|
posted April 10, 2021 10:29 AM |
|
|
I got no clue how the interface is connected with the code, but bear in mind OldGreyWolf proved you could change the interface using only graphical changes like in Gimp or Photoshop, no change of code - that was for the world map interface.
Equilibris added an additional icon for the magic resistance. So it might give a clue of you look at what they did, not saying that the recruitment interface couldn't be coded differently.
https://images.app.goo.gl/CZDutawhps4NHqzi8
https://images.app.goo.gl/ukBDjX8RqDV5fRUS7
____________
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 11, 2021 11:09 PM |
|
Edited by NimoStar at 23:10, 11 Apr 2021.
|
That's just changing one image for another.
Completely different than changing interface code that generates game crashes.
Analogy:
On thing is like painting the wall of your house differently. Another thing is building a new house (or at least, a new wall).
You can paint your wall color any way you want, but preventing the house from falling requires structure.
____________
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 22, 2021 03:42 AM |
|
|
MORE EVIDENCE OF GRAPHIC USER INTERFACE LIMITATIONS
There is another moment that crashes, showing this had nothing to do with recruitment itself, only with display.
When looking at Centaur (or any creature) in the adventure map, there is place for five icons - not four
unlike in the recruit screen, five abilities work here...
But add sixth ability: Instant crash when trying to see.
My next test: Do iconless abilities affect this?
____________
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 29, 2021 03:04 AM |
|
|
My post count will decrease. Boo hoo. Post responses, people! Maybe RoseKavalier will see this and continue working as he promised (?)
Quote: My next test: Do iconless abilities affect this?
They do affect it, unfortunately. Which confirms it is something in the code hooks for ability pictures, and not the pictures displaying or not themselves. In other words, there is a lack of code for displaying another ability (from 4 in recruit, 5 in map) in those menues.
These sole 3 creatures can have up to exactly 5 (and no more) abilities in the base game in thius manner, since you never get to have a recruit dialog because they are neutral creatures which lack a dwelling:
- Mermaids
- Sea Monsters
- Megadragons
Of course, if you add their neutral dwellings, they will be limited to 4 too.
All other creatures can have a maximum of 4 to prevent crashes.
However, please note and remember that Magic Resistance % (Gold Golem, Dwarves, Earth Elementals, Megadragons) as well as spellbook creature spells are "innate" abilities, thus you don't actually need to declare them in abilities list as they are coded elsewhere.
____________
|
|
Baronus
Legendary Hero
|
posted April 29, 2021 07:05 AM |
|
|
4 is enough. There is no a lot usefull abilities and much of them you can replaced by simply stats:
Sceleton ability by range defece x2
Gargoyle ability defence + 25%
Medusa ability 999 shots
Mino ability defence +40%
Centaur ability range attack /2
Orc abilty range attack/2
etc.
Some are iritating and to remove. Berserker and Dino.
So we have small number of it in fact.
If we give 5,6,7 all unit will be the same.
5,6,7 needs game code revriting.
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 29, 2021 07:34 AM |
|
|
While I agree we need more abilities, with all due respect, in the mentions you make you have no idea what you are talking about.
For example, we have no way of "increase ranged defense" separate to melee defense if not for the Skeletal ability.
See here:
There is a single "attack" and "defense" stat for creatures, and you can't change them separately in the table.
Minotaur ability blocking 40% of attacks is different than +40% defense as well, and by a lot. Blocking can completely negate an attack that would absolutely obliterate the stack even with 40% damage reduction.
And so forth...
In any case, the more than four abilities would be useful for things that "do nothing". For example, undead mechanical or elemental creatures that fly already have two of the slots taken just by this. If they are also ranged they have three slots taken.
This already was a problem for Catapult which is mechanical and ranged and greek fire, leaving place only for one extra ability , which led the developers to join No Range Penalty and No Obstacle Penalty into "siege capable" that combines both.
____________
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 29, 2021 07:43 AM |
|
Edited by NimoStar at 11:17, 29 Apr 2021.
|
While I agree we need more abilities, with all due respect, in the mentions you make you have no idea what you are talking about.
For example, we have no way of "increase ranged defense" separate to melee defense if not for the Skeletal ability.
See here:
There is a single "attack" and "defense" stat for creatures, and you can't change them separately in the table.
Minotaur ability blocking 40% of attacks is different than +40% defense as well, and by a lot. Blocking can completely negate an attack that would absolutely obliterate the stack even with 40% damage reduction.
And so forth...
In any case, the more than four abilities would be useful for things that "do nothing". For example, undead mechanical or elemental creatures that fly already have two of the slots taken just by this. If they are also ranged they have three slots taken.
This already was a problem for Catapult which is mechanical and ranged and greek fire, leaving place only for one extra ability , which led the developers to join No Range Penalty and No Obstacle Penalty into "siege capable" that combines both.
Anyways, abilities that could be added include basically one for every curse, "do this on attack" (like Weakness, Misfortune, or even Lightning and Poison are, etc.), and one for every positive spell, "start with this spell applied" (like Stoneskin or Wards).
Good spells for attack-cast:
- Cast Mana Leech
- Cast Cowardice
- Cast Bind Flyer
- Cast Forgetfulness
- Cast Berserk
Spells for attack-cast already used by heroes/artifacts (but not creatures):
- Cast Sorrow
- Cast Misfortune
- Cast Slow (used on Crossbow of Sloth)
Good spells that creatures could come with:
- Prayer (Crusaders)
- Nature Ward
- Order Ward
(other three wards exist as abilities, only these don't)
- Blur
- Strenght
- Luck
- Morale
- Defender
____________
|
|
|
|