Page 1 of 1

ShowUIScreen

Posted: Mon Apr 15, 2013 3:35 pm
by enric
ShowUIScreen("BattlePop0", "Anim1", "IDS_SCENARIO_ENGINEERS", "BHead0Image:US_tanker_head") ;

With this function is possible to show some static text during the battle.
The text should be defined prior on IDS_SCENARIO_ENGINEERS_BP0TEXT, "the text",

How can I, dynamically change the text?, so the text refers to the current values of some of game variables?
If with ShowUIScreen is not possible, is there another functions to do the task?

Re: ShowUIScreen

Posted: Mon Apr 15, 2013 7:14 pm
by AndrewGardner
I think something like this will work to replace the static string with something dynamic:

ShowUIScreen("BattlePop0", "Anim1", "IDS_SCENARIO_ENGINEERS", "BP0Image:US_tanker_head") ;
StartString() ;
PrintString("IDS_TURNS") ;
PrintInt(40 - GetTurn()) ;
SetUIObjectString("BP0Text")

Re: ShowUIScreen

Posted: Mon Apr 15, 2013 8:45 pm
by enric
Thank you Andrew.

Re: ShowUIScreen

Posted: Mon Apr 15, 2013 8:57 pm
by enric
Another question, how can I get the name attribute?

Example
for(i=0; i<GetUnitCount(0); i++)
{
id = GetUnitID(0, i) ;
if(GetUnitDead(id) != 1)
{

Now I want to now the name of each unit without have to ask for every unit name
if ( IsUnitType(id, "Sherman")== 1)
{
the name is Sherman
}
if (IsUnitType(id, "another")== 1)
{
the name is another
}
at infinitum

Re: ShowUIScreen

Posted: Mon Apr 15, 2013 9:19 pm
by AndrewGardner
PrintStringIndexed("IDS_UNITNAME", GetUnitStringID(id))

Re: ShowUIScreen

Posted: Mon Apr 15, 2013 9:32 pm
by enric
THANK YOU!