Page 1 of 1
Having trouble with in-game dialog pop-ups
Posted: Sat Apr 06, 2013 10:36 pm
by jcb989
I want to display some text to only the side receiving some reinforcements, but all I am getting is a blank dialog book and a strange-looking helmeted man shouting nothing. Here is the script, I've tried a few variants but none of them seem to work so this one is as good as any for comments:
// only show for active side
if ( GetShowSide() == GetCurrentSide() )
{
AddVizCamCenter(17, 37);
ShowUIScreenX( "BattlePop0", "Anim1", "IDS_REINF_US1_BHead0TEXT", "BHead0Image:US_infantry_head") ;
SetGlobal("flag1", GetTurn() + 1);
}
I hope it is not all because of that stray bracket at the end...? =/
Welcome to the world of scripting lol
Re: Having trouble with in-game dialog pop-ups
Posted: Sun Apr 07, 2013 3:03 am
by pipfromslitherine
You need to name your text entries to match up to the dialog you are using. You are using battlepop0, and so you need to name the string in the form of IDS_SOMETHING_BP0TEXT, but you would only put IDS_SOMETHING in the function call (this is so you can have UI popups with multiple text boxes (or indeed gfx) which will have any strings automatically found and filled.
If I'm not being clear then check out an existing mission popup and pay close attention to the relationship between the popup objects, the string naming, and the function call params.
Cheers
Pip
Re: Having trouble with in-game dialog pop-ups
Posted: Sun Apr 07, 2013 9:24 am
by Amaris
@Justin: Ok I found, sorry
Edit your Fuel_depot.bsf (the problem of my bugged version is in the txt files) and fix the line:
Code: Select all
ShowUIScreenX( "BattleHead0", "Anim1", "IDS_REINF_US1", "BHead0Image:us_infantry_head")
And edit your text2.txt and remplace:
Code: Select all
IDS_REINF_US1, "A wandering tank destroyer company has come towards the sound of the battle!",
by
Code: Select all
IDS_REINF_US1_BHead0TEXT, "A wandering tank destroyer company has come towards the sound of the battle!",
(and same for german reinforcement text)
It'll work I guess.
Re: Having trouble with in-game dialog pop-ups
Posted: Sun Apr 07, 2013 11:55 am
by jcb989
Hi Guys,
Thank you for your support.
Yes, the difference is in the function call, it should say:
ShowUIScreenX( "BattleHead0", "Anim1", "IDS_REINF_US1", "BHead0Image:us_infantry_head")
And in the text file it should say:
IDS_REINF_US1_BHead0TEXT, "A wandering tank destroyer company has come towards the sound of the battle!",
Then it works. Thanks! I had changed the BattleHead0 to BattlePop0 and had forgot to change it back.
One last problem is, the text seems is not displayed for very long to read on intro, I thought I should have to click a button to close those dialogs but it just disappeared.
Again probably as Pip suggests I will go look at some original BA code script and see if I see a difference there.
Thank again,
Re: Having trouble with in-game dialog pop-ups
Posted: Sun Apr 07, 2013 2:48 pm
by jcb989
jcb989 wrote:
One last problem is, the text seems is not displayed for very long to read on intro, I thought I should have to click a button to close those dialogs but it just disappeared.
Again probably as Pip suggests I will go look at some original BA code script and see if I see a difference there.
Aha. I knew I changed from BattleHead0 to Pop0 for a reason, heh. The Pop designation gives a checkbox to click on after reading the long-winded text messages I'm throwing around. All is in working order though, as long as I replace Head with Pop!