Hello brother
Always a pleasure to speak with a fellow modder :thumbsupcool:
I want to define a custom modifier, which will be applied to a squad by an ability. There are lots of existing modifier tables, such as enable_movement and speed_maximum_modifier, and they seem to be differentiated by nothing but their name. I'm interested in knowing where the functionality, the actual code describing what a modifier does, is located.
Unfortunately, the Modifiers are HARD-CODED.
Meaning that you cannot create new ones. You will have to work with the existing ones...
The same goes for Requirements. And some other stuff.
This is the reason you found nothing but their name, to differentiate them. Because there is no actual code open to modders.
In order to create something new, like tp_mod_usage_subtraction, I would need to define how it alters a property by subtracting a value somewhere in code. Obviously in this case you could just subtract by adding a negative number, but you see what I'm trying to do.
There is no way to do that. You will need to intrinsically modify the game!! (DLL Libraries)
Which is something we better avoid, unless we want to create a new game :p
You must resoer to workarounds.
For example, instead of tp_mod_usage_subtraction, use the existing tp_mod_usage_addition, and simply put NEGATIVE numbers!
If, as an example, I wanted to change the moving_ext property air_unit value False to True, I can't, because no modifier exists to do so. The moving_ext table does have a couple of existing modifiers, such as speed_maximum_modifier, but its other properties cannot be altered this way.
Values/entires for which we do not have a modifier... We cannot alter. Sadly and regrettably. :glare:
Even SCaR cannot change this.
But please, do no feel that the game is limiting.
FAR from it.
With clever coding and usage of tricks and SCaR, one can achieve wonders.
I consider myself a competent Coder, and I have contributed my fair share of never-before-coded bits in many "secrtors" namely (AE, AI and SCaR).
And let me tell you, we have lifted many game limitations with the usage of nasty tricks and coding magic.
... But hard-coded parts are just that.