1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Unit Modding Question

Discussion in 'Civ5 - Creation & Customization' started by Qaravoe, Feb 20, 2021.

  1. Qaravoe

    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.
     
  2. TopHatPaladin

    TopHatPaladin Warlord

    Joined:
    Nov 5, 2017
    Messages:
    151
    Gender:
    Male
    Location:
    New England
    This wouldn't be feasible in Lua, unfortunately. (As for the DLL, I don't have any experience working with it, so I can't give an informed answer to that half of the question.)
     
    Qaravoe likes this.
  3. Qaravoe

    Qaravoe Chieftain

    Joined:
    Feb 20, 2021
    Messages:
    3
    Ah, that's too bad. Thanks for the answer!
     
  4. LeeS

    LeeS Imperator Supporter

    Joined:
    Jul 23, 2013
    Messages:
    7,139
    Location:
    Illinois, USA
    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.
     
    Qaravoe likes this.
  5. Troller0001

    Troller0001 Watching from a safe distance

    Joined:
    Mar 9, 2016
    Messages:
    747
    Gender:
    Male
    Location:
    The Netherlands
    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
     
    Qaravoe likes this.
  6. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,528
    Location:
    Near Portsmouth, UK
    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!
     
    Qaravoe likes this.
  7. Qaravoe

    Qaravoe Chieftain

    Joined:
    Feb 20, 2021
    Messages:
    3
    Thanks for all of your responses!
    I'm relieved to hear that it wouldn't be too complex, as far as DLL modding goes.
    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.
    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!
     

Share This Page