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

Promotion Level system

Discussion in 'Civ5 - Mod Components' started by Serp, May 25, 2015.

  1. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    641
    Hi,

    I do not like, that you have to choose Shock 1+2+3 to be able to get promotions like March. Instead of that I wanted also be able to choose March, when I chose Drill1+2 + Shock 1 or simular combinations.

    With this mod, promotions like March or simular are unlocked by the level of the unit, not by the promotions you chosen.
    Exceptions are of course all numbered promotions. So you still have to choose Shock 1+2 to get Shock3.

    All in all this means:
    You can choose all promotions at the same minimum level as it was in base game. But here it is no "minimum" level :)
    This mod also adds several new promotions, just try it out ;)

    The mod is based on Bloublous Promotions - Expansion Pack (v 8). I did the following changes:
    - Added promotion Nuke Immunity (choosable with Tech Satellites at level 5)
    - changed some values.
    - Added german translation.
    - Added PromotionPrereqOr7="NULL" +8 +9 .
    - Range and indirect fire promotion at unlocker4.
    - Unlockers gives +17% EXP and +2 combat strength each. (instead of 33% and 5)
    - Made Unlockers not chosable. They are now assigned to every unit at level up in .lua file.

    Download
    http://forums.civfanatics.com/downloads.php?do=file&id=23974

    File updated at 27.th May 2015!
    -> I summarized the three unlocker promotions, so only the newest unlocker is needed (saves space in unit panel)
    Update 17th June 2015 v2
    - Added some pseudo promotions to promotions level system. This way all promotions should be choosable at the same min level as they were in normal Civ (e.g. march was only choosable at level 5 for all units in v15. But in the base game Archers/Siege Units were able to choose it with level 4. So now we have 2 march promotions, one for archer/siege at level 4 and one at level 5 for the rest)
    Update 7th March 2016 v3
    Added whowards DLL to the Depencies of the mod. And also enabled the needed event. All previous versions only did work, when you had this event from the DLL enabled by another mod or manually... sry for that.
    Reduced the XP Bonus from a total of 50% to 30%. With DLL v74 or higher, it is no longer rounded off intern (so 2.6+2.6 will be ~5 and not 4).
     
  2. Makenshi

    Makenshi Ahoy, ye salty dogs!

    Joined:
    Nov 20, 2013
    Messages:
    302
    Location:
    Brasil
    Could you please provide a more detailed list of when things unlock?
     
  3. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    641
    I will make such a list tomorrow ;)

    But you can also have a look at the .xml file and see the "PromotionPrereqOr" entries.

    At level 3 you get Unlocker2 ; level 4 -> Unlocker3 ; Level 5 -> Unlocker4.

    btw. I updated the file.


    edit:
    it takes alot of time to provide a complete list... I will see when I have time to do so =/
     
  4. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    641
    Updated to v2 ! :)

    All promotions are at the same minimum level choosable, as they were in the base game ;)

    + this mod adds some new promotion you will see ingame :)
     
  5. Lynnes

    Lynnes King

    Joined:
    Aug 23, 2015
    Messages:
    886
    This is such a great addition to the promotion system, good job! :goodjob:
     
  6. Electrohead

    Electrohead Chieftain

    Joined:
    Oct 29, 2015
    Messages:
    8
    Hi! In normal civ without the mod, the +1 Range and Logistics for the Composite Bowman and Crossbowman are unlocked at level 4. But in your mod they are unlocked at level 5, and the Archer still unlocks them at level 4.

    What should I change in the .xml to make those promotions unlocked at level 4 for Composite Bowman and Crossbowman? Is it too hard?

    Thank you!
     
  7. Lynnes

    Lynnes King

    Joined:
    Aug 23, 2015
    Messages:
    886
    Hmm.. the mod does not make a difference between Archer and Crossbowman, it only checks the CombatClass, and that's the same for both (= UNITCOMBAT_ARCHER), so it should unlock for Archers at lvl5, too.
    Have you added the mod to an old save without starting a new game, maybe?

    If you still want to make it unlock at Level 4, open the Level Promotions.xml, go to line 487 or search for "PROMOTION_LOGISTICS".

    Replace
    <Set PromotionPrereqOr1="PROM_UNLOCK_LVL_4" PromotionPrereqOr2="NULL" PromotionPrereqOr3="NULL"..

    with
    <Set PromotionPrereqOr1="PROM_UNLOCK_LVL_3" PromotionPrereqOr2="PROM_UNLOCK_LVL_4" PromotionPrereqOr3="NULL"..

    for both promotions.
     
  8. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    641
    The logistics promotion should unlock at lvl 5 (unlocker 4 in xml) for all units.
    You can not set up the promotion for archers and crossbowman seperated.
    You can only set it up for "Unitcombat_archer", which is archer, composite bowman and crossbowman (and all special civilization units that replace those units)

    The mod gives the following "classes" the logistic promotion, all at lvl 5:
    <Row>
    <PromotionType>PROMOTION_LOGISTICS</PromotionType>
    <UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
    </Row>
    <Row>
    <PromotionType>PROMOTION_LOGISTICS</PromotionType>
    <UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
    </Row>
    <Row>
    <PromotionType>PROMOTION_LOGISTICS</PromotionType>
    <UnitCombatType>UNITCOMBAT_NAVALRANGED</UnitCombatType>
    </Row>
    <Row>
    <PromotionType>PROMOTION_LOGISTICS</PromotionType>
    <UnitCombatType>UNITCOMBAT_NAVALMELEE</UnitCombatType>
    </Row>
    <Row>
    <PromotionType>PROMOTION_LOGISTICS</PromotionType>
    <UnitCombatType>UNITCOMBAT_SUBMARINE</UnitCombatType>
    </Row>

    I tested it here, and no, the archers do not get logistic and range at level 4. They get it at level 5. And I was quite sure, that this is also the case in the latest unmodedded civ 5.

    For each promotion, you can only set one unlocker combination. That's why I added new pseudo promotion march for archer and siege units.
    So to give the archer class logistics and range at level 4, you have to add new pseudo promotions.
    Take a look at "PROMOTION_MARCH_RANGEUNIT" in the xml file. This is the pseudo march promotion at unlocker 3 (lvl 4), which is for Siege and Archer units only, while the "PROMOTION_MARCH" is for all the other units at unlocker 4 (lvl 5).
    You can design a PROMOTION_LOGISTICS_RANGEUNIT and Range the same way ;)

    edit:
    the solution Lynnes posted would work, but all other units, like siege, navalranged, navalmelee and submarine would also get logistics at level 4 ;)
     
  9. Electrohead

    Electrohead Chieftain

    Joined:
    Oct 29, 2015
    Messages:
    8
    I'm sorry that i had make you test it, that was my bad LOL. I think one of the other mods i deleted earlier today was conflicting with this one somehow. I did the test again here and it's working fine indeed. Thanks

    I think im using too many mods, 41 right now :D
     
  10. nametaken

    nametaken Chieftain

    Joined:
    Jun 27, 2015
    Messages:
    54
    Hi Serp. Thanks for putting this mod together. I find its a better implementation of the same idea as the Promotions Expanded mod on Steam.

    One bug I think I may have found with it lies with the unintended nerf to the Zulu. Normally the Zulu can get Level 5 promotions with 75XP. With this mod however, the Zulu need 100XP to get Level 5 promotions like any other Civ.
     
  11. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    641
    thank you.

    What do you think would be a good solution for that problem?
    A check in the lua file, if the player is Zulu and therefore get the unlocker promotions 25 XP earlier?
     
  12. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    641
    Update 7th March 2016 v3
    Added whowards DLL to the Depencies of the mod. And also enabled the needed event. All previous versions only did work, when you had this event from the DLL enabled by another mod or manually... sry for that.
    Reduced the XP Bonus from a total of 50% to 30%.
    With DLL v74 or higher, it is no longer rounded off intern (so 2.6+2.6 will be ~5 and not 4).
     
  13. Xony

    Xony Chieftain

    Joined:
    Mar 9, 2016
    Messages:
    99
    This looks fun. Do you know if it will work with the Community Balance Patch? I read somewhere that the mod this was inspired from had conflicts.
     
  14. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    641
    Since the CBP does alot of changes, it will most likely not be compatible.

    Every mod, that changes or add promotions will not be compatible (because the new promotions won't have the Unlocker promotion as dependence)

    edit:
    But if you want, feel free to make it compatible ;) You just have to know all the new promotions from CP / CBP and add them to this mod in the sql file.

    I just changed the sql file from v 3 a little bit. I don't think you have to download it again now, but if you want to make it compatible to CBP it should be worth a new download.
    It does look like this now:
    Code:
    -- be compatible to whowards TerrainCrossing Mod (the version slighlty changed by serp)
    
    -- first: just try to add the unlocker promotion as dependence, which will only work, if the new promotions are already added
    UPDATE UnitPromotions
    SET PromotionPrereqOr1 = "PROM_UNLOCK_LVL_2", PromotionPrereqOr2 = "PROM_UNLOCK_LVL_3", PromotionPrereqOr3 = "PROM_UNLOCK_LVL_4", PromotionPrereqOr4 = NULL, PromotionPrereqOr5 = NULL, PromotionPrereqOr6 = NULL, PromotionPrereqOr7 = NULL, PromotionPrereqOr8 = NULL, PromotionPrereqOr9 = NULL
    WHERE Type = 'PROMOTION_ICEBREAKER';  
    
    UPDATE UnitPromotions
    SET PromotionPrereqOr1 = "PROM_UNLOCK_LVL_2", PromotionPrereqOr2 = "PROM_UNLOCK_LVL_3", PromotionPrereqOr3 = "PROM_UNLOCK_LVL_4", PromotionPrereqOr4 = NULL, PromotionPrereqOr5 = NULL, PromotionPrereqOr6 = NULL, PromotionPrereqOr7 = NULL, PromotionPrereqOr8 = NULL, PromotionPrereqOr9 = NULL
    WHERE Type = 'PROMOTION_CAN_CROSS_MOUNTAINS_SCOUT';  
    
    UPDATE UnitPromotions
    SET PromotionPrereqOr1 = "PROM_UNLOCK_LVL_4", PromotionPrereqOr2 = NULL, PromotionPrereqOr3 = NULL, PromotionPrereqOr4 = NULL, PromotionPrereqOr5 = NULL, PromotionPrereqOr6 = NULL, PromotionPrereqOr7 = NULL, PromotionPrereqOr8 = NULL, PromotionPrereqOr9 = NULL
    WHERE Type = 'PROMOTION_CAN_CROSS_MOUNTAINS';  
    
    -- second: create triggers. If this mod is loaded before the terraincrossing mod, the triggers will add the unlocker promotions right after the new promotions were added
    CREATE TRIGGER TerrainUnlocker1
    AFTER INSERT ON UnitPromotions  
    WHEN 'PROMOTION_ICEBREAKER'=NEW.Type
    BEGIN
      UPDATE UnitPromotions
        SET PromotionPrereqOr1 = "PROM_UNLOCK_LVL_2", PromotionPrereqOr2 = "PROM_UNLOCK_LVL_3", PromotionPrereqOr3 = "PROM_UNLOCK_LVL_4", PromotionPrereqOr4 = NULL, PromotionPrereqOr5 = NULL, PromotionPrereqOr6 = NULL, PromotionPrereqOr7 = NULL, PromotionPrereqOr8 = NULL, PromotionPrereqOr9 = NULL
        WHERE Type = 'PROMOTION_ICEBREAKER';  
    END;
    
    CREATE TRIGGER TerrainUnlocker2
    AFTER INSERT ON UnitPromotions  
    WHEN 'PROMOTION_CAN_CROSS_MOUNTAINS_SCOUT'=NEW.Type
    BEGIN
      UPDATE UnitPromotions
        SET PromotionPrereqOr1 = "PROM_UNLOCK_LVL_2", PromotionPrereqOr2 = "PROM_UNLOCK_LVL_3", PromotionPrereqOr3 = "PROM_UNLOCK_LVL_4", PromotionPrereqOr4 = NULL, PromotionPrereqOr5 = NULL, PromotionPrereqOr6 = NULL, PromotionPrereqOr7 = NULL, PromotionPrereqOr8 = NULL, PromotionPrereqOr9 = NULL
        WHERE Type = 'PROMOTION_CAN_CROSS_MOUNTAINS_SCOUT';  
    END;
    
    CREATE TRIGGER TerrainUnlocker3
    AFTER INSERT ON UnitPromotions  
    WHEN 'PROMOTION_CAN_CROSS_MOUNTAINS'=NEW.Type
    BEGIN
      UPDATE UnitPromotions
        SET PromotionPrereqOr1 = "PROM_UNLOCK_LVL_4", PromotionPrereqOr2 = NULL, PromotionPrereqOr3 = NULL, PromotionPrereqOr4 = NULL, PromotionPrereqOr5 = NULL, PromotionPrereqOr6 = NULL, PromotionPrereqOr7 = NULL, PromotionPrereqOr8 = NULL, PromotionPrereqOr9 = NULL
        WHERE Type = 'PROMOTION_CAN_CROSS_MOUNTAINS';  
    END;
    
    To make it compatible to any other new promotions, just copy paste this and type in your new promotion into the parts with "Type".
    This will replace the old depencies for this promotion with the unlocker promotions.

    And of course you have to decide whether the new promotion should be available with unlocker2, unlocker3 or unlocker4.
    If it should be available with unlocker2, all three unlockers must be added, like in the example of 'PROMOTION_CAN_CROSS_MOUNTAINS_SCOUT'
     
  15. Xony

    Xony Chieftain

    Joined:
    Mar 9, 2016
    Messages:
    99
    Thank you for the thorough reply! The code you posted just adds compability to whowards Terraincrossing mod, right? So i would load his mod first and this after to make both work? I'll try fiddling around with it later and hope I won't break anything with having no clue about modding :D
     
  16. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    641
    Yes.
    Like described in my comments in this code, it should not matter which mod is loaded first.

    In the original terraincrossing mod is no promotion called "PROMOTION_CAN_CROSS_MOUNTAINS_SCOUT" , I added it myself in the slightly changed version of my modpack, see signature... That way scouts can cross mountains with unlocker2 (or higher), while others need unlocker4.

    If you want to test if your changes do work, you can open Promotions - Level Promotions.lua , scroll down and uncomment "Events.SerialEventUnitCreated.Add(GiveExper)" (so deleting the "--" before it). That way all units will get 100XP after they are created. And the next turn they can choose promotions.
     
  17. Xony

    Xony Chieftain

    Joined:
    Mar 9, 2016
    Messages:
    99
    Yeah, the comments in the code are great for understanding it :D.

    Sorry, how did you assign the Pseudopromotion PROMOTION_CAN_CROSS_MOUNTAINS_SCOUT to the scout or reconclass? Can't seem to understand how to make these.

    Will do.
     
  18. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    641
    You can download my modpack and take a look into the xml file ;)

    I copy pasted it now for you, here you see the two cross mountain promotions:
    Code:
    <UnitPromotions>
        <Row>
            <Type>PROMOTION_CAN_CROSS_MOUNTAINS</Type>
            <Description>TXT_KEY_PROMOTION_CAN_CROSS_MOUNTAINS</Description>
            <Help>TXT_KEY_PROMOTION_CAN_CROSS_MOUNTAINS_HELP</Help>
            <Sound>AS2D_IF_LEVELUP</Sound>
            <PortraitIndex>33</PortraitIndex>
            <IconAtlas>PROMOTION_ATLAS</IconAtlas>
            <PediaType>PEDIA_ATTRIBUTES</PediaType>
            <PediaEntry>TXT_KEY_PROMOTION_CAN_CROSS_MOUNTAINS</PediaEntry>
            <CanCrossMountains>true</CanCrossMountains>
            <IgnoreTerrainDamage>true</IgnoreTerrainDamage>
            <IgnoreFeatureDamage>true</IgnoreFeatureDamage> 
            <PromotionPrereqOr1>PROMOTION_SCOUTING_2</PromotionPrereqOr1>
            <PromotionPrereqOr2>PROMOTION_SURVIVALISM_2</PromotionPrereqOr2>
            <PromotionPrereqOr3>PROMOTION_SHOCK_3</PromotionPrereqOr3>
            <PromotionPrereqOr4>PROMOTION_DRILL_3</PromotionPrereqOr4>
            <PromotionPrereqOr5>PROMOTION_ACCURACY_3</PromotionPrereqOr5>
            <PromotionPrereqOr6>PROMOTION_BARRAGE_3</PromotionPrereqOr6>
            <OrderPriority>7</OrderPriority>
        </Row>
        
        <Row>
            <Type>PROMOTION_CAN_CROSS_MOUNTAINS_SCOUT</Type>
            <Description>TXT_KEY_PROMOTION_CAN_CROSS_MOUNTAINS</Description>
            <Help>TXT_KEY_PROMOTION_CAN_CROSS_MOUNTAINS_HELP</Help>
            <Sound>AS2D_IF_LEVELUP</Sound>
            <PortraitIndex>33</PortraitIndex>
            <IconAtlas>PROMOTION_ATLAS</IconAtlas>
            <PediaType>PEDIA_ATTRIBUTES</PediaType>
            <PediaEntry>TXT_KEY_PROMOTION_CAN_CROSS_MOUNTAINS</PediaEntry>
            <CanCrossMountains>true</CanCrossMountains>
            <IgnoreTerrainDamage>true</IgnoreTerrainDamage>
            <IgnoreFeatureDamage>true</IgnoreFeatureDamage> 
            <PromotionPrereqOr1>PROMOTION_SCOUTING_2</PromotionPrereqOr1>
            <PromotionPrereqOr2>PROMOTION_SURVIVALISM_2</PromotionPrereqOr2>
            <PromotionPrereqOr3>PROMOTION_SHOCK_3</PromotionPrereqOr3>
            <PromotionPrereqOr4>PROMOTION_DRILL_3</PromotionPrereqOr4>
            <PromotionPrereqOr5>PROMOTION_ACCURACY_3</PromotionPrereqOr5>
            <PromotionPrereqOr6>PROMOTION_BARRAGE_3</PromotionPrereqOr6>
            <OrderPriority>7</OrderPriority>
        </Row>
    </UnitPromotions>
    
    <UnitPromotions_UnitCombats>
        <Row>
            <PromotionType>[B]PROMOTION_CAN_CROSS_MOUNTAINS_SCOUT[/B]</PromotionType>
            <UnitCombatType>[B]UNITCOMBAT_RECON[/B]</UnitCombatType>
        </Row>
        <Row>
            <PromotionType>PROMOTION_CAN_CROSS_MOUNTAINS</PromotionType>
            <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
        </Row>
        <Row>
            <PromotionType>PROMOTION_CAN_CROSS_MOUNTAINS</PromotionType>
            <UnitCombatType>UNITCOMBAT_GUN</UnitCombatType>
        </Row>
        <Row>
            <PromotionType>PROMOTION_CAN_CROSS_MOUNTAINS</PromotionType>
            <UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
        </Row>
        <Row>
            <PromotionType>PROMOTION_CAN_CROSS_MOUNTAINS</PromotionType>
            <UnitCombatType>UNITCOMBAT_ARMOR</UnitCombatType>
        </Row>
    </UnitPromotions_UnitCombats>
    so in "UnitPromotions_UnitCombats" you define, which unittype can get the promotion.
     
  19. Xony

    Xony Chieftain

    Joined:
    Mar 9, 2016
    Messages:
    99
    Ah, thought it was already in the Level Promotion mod and wondered why I didn't find it. Yeah, will do. Your modpack looks pretty great, would have immediately jumped on it if I haven't found the CBP first :crazyeye:. I will probably still try it though after fiddling around with the xml and giving up :lol: Thank you really much for all the help.
     

Share This Page