- Joined
- Sep 11, 2023
- Messages
- 211
inside AbilityData.slk can see C;X2;K"code", where in the game files does the .slk pulls this from ? does this code definition reside in the executable, in the .dll ? since it has got to be somewhere.
That is what I believe. For my Warsmash project where I try to emulate the game without the executables/dlls, I created a hard-coded list.does this code definition reside in the executable, in the .dll ?
code
of abilities without editing the raw ability SLK, although it is time consuming to set up. Last time I tried it this actually worked -- you can modify the AbilityMetaData.slk
used by the World Editor to decide what properties the Abilities have. If you import the modified file into your map as well as your editor, then it will not only add a code
property to abilities inside your Ability Editor GUI, but it will actually apply so that ingame the ability's C++ class will be chosen based on your editor setting instead of only the SLK column.Under while folder would the world editor AbilityMetaData.slk file be?That is what I believe. For my Warsmash project where I try to emulate the game without the executables/dlls, I created a hard-coded list.
It is also possible to edit thecode
of abilities without editing the raw ability SLK, although it is time consuming to set up. Last time I tried it this actually worked -- you can modify theAbilityMetaData.slk
used by the World Editor to decide what properties the Abilities have. If you import the modified file into your map as well as your editor, then it will not only add acode
property to abilities inside your Ability Editor GUI, but it will actually apply so that ingame the ability's C++ class will be chosen based on your editor setting instead of only the SLK column.
Unfortunately not. This is not how theindeed i believe it would be possible to do things like combine all aura data to obtain a super-aura ability, or combine parts of different abilities through editing AbilityMetaData.slk
code
column works.CAbilityQueue::OnTick
in the code is a derived method that pushes forward the progress of the front-most item in the queue on each tick of the lockstep game simulation: namely, it does not iterate the list of nearby units and add buffs to them. Again, maybe I am stating the obvious to you but I think at some point you may come to understand the derived sunclasses of CAbility and why this is relevant.A000
, what does this mean?A000
is something I made in Ability Editor by copy-and-pasting Devotion Aura to make my own custom aura, the way the copy definition works is to inherit all properties of the original ability that I copied from, regardless of whether I can see them in Ability Editor. So, although it is possible to edit Units\AbilityMetaData.slk
in Microsoft Excel and for example copy the Data - Effect Ability
setting from the item orb abilities, then change this to modify code
column instead of a data property, which would create a stat showing Devotion Aura
for my custom A000
ability in this theoretical modified Ability Editor with the theoretical slk, what I'm saying is that my custom A000
ability will have the property code='AHad'
regardless of whether I can actually see or change this property. And this hidden property is present even in the vanilla Ability Editor.A000
the code class in the C++ is decided based on code='AHad'
and this happens to correspond to CAbilityDevotion
which is a C++ derived class from CAbility whose virtual override function CAbilityDevotion::OnTick
is set to enumerate nearby units and then add an ability to those units which happens to be named CBuffDevotion
although despite the name this is actually just another CAbility
who adds armor when added to a unit and removes armor when removed from the unit.CAbilityDevotion::OnTick
shall periodically enumerate units within a radius of the unit who has this CAbility and then add a CAbility to units found of a class CBuffDevotion
that has some function like CBuffDevotion::OnAdd
that increases armor and CBuffDevotion::OnRemove
that decreases armor, it will not be possible for you to make an instance of the C++ class CAbilityDevotion
be an aura that provides armor and also movement speed, or some other property.CBuffDevotion::OnAdd
to make the unit invulnerable and CBuffDevotion::OnRemove
to make the unit vulnerable (so, this code is probably the same as CBuffBigBadVoodoo
or CAbilityInvulnerable
) and as a result then I have Invulnerable Aura without any further work. But it is the having of the source code part of my video that makes this modification possible. Essentially, I can do it in the toy example in my brain, but we cannot include this feature in a map because there is no API for it. Not even by changing SLKs, because the SLKs are just a data control for the properties loaded by the C++ code.A000
to be code='AOae'
then the game engine will create a CAbilityEndurance
as the C++ class for this ability, and that will interpret the data fields of the ability as movement speed or attack speed. I am in bed away from my computer so I am not in a place to check whether DataA or DataB is the movement or attack data for CAbilityEndurance
but I would certainly imagine the movement data is one or the other. So, if you modify Units\AbilityMetaData.slk
regardless of whether you (a) Add the Data - Movement Speed Bonus (%)
field to AHad
devotion aura based skills, or (b) Add the Data - Code Ability ('code')
field to AHad
devotion aura based skills... Both times either way you go about it, you cannot make an aura that provides both armor and movement speed. And this is for the same reason you cannot make Invulnerable Aura. In fact, because the DataA property is used for a different purpose in CAbilityDevotion
(code='AHad'
) versus in CAbilityEndurance
(code='AOae'
), they will most certainly conflict. If you add Data - Movement Speed Bonus (%)
or whatever it is to your AHad
based skill, then this Data parameter (or maybe its friend, the attack speed parameter, depending on which uses DataA) will simply again modify the amount of armor gained by units in the area, per the code inside CAbilityDevotion.cpp
that you're not allowed to read or modify. Likewise, if you manage to convince your ability to let you change the hidden property and specify code='AOae'
then it will use CAbilityEndurance.cpp
and the ability will no longer provide armor no matter what you do. At that point Data - Armor Bonus
or whatever will simply modify the attack speed or move speed or whatever the conflicting endurance parameter happens to be.code
setting via the Engineering Upgrade ability. Essentially, prior to Reforged 1.32+ when the Engineering Upgrade skill went haywire due to the Reforged programmers breaking the fundamental backbone of how SLKs and typing works and splitting it into insane pieces that cause Engineering Upgrade to go haywire even in melee maps, if you use Engineering Upgrade on an old patch like 1.28 that you mentioned then you can use it to change all the properties of an ability, including the code
hidden property, but this property swap does not remove and re-add the CAbility and as a result the code
parameter is mostly ignored because the C++ class is already constructed. And it makes sense for what Engineering Upgrade does that it would have to be this way; for example, if we swap Cluster Rockets (Upgrade Level 1)
with hero skill Level 3 to now be Cluster Rockets (Upgrade Level 2)
with hero skill level 3, the hero skill level is one of the state values in the CAbilityClusterRockets state container on that unit and needs to be kept. I don't know for sure because cooldowns are weird but I wouldnt be surprised if active cooldowns on the skill were also stored in that CAbility, and we know that Engineering Upgrade is not intended to reset the hero level of affected skills, nor reset their cooldown. So, it does not destroy/remove nor create/add the CAbilityClusterRockets
from the hero. Instead, it simply switches the property map being used by the ability from within the list of property maps (the Ability "kinds" list) that Ability Editor controls and adds to.code
property and CAbilityHero
(an ability added automatically to units whose 4 letter rawcode begins with a capital letter): As it happens, the CAbilityHero
class in C++ does destroy/remove and create/add the CAbility on the unit when learning a skill or using Tome of Retraining, and this means that if the unit currently has Engineering Upgrade to switch out the property maps from the perspective of that unit, then CAbilityHero will honor the hidden code
field for the switched out ability.A000:AHad
(a copy of devotion aura) with A001:AOae
(a copy of endurance aura) then you will observe the following behaviors:A000
(and the custom engineering upgrade) learns the skill A000
then the CAbilityHero
will first look and see the hidden property code=AHad
in the settings for A000
so it will create the C++ class CAbilityDevotion
as the skill on our hero. If he then learns the custom Engineering Upgrade skill, at that time the property map will switch to A001
for the hero's instance of CAbilityDevotion
but the CAbility
is not destroyed or created. So now our hero will have a skill that looks like Endurance Aura A001
for all its property values (icon, description, etc) but it will add some amount of armor to nearby units based on the conflicted stats of endurance aura. As I said before I am writing this from a phone in bed and do not have a means to easily check, but if Endurance Aura maybe is using DataA as the movement speed, and if our example hero has Level 1 of the aura, maybe if Endurance Aura adds 0.10 (interpreted as 10%) movement then maybe now our CAbilityDevotion
still on the hero will add 0.10 armor or whatever. It will be reading the DataA field and applying that to armor of nearby units according to the code of CAbilityDevotion
because that's what it is, but it will decide how much armor to add based on the DataA stat from within A001
which the Ability Editor will present to you as though it was going to be an Endurance Aura based skill.AbilityMetaData.slk
and expose the hidden code
field and set it to code=AHad
so that A001
is a copy of Endurance Aura but who uses C++ class CAbilityDevotion
ingame and adds armor.CAbilityHero
when combined with Engineering Upgrade in this case is that if you reset the same test map with the test hero described above, but if you specifically learn the Engineering Upgrade skill first and then afterwards learn the aura skill, at that time when you first learn the aura skill its hidden code
property will already be swapped to code=AOae
from within A001
(this is assuming you used a vanilla editor still, not the case I interjected with about hacking the hidden code property) and as a result if you learn the hero skills in this other order then it will give the hero a new CAbilityEndurance
and not CAbilityDevotion
because the hidden code property was swapped prior to CAbilityHero
creating and adding the CAbility!! This is fascinating because when it was discovered prior to Reforged era jass upgrades, this was the only way to change what hero skills were available to a hero. Indeed, by the system I just described, we have a hero with a working Endurance Aura (it adds movement speed and attack speed!) who can pick up Tome of Retraining and learn his skills in a different order and go back to having an aura that provides armor instead (CAbilityDevotion
). When this was first discovered, it became the fundamental backbone for "Create your Hero" maps that would let the player choose which hero skills their hero had available to learn. Reforged probably added a trigger action to add and remove hero skills from a hero, but back then there was no such action.