Jump to content


Mavichist

Member Since 26 Jan 2022
Offline Last Active Jan 26 2022 02:39 PM

Topics I've Started

Creating custom modifiers.

26 January 2022 - 07:45 AM

Hi all,
 
I've been self-learning DoW SS modding for a while now, on and off. I've made some pretty neat things but I've hit a bit of a wall.
 
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.

 

Unlike units, abilities and other RGD files (which are all generic structures), modifiers (and other related RGD structures, such as type_modifierusagepattern) are really just references to code that define what they do. For example there is a functional difference between what tp_mod_usage_addition and tp_mod_usage_multiplication are doing behind the scenes to alter a value.

 

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 getting at.

 

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.

 

I am assuming that there is lua code somewhere in the game's assets responsible for defining what these modifiers actually do. I am also assuming that the modifier and the code are linked somehow, perhaps by another table somewhere. I don't know where either of these things are located or how to alter them.

 

Any help on this subject would be greatly appreciated. What I'm trying to do may not be possible; the modifiers may be defined somewhere in DoW's source code, which would require decompilation of the relevant binary. If that's the case then I'll just make do with what we're given, but I'd like to have a definitive answer either way.