ShowUIScreen

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

ShowUIScreen

Post 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?
AndrewGardner
Slitherine
Slitherine
Posts: 535
Joined: Tue Nov 13, 2012 6:24 pm

Re: ShowUIScreen

Post 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")
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: ShowUIScreen

Post by enric »

Thank you Andrew.
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: ShowUIScreen

Post 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
AndrewGardner
Slitherine
Slitherine
Posts: 535
Joined: Tue Nov 13, 2012 6:24 pm

Re: ShowUIScreen

Post by AndrewGardner »

PrintStringIndexed("IDS_UNITNAME", GetUnitStringID(id))
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: ShowUIScreen

Post by enric »

THANK YOU!
Post Reply

Return to “Battle Academy : Modders Corner ”