Page 1 of 1

Introduction text - How to?

Posted: Fri Jul 27, 2012 5:50 am
by GottaLove88s
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

Re: Introduction text - How to?

Posted: Fri Jul 27, 2012 8:20 am
by GottaLove88s
Ideally one of those text displays that requires the player to click a tick to continue...

Re: Introduction text - How to?

Posted: Fri Jul 27, 2012 3:17 pm
by pipfromslitherine
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

Re: Introduction text - How to?

Posted: Fri Jul 27, 2012 3:40 pm
by GottaLove88s
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") ;
}
}
}

Re: Introduction text - How to?

Posted: Fri Jul 27, 2012 3:59 pm
by pipfromslitherine
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

Re: Introduction text - How to?

Posted: Sat Jul 28, 2012 3:12 pm
by enric
Can you be more explicit in the parameters in the wiki page?:
Control

The name of the top level object in the control
Which are the possibles controls, or where they are?.

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.
Which are the possibilities?

Re: Introduction text - How to?

Posted: Sat Jul 28, 2012 5:09 pm
by pipfromslitherine
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

Re: Introduction text - How to?

Posted: Sun Jul 29, 2012 8:49 am
by GottaLove88s
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()
{

}