Unit Modding Question

Qaravoe

Chieftain
Joined
Feb 20, 2021
Messages
3
Hello! I've been playing this game for a long time, and somewhat recently I decided to try modding it. I've been learning, slowly.

Anyways, I have a question regarding how feasible one of my ideas would be to implement:
A unique ranged unit with a range of two (a crossbowman, for those curious) with an attack bonus only against units directly adjacent to it.

Spoiler Visualization: :

(Don't hesitate to ask for a screenshot if you're still confused!)

....o o o
...o a a o
..o a x a o
...o a a o
....o o o

Unit (x) has a 25% ranged attack bonus against any adjacent enemy (a) but does only standard damage against any outlying enemy (o)

The question that I pose: is this feasible?
If so, how feasible is it? Can it be done in Lua, or would it require modding the DLL?
I have a certain amount of programming experience, and I was planning on modding the DLL anyways for a different purpose (eventually) so it wouldn't be too inconvenient, etc.

I would appreciate even a simple yes or no answer, quite frankly.
 
Likely can be done with DLL. Whether or not it would be a quick re-write of the DLL or not I cannot say. But whether it is fairly straightforward or complicated to ferret out all the instances within the DLL code that would need re-writing, the mod would by its very definition not be compatible with any other mod that used a customized DLL.

DLL re-writes, like lua User Interface scripts, art dds files, etc., adhere to the Highlander Rule -- in the end there can be only one, and the game uses the last one to be shoved into its systems after all mods have completed the loading process.
 
It's possible to use the same effect that the Maori Warrior does with its Haka War Dance promotion (-10% combat strength for adjacent enemies). The combat penalty (and even the range) can be changed if that's desired.
It's not entirely the like you wanted as it means that other allied units also benefit from this combat penalty, but it does not require modding the DLL and is a somewhat similar idea
 
Certainly doable with a DLL mod and not that complex FOR PLAYER CONTROLLED UNITS. Now, how to re-write the AI's combat logic to allow for this unit to "move out of hills/forest and adjacent to an enemy unit as the extra +25% attack will almost certainly kill the enemy unit without exposing the UU xbow men to counter-attacks" is a different matter entirely!
 
Thanks for all of your responses!
I'm relieved to hear that it wouldn't be too complex, as far as DLL modding goes.
It's possible to use the same effect that the Maori Warrior does with its Haka War Dance promotion (-10% combat strength for adjacent enemies). The combat penalty (and even the range) can be changed if that's desired.
It's not entirely the like you wanted as it means that other allied units also benefit from this combat penalty, but it does not require modding the DLL and is a somewhat similar idea
I considered this as an alternative and while it wasn't quite what I had envisioned in this instance, a ranged unit with that ability might be interesting.
Certainly doable with a DLL mod and not that complex FOR PLAYER CONTROLLED UNITS. Now, how to re-write the AI's combat logic to allow for this unit to "move out of hills/forest and adjacent to an enemy unit as the extra +25% attack will almost certainly kill the enemy unit without exposing the UU xbow men to counter-attacks" is a different matter entirely!
I also considered reducing its range to just one and buffing the ranged attack. In that case, I assume, the AI (not to mention the Player) would have to use them in a manner akin to gatling guns. Not too much room for error as far as the AI is concerned, but crossbowmen are just too squishy to fill that role!
 
Top Bottom