Gents,
Does anyone know how to add a short intro text to be shown to both players at the beginning of a multiplayer game?
Can I do this with TEXT1.TXT alone, or do I need to add some code to the scenario's .BSF also?
Thanks!
GL88
Introduction text - How to?
Moderators: Slitherine Core, BA Moderators
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Introduction text - How to?
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Introduction text - How to?
Ideally one of those text displays that requires the player to click a tick to continue...
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
-
pipfromslitherine
- Site Admin

- Posts: 9937
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Introduction text - How to?
It needs some text set up, as well as a call to show the UI in the script. A good example is at line 27 in the Multiplayer/MPFrance/SCENARIOS/Head_On.bsf
Basically you just need to set up the string entry (IDS_ etc) correctly and show the UI control. Look for IDS_MP_INTRO_NEUTRAL in the MPFrance text file to see how it should be constructed.
Cheers
Pip
Basically you just need to set up the string entry (IDS_ etc) correctly and show the UI control. Look for IDS_MP_INTRO_NEUTRAL in the MPFrance text file to see how it should be constructed.
Cheers
Pip
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Introduction text - How to?
Thanks Pip, I think I've got it. Basically, copy this (code below) into MyScenario.bsf... but I can't find any IDS_MP_INTRO_NEUTRAL in the text1.txt or text2.txt files for MPFrance. Where's it pulling this text from? Do I need to do anything with BattlePop0, Anim1, or BHead0Image:US_infantry_head? GL88
// called at the start of every turn.
// You would tend to use this for events
FUNCTION StartTurn(side)
{
if (GetTurn() == -1 )
{
PreBattleSetup () ;
}
// if it is turn 0 or 1, i.e. the first turn for each player show the briefing message.
if( (GetTurn() == 0 ) || ( GetTurn() == 1 ) )
{
// only show for active side
if ( GetShowSide() == GetCurrentSide() )
{
ShowUIScreenX( "BattlePop0", "Anim1", "IDS_MP_INTRO_NEUTRAL", "BHead0Image:US_infantry_head") ;
}
}
}
// called at the start of every turn.
// You would tend to use this for events
FUNCTION StartTurn(side)
{
if (GetTurn() == -1 )
{
PreBattleSetup () ;
}
// if it is turn 0 or 1, i.e. the first turn for each player show the briefing message.
if( (GetTurn() == 0 ) || ( GetTurn() == 1 ) )
{
// only show for active side
if ( GetShowSide() == GetCurrentSide() )
{
ShowUIScreenX( "BattlePop0", "Anim1", "IDS_MP_INTRO_NEUTRAL", "BHead0Image:US_infantry_head") ;
}
}
}
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
-
pipfromslitherine
- Site Admin

- Posts: 9937
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Introduction text - How to?
Ah - it might have been added to the main game text so we could use it across other campaigns. Yes, it's in text2 in the main game DATA\TEXT folder.
I have added a wiki page with fuller details of what is going on. http://www.slitherinebravo.net/GameWiki ... g_ui_popup
Hope that helps!
Cheers
Pip
I have added a wiki page with fuller details of what is going on. http://www.slitherinebravo.net/GameWiki ... g_ui_popup
Hope that helps!
Cheers
Pip
Re: Introduction text - How to?
Can you be more explicit in the parameters in the wiki page?:
Which are the possibles controls, or where they are?.Control
The name of the top level object in the control
Which are the possibilities?Animation
The animation you want to play on the control when it is displayed. This can be an empty string if no animation is required.
-
pipfromslitherine
- Site Admin

- Posts: 9937
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Introduction text - How to?
The controls are all defined in the UI files. These can be found in DATA\UI and in CORE\UI. The most often used ones in this context are battlepop0 and battlehead0 in their respective files in DATA\UI.
Animations are defined per-file. Some can have more than one, others none. Again, in the case of battlepop0 and battlehead0 they both have a single animation called Anim1.
Sorry I can't be more specific, but it is all very much general purpose - you can define your own UI controls and animations.
Cheers
Pip
Animations are defined per-file. Some can have more than one, others none. Again, in the case of battlepop0 and battlehead0 they both have a single animation called Anim1.
Sorry I can't be more specific, but it is all very much general purpose - you can define your own UI controls and animations.
Cheers
Pip
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Introduction text - How to?
Hey Enric,
What worked for me, is to insert a ShowUIScreenX call within your "if (GetTurn() == 0)" condition below. It's nothing fancy, but it scrolls the text in, displays it in the usual BA box, and includes a tick icon to close. I'm sure, you've figured this out, but using it at (GetTurn() == 0), displays the message before 1st team moves, and then again before 2nd team sees 1st team's replay. I've adapted the remainder of your code to switch off artillery and airstrikes for the first two turns of the scenario. Thanks for your help E
Good luck!
FUNCTION StartTurn(side)
{
if (GetTurn() == -1 )
{
// Setup VPs, damaged tiled, ...
PreBattleSetup() ;
}
if (GetTurn() == 0) // Allied and Allied replay
{
SetScriptGlobal("P47", "gCounter",2) ;
SetScriptGlobal("USBattery", "gCounter", 1) ;
ShowUIScreenX( "BattlePop0", "Anim1", "IDS_MP_INTRO_NEUTRAL", "BHead0Image:US_infantry_head") ;
}
if (GetTurn() == 1) // German
{
SetScriptGlobal("ME262", "gCounter", 4) ;
SetScriptGlobal("NebelBattery", "gCounter", 1) ;
}
}
FUNCTION PreBattleSetup()
{
}
What worked for me, is to insert a ShowUIScreenX call within your "if (GetTurn() == 0)" condition below. It's nothing fancy, but it scrolls the text in, displays it in the usual BA box, and includes a tick icon to close. I'm sure, you've figured this out, but using it at (GetTurn() == 0), displays the message before 1st team moves, and then again before 2nd team sees 1st team's replay. I've adapted the remainder of your code to switch off artillery and airstrikes for the first two turns of the scenario. Thanks for your help E
Good luck!
FUNCTION StartTurn(side)
{
if (GetTurn() == -1 )
{
// Setup VPs, damaged tiled, ...
PreBattleSetup() ;
}
if (GetTurn() == 0) // Allied and Allied replay
{
SetScriptGlobal("P47", "gCounter",2) ;
SetScriptGlobal("USBattery", "gCounter", 1) ;
ShowUIScreenX( "BattlePop0", "Anim1", "IDS_MP_INTRO_NEUTRAL", "BHead0Image:US_infantry_head") ;
}
if (GetTurn() == 1) // German
{
SetScriptGlobal("ME262", "gCounter", 4) ;
SetScriptGlobal("NebelBattery", "gCounter", 1) ;
}
}
FUNCTION PreBattleSetup()
{
}
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
