Having trouble with in-game dialog pop-ups

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Having trouble with in-game dialog pop-ups

Post 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
pipfromslitherine
Site Admin
Site Admin
Posts: 9886
Joined: Wed Mar 23, 2005 10:35 pm

Re: Having trouble with in-game dialog pop-ups

Post 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
Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Having trouble with in-game dialog pop-ups

Post by Amaris »

@Justin: Ok I found, sorry :wink:

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.
“Take care, my friend; watch your six, and do one more roll… just for me.”
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Re: Having trouble with in-game dialog pop-ups

Post 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,
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Re: Having trouble with in-game dialog pop-ups

Post 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!
Post Reply

Return to “Battle Academy : Modders Corner ”