[English] Start a Countdown in the HUD

  • To show a countdown at the bottom you need to use the third parameter of MsgNewsNoWait



    Lua
    local DestTime = CurrentTime + WaitTime
    local ID = "Event"..GetID("Voter")
    MsgNewsNoWait("Voter", "Voter", "@C[@L_OFFICE_SESSION_IN_TOWN_COUNTDOWN_+0,%i3,%l4]", "default", -1,
    		"@L_SESSION_6_TIMEPLANNERENTRY_ELECTOR_+0",
    		"@L_SESSION_6_TIMEPLANNERENTRY_ELECTOR_+1", 
    	        GetID("Voter"), GetID("settlement"), DestTime, ID)


    You use @C[LABEL,%i,%l]


    Label can be anything from the Text.dbt
    %i needs the number of a int-parameter. This will be your end-time. Use GetGametime() to specify an end-time (here: DestTime)
    %l needs to be a String. That string is the ID-String. It is used as the Alias for the countdown ("Event"..+ID of the object)


    To remove a countdown you use the function

    Lua
    local ID = "Event"..GetID("")
    HudRemoveCountdown(ID, false)

    I'm not quite sure what the 2nd parameter is. This function doesn't appear in the script documentation.



    Important: you MUST use the "default" channel or it won't work. I lost several hours because I had it set to "politics". Don't be me!