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

How to make barbarians attack cities?

Discussion in 'Community Patch Project' started by APLion, Nov 26, 2020.

  1. APLion

    APLion Chieftain

    Joined:
    Nov 26, 2020
    Messages:
    3
    Gender:
    Male
    So I am trying to make a game with barbarians evolved mod, and the only problem i have is that barbarians in CBP just refuse to attack the cities. If barbarian_theft option is on, they steal, but do not actually do any damage. If it's off, they just stay around the city... Menacingly. Sometimes they attack cities from the water, but that's all. Also, the only ranged barb unit that was actually doing damage to the cities was a hand-axe, but not archers or crossbowmans.

    I couldn't find any options in mod files to change that behaviour, so maybe someone can help me? Civ5Screen0018.png Civ5Screen0019.png
     
    LifeOfBrian and Tekamthi like this.
  2. Recursive

    Recursive Deity

    Joined:
    Dec 19, 2017
    Messages:
    2,016
    Gender:
    Male
    It's controlled by CvTacticalAI.cpp in the DLL. Can't be edited from the database. You'd need to ask ilteroi to implement this, or do so yourself...menacingly. :)
     
    vyyt, JamesNinelives and LifeOfBrian like this.
  3. APLion

    APLion Chieftain

    Joined:
    Nov 26, 2020
    Messages:
    3
    Gender:
    Male
    Thanks, found it. At least now I know where the problem is. Will try to do it myself, should be interesting
     
    vyyt and JamesNinelives like this.
  4. LifeOfBrian

    LifeOfBrian Prince

    Joined:
    Aug 21, 2019
    Messages:
    526
    Whitewalkers are coming, woo-hoo!
     
    vyyt, smorgasborgas and 2506 like this.
  5. APLion

    APLion Chieftain

    Joined:
    Nov 26, 2020
    Messages:
    3
    Gender:
    Male
    So that was quite the ride, but now I know how to build my own dll file. Basically I changed two things:

    1) added "ExecuteCaptureCityMoves();" to "PlotBarbarianAttacks()" function. Now barbarians actually can think about attacking the cities.

    2) changed line 750 to "newTarget.SetAuxIntData(m_pPlayer->isBarbarian() ? 100 : 100);". It had the comment "//barbarians don't care about cities much compared to normal players". Jokes on you, they really do.

    Now everything works quite nicely and white walkers are wrecking havoc on everyone.

    If anyone wants to use it, just replace the dll file in Community Patch mod folder. This works with the last stable version (at least for the first 50 turns).
     

    Attached Files:

  6. azum4roll

    azum4roll Emperor

    Joined:
    Jul 17, 2018
    Messages:
    1,218
    Gender:
    Male
    Why Lancers though? They can OHKO a city that early.
     
  7. ilteroi

    ilteroi Prince

    Joined:
    Mar 11, 2006
    Messages:
    365
    maybe this could become mainline ... they would attack if they cannot steal, ie if the city is garrisoned.

    how about that?
     
  8. LifeOfBrian

    LifeOfBrian Prince

    Joined:
    Aug 21, 2019
    Messages:
    526
    Ilteroi, I'd support that!
     
    vyyt likes this.
  9. Tekamthi

    Tekamthi Prince

    Joined:
    Aug 12, 2016
    Messages:
    473
    yeah barbs should do more in base VP; hope this is included, as I tend to shy away from mods that require files be manually overwritten
     
  10. Recursive

    Recursive Deity

    Joined:
    Dec 19, 2017
    Messages:
    2,016
    Gender:
    Male
    Or if MOD_BALANCE_CORE_BARBARIAN_THEFT is not defined.
     
    vyyt likes this.
  11. Recursive

    Recursive Deity

    Joined:
    Dec 19, 2017
    Messages:
    2,016
    Gender:
    Male
    vyyt and JamesNinelives like this.

Share This Page