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

Survival Promotion (XML+Python) 2016-10-05

Survival Promotion (XML+Python)

  1. tsentom1
    I've been busy and haven't released anything in a while so these are just a few things I threw together either based on old requests or code that's floating around inside Thomas' War.

    Anyway, these promotions are basically UU abilities from my next version of Thomas' War. I figured I'd put them up as promotions here so anyone who wants can use the code (mainly because throwing together a promotion modcomp takes all of 2 minutes if the code is already written).



    It works like a defensive withdrawal chance, so if you lose a battle (and a unit is killed) there's a 10% chance that unit will 'survive'. They survive with only 10% health you can edit that in the python.

    You can edit the percentage chance by changing this line:

    self.iResistance = self.getRandomNumber( 9 )

    Note, 9 is a 1 in 10 chance as the game counts 0 when finding a random number.

    This really isn't meant to be used stand-alone but for modders who want to include new promotions outside the traditional XML bonuses.

    All the python is labeled and searching for 'Survival' should find the changes. Note, the code is in two sections with additional code at the very end of the file.

    I recommend downloading and using Winmerge to combine python.

    Thread


    Edit: There was an error in the code (mainly because I copied it directly from Thomas' War) where it had a pre-req promotion that doesn't exist in the standard game but does in my mod. It now needs the March promotion.

    Images

    1. fixedsurvival_RwQ.jpg