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 Flags EUI 1.1

Shows Unit Promotions next to unit flags - updated for EUI

  1. ryanmusante

    ryanmusante Regular Supporter

    Joined:
    Jan 4, 2018
    Messages:
    983
    Gender:
    Male
    I'm going to clear cache and do a verify integrity through steam. My setup is fragile as it is, steam through wine on Linux in dx9 mode. Having done a kill command through terminal might have inadvertently corrupted something. [also using texture2k dlc]
     
    Last edited: Apr 1, 2018
  2. raphaell666

    raphaell666 Chieftain

    Joined:
    Mar 27, 2018
    Messages:
    62
    Gender:
    Male
    Has anyone managed to include this mod in a modpack to use in multiplayer? For some reason it is not working here.
     
  3. ridjack

    ridjack King

    Joined:
    Mar 12, 2017
    Messages:
    603
    First of all, THANK YOU for these mods. The Promotion Flags in particular was one I missed for a long time.

    Secondly, I installed this and both of your other mods linked in your signature, and it appears to have broken the countdown @Infixo recently added to the 'Prisoners of War' promotion tooltip. The countdown is no longer there.

    upload_2018-4-30_15-50-26.png
     
  4. Infixo

    Infixo Deity

    Joined:
    Jan 9, 2016
    Messages:
    3,397
    Gender:
    Male
    Location:
    Warsaw
  5. adac

    adac Chieftain

    Joined:
    Jun 11, 2014
    Messages:
    49
    Probably a dumb question here, but how do I install this (I'm using the default VP installation with EUI)? Somewhere in C:\Users\<MyUserName>\Documents\My Games\Sid Meier's Civilization 5\MODS\ ? Or in the Civ 5 directory structure itself?

    EDIT: Sorry, being an idiot. Been so long since I've added a mod that wasn't VP that I forgot how to do it. Just extract the zip to the MODs directory and it's picked up; duh!
     
    Last edited: May 1, 2018
  6. adac

    adac Chieftain

    Joined:
    Jun 11, 2014
    Messages:
    49
    So comparing the "default" VP unitpanel.lua to the promotion flags one, my best guess is that lines 1237-1240 in the "default" are the ones that have the timer (or are at least related to it). But there is so much added to the promotion flags file that I am not confident at all in adding these lines in the correct place or that this is everything needed; I think I'll just live without the timer for now. It's nice to have, but not game breaking if it's missing; when the worker no longer sucks and the icon disappears, the POW malus is gone:

    -- Tooltip
    local sDurationTip = ""
    if unit:GetPromotionDuration(unitPromotionID) > 0 then
    sDurationTip = " (" .. Locale.ConvertTextKey("TXT_KEY_STR_TURNS", unit:GetPromotionDuration(unitPromotionID) - (Game.GetGameTurn() - unit:GetTurnPromotionGained(unitPromotionID))) .. ")"
     
  7. Infixo

    Infixo Deity

    Joined:
    Jan 9, 2016
    Messages:
    3,397
    Gender:
    Male
    Location:
    Warsaw
  8. adac

    adac Chieftain

    Joined:
    Jun 11, 2014
    Messages:
    49
    Ah okay; I was just using "Beyond Compare" and seeing what lines were different; apparently 1341-1342 didn't come up as not matching. But again, I probably won't mess with it. The counter is awesome but I can live without it for now.
     
  9. wistak

    wistak Chieftain

    Joined:
    Oct 16, 2015
    Messages:
    86
    Gender:
    Male
    Location:
    Warsaw
    You need to copy it manual after creating modpack to mods folder
     
    ElliotS likes this.
  10. vyyt

    vyyt Emperor

    Joined:
    Jan 28, 2005
    Messages:
    1,697
    Location:
    Czech Republic
    Wow, less memory-heavy FlagPromotions! Awesome, thank you very much! Any chance you would be creating a non-EUI version?
     
  11. ryanmusante

    ryanmusante Regular Supporter

    Joined:
    Jan 4, 2018
    Messages:
    983
    Gender:
    Male
    @akamal is a boss!
     
  12. Hosannah

    Hosannah Chieftain

    Joined:
    Jul 19, 2016
    Messages:
    90
    Gender:
    Male
    Location:
    Germany
    I'm having the same problem.

    I don't see how this would fix it for multiplayer since the mods folder is used in single player only (I think?).
     
  13. wistak

    wistak Chieftain

    Joined:
    Oct 16, 2015
    Messages:
    86
    Gender:
    Male
    Location:
    Warsaw
    From gamę mods folder (mydocuments/civ5.... or something)
    To modpack mod folder
    (Steam Civ 5 location/assets/dlc/modpack/mods)
     
    ElliotS likes this.
  14. ElliotS

    ElliotS Warmonger

    Joined:
    Jun 13, 2013
    Messages:
    2,654
    Gender:
    Male
    Location:
    Chicago
    This worked. Thanks a ton!

    Any idea why this is happening? Is there something @akamal can change to get MPMP maker to bring it with as well?
     
  15. rp03ev

    rp03ev Chieftain

    Joined:
    Dec 13, 2011
    Messages:
    44
    did the new 7-15 beta VP break this mod? i cant seem to get it to work anymore after installing the 7-15 VP beta.
     
  16. ryanmusante

    ryanmusante Regular Supporter

    Joined:
    Jan 4, 2018
    Messages:
    983
    Gender:
    Male
    Is an update planned in the future for better integration with VPPI?
     
  17. ilteroi

    ilteroi Prince

    Joined:
    Mar 11, 2006
    Messages:
    320
    i'm getting tons of lua errors like this:

    "Sid Meier's Civilization 5\MODS\Promotion Flags EUI (v 1.1)\UI\UnitFlagManager.lua:759: attempt to compare two nil values"

    is it possible to fix that?
     
  18. ryanmusante

    ryanmusante Regular Supporter

    Joined:
    Jan 4, 2018
    Messages:
    983
    Gender:
    Male
  19. Moi Magnus

    Moi Magnus Emperor

    Joined:
    Mar 1, 2015
    Messages:
    1,837
    Bug report: floating point version numbers are incompatible with multiplayer modpacks for some reasons.
    Changing every version number from 1.1 to 1 (or 2) in the .modinfo (including the title of the .modinfo) fix the problem.
     
    Last edited: Nov 25, 2018
  20. civplayer33

    civplayer33 King

    Joined:
    Sep 11, 2017
    Messages:
    681
    Well not so easy when you didn't write the mod and don't know any LUA :crazyeye:
    However, since I'm not completely useless, I took a shot at it. Do you think this would work @Infixo ?
    Spoiler changed code demarked with '+' :

    Code:
    function AddPromotionIcon(controltable, promoID, iconPositionID, unit)
        local promo = GameInfo.UnitPromotions[promoID]
        IconHookup( promo.PortraitIndex, 32, promo.IconAtlas, controltable.UnitPromotionImage )
       
        local hoverText = ""
        if promo.SimpleHelpText then
            hoverText = Locale.ConvertTextKey(promo.Help)
        else
    +       if unit:GetPromotionDuration(promoID) > 0 then
    +           local sDurationTip = ""
    +           sDurationTip = " (" .. Locale.ConvertTextKey("TXT_KEY_STR_TURNS", unit:GetPromotionDuration(promoID) - (Game.GetGameTurn() - unit:GetTurnPromotionGained(promoID))) .. ")"
    +           hoverText = string.format("[COLOR_YELLOW]%s[ENDCOLOR]%s[NEWLINE]%s",
    +               L(promo.Description),
    +               sDurationTip,
    +               L(promo.Help)
    +           )
    +       else
                hoverText = string.format("[COLOR_YELLOW]%s[ENDCOLOR][NEWLINE]%s",
                    Locale.ConvertTextKey(promo.Description),
                    Locale.ConvertTextKey(promo.Help)
                )
            end
        end   
        if PromotionFlagsSettings.Debug then hoverText = hoverText .. "[NEWLINE]" .. promo.Type end
        if promo.RankNumber then
            -- add earlier rank promotions to the tooltip (eg add Drill 1 if we have Drill 2)
            local rankNum = promo.RankNumber - 1
            while rankNum > 0 do
                for nextPromo in GameInfo.UnitPromotions{RankList = promo.RankList, RankNumber = rankNum} do
                    if unit:IsHasPromotion(nextPromo.ID) then
                        if nextPromo.SimpleHelpText then
                            hoverText = string.format("%s[NEWLINE]%s",
                                hoverText,
                                Locale.ConvertTextKey(nextPromo.Help)
                            )
                        else
                            hoverText = string.format("%s[NEWLINE][COLOR_YELLOW]%s[ENDCOLOR][NEWLINE]%s",
                                hoverText,
                                Locale.ConvertTextKey(nextPromo.Description),
                                Locale.ConvertTextKey(nextPromo.Help)
                            )
                        end
                        if PromotionFlagsSettings.Debug then hoverText = hoverText .. "[NEWLINE]" .. nextPromo.Type end
                    end
                end
                rankNum = rankNum - 1
            end
        else
            --Flag Promos not around to set up the rank list
            -- so we'll just have to give up
        end
        controltable.EarnedPromotion:SetToolTipString( hoverText )
    end
    


    Edit: I updated this since the old version was not working properly; it does seem to work now.
    Edit2: I updated the code again; it is now working without issue
     
    Last edited: Dec 7, 2018
    ryanmusante likes this.

Share This Page