Jump to content


Photo

Creating custom modifiers.


4 replies to this topic

#1 Mavichist

Mavichist
  • New Members
  • 2 posts

Posted 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.


Edited by Mavichist, 26 January 2022 - 01:31 PM.


#2 Gambit

Gambit

    title available

  • Members
  • 6,718 posts
  • Location:Athens, Greece

Posted 26 January 2022 - 01:22 PM

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.


-In search of Papasmurf...

#3 Mavichist

Mavichist
  • New Members
  • 2 posts

Posted 26 January 2022 - 01:45 PM

Hey, thanks for getting back. Nice to talk to someone in the space, there don't seem to be very many haha.

 

You've confirmed my suspicions, thanks for a definitive answer. It's a bit of a shame that it's not exposed and alterable, but I'll have to make do with what we're given.

 

Using tp_mod_usage_addition to perform subtraction did occur to me, I say as much in the sentence you quoted, I was just using tp_mod_usage_subtraction as a fictitious example to highlight the kind of thing I'd like to be able to do.

 

Either way, I can probably do something hacky like use the heavy weapons team entrenchment ability as a scaffold for transforming a land unit into a flying unit and back again. I gather I'll be abusing things like that to smash together the functionality I want haha



#4 Gambit

Gambit

    title available

  • Members
  • 6,718 posts
  • Location:Athens, Greece

Posted 27 January 2022 - 05:48 PM

Very well brother.

 

Let me repeat here that although some parts are hard-coded, we have achieved to code many alternatives to get what we need already.

Some methods are COMPLEX, others require much effort to accomplish, but most were achievable.

 

If you have any "unusual" coding request in the future, post it here just in case we have already found a solution.

 

By the way, you can also visit us in our Unification Discord Channel.


Edited by Gambit, 27 January 2022 - 05:48 PM.

-In search of Papasmurf...

#5 fuggles

fuggles

    title available

  • Members
  • 4,849 posts

Posted 30 January 2022 - 09:26 PM

Either way, I can probably do something hacky like use the heavy weapons team entrenchment ability as a scaffold for transforming a land unit into a flying unit and back again. I gather I'll be abusing things like that to smash together the functionality I want haha

 

Not sure you can, the entrenched unit has to be static. Possession might work, or you use could SCAR and swap it out. Neither will be perfect, but what is, in dow?





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users