Resource icon

Promotion Flags EUI 1.1

If it does happen again, could you try just restarting the game and reloading, to see if re-occurs immediately, or a few turns (or minutes\hours) later?
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:
Has anyone managed to include this mod in a modpack to use in multiplayer? For some reason it is not working here.
 
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
 
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:
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))) .. ")"
 
Lines 1237-1242 in EUI version are changed for that.

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.
 
From gamę mods folder (mydocuments/civ5.... or something)
To modpack mod folder
(Steam Civ 5 location/assets/dlc/modpack/mods)
 
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.
 
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?
 
Promotion Flags for EUI
Requires EUI (or VoxPopuli with EUI)
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:
It probably overwrites unitpanel.lua. Easy to fix, just need to copy a few lines from VP version.
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:
Top Bottom