Unfortunately, you cannot. You have to define the values in your lang file, then use code to call it.
<CATEGORY Name="Messages">
<Entry Name="Percentage_100">100%</Entry>
<Entry Name="Percentage_99">99%</Entry>
...
<Entry Name="Percentage_1">1%</Entry>
</CATEGORY>
Using code, you'd have to call it in a timer that plays every 5 seconds and lowers your value. I've slightly adjusted my code to suit my knowledge of the engine, but it'll work in its simplest form, like this:
void OnStart()
{
SetLocalVarInt("PowerRemain", 101); //Becomes 100 in first Timer step.
AddTimer("", 5.0f, "DimLights");
}
void DimLights(string &in asTimer)
{
AddLocalVarInt("PowerRemain", -1);
if(GetLocalVarInt("PowerRemain") == 0)
{
//We have no power lol
}
else
{
SetMessage("Messages", "Percentage_"+PowerRemain, 3.0f);
}
AddTimer("", 5.0f, "DimLights");
}
The best way to make your entries for your lang, would best be if you have any experience in a computer language (C, Lua, Vb.NET) to get the computer to type out your entries using a loop. In something psuedocode-like, it may appear like this:
BEGIN
var <-- 100
do until var = 0
print "<Entry Name=""Percentage_"""+var+">"+var+"%</Entry>"
var <-- var - 1
loop
END
If you can't, I'll type one up later. I did all of this on my phone. https://dotnetfiddle.net/4sHWe5
Keep in mind, there are other methods! I believe FlawlessHappiness can help you by using numbered particle systems, but keep in mind that these likely won't always be on the screen.
Moving to the Development Support subforum. Please remember to keep all scripting and custom story related problems over there.