Title Cards

From BiaSDK
Jump to: navigation, search

In BIA EIB each level opens with a screen detailing the location, time, and date. This is a simple way to establish the location of your level, maybe even comparable to an establishing shot in movies, as it's the first thing a player will see when playing it. Getting this to work right is a simple process, you may have noticed before, the tutorials have included several other files matching the name of each map, the one we are interested in is 'Sample_scriptedSequences.int' the other extensions work when BIA EIB is running in another language.

'Sample_scriptedSequences.int' is a regular text document; open it up in notepad for editing. Underneath the existing text we will add some new lines that get displayed in-game.

Title=Scripted Sequences Tutorial
TitleDate=June 10, 1944
TitleDay=D+6 0700
TitleLocation=Somewhere in France
TitleCaption=insert description here

[LevelSummary] Title= Scripted Sequences Tutorial

Any text in brackets is defining an object or some kind of actor inside the level, for example; [LevelInfo] is defining variables found under the LevelInfo rollout accessed by going to View -> Level Properties (or hitting F6) inside the editor.

The main reason for doing this was localization, names and text inside the levels could be swapped around easily by just editing the INT files, rather than editing the levels themselves.

Title this is the name of your map, it will be displayed in SA view and during the title card screen TitleDate the date TitleDay the day in relation to D+0 (June 6th) TitleLocation the location of your level TitleImage used when choosing chapters, references an image to use (not required) TitleCaption used when choosing chapters, short synopsis of level (not required) LevelSummary has the same purpose as Title

Once the lines listed above are in the INT file, save it into your EIB\System folder, as that is where BIA EIB looks for the files.

Before you can test it though, you need to define a couple more properties in the editor, with Sample_scriptedSequences.gbxmap open, hit F6 or click View -> Level Properties. Expand LevelInfo, Look for LocalizationFileName and MapFileName. These will be blank right now, but they need to be set to match your INT filename and also the GBXMAP filename, it's good practice to keep both named the same, so set these two to "Sample_scriptedSequences" (without the quotes).

Now save and run the map if you like, upon going into SA view you should see "Scripted Sequences Tutorial" up across the top, if it has some other text there, check to make sure the file exists in your EIB\System folder and that the lines listed above were added.

Now, to get the title card working!

BIA EIB has some nice new TriggeredScript actors which make setting up repetitious tasks easy, but first we will do this the hands-on way since it helps demonstrate scripting. We will learn about some of the new Actors later in this tutorial.

Step 1

Open up the Actor Class Browser, either from the small gamepeice icon along the top toolbar, or by going to View -> Show Actor Class Browser.

Step 2

Click on the Actor Classes Tab, and then expand Actor over on the left column (if it isn't already). Scroll down and find TriggeredScript, now expand this also; you will see a list of all TriggeredScripts in the level.

We want to create a new TriggeredScript, to do this you need to right click on TriggeredScript and then select New..., up pops a dialogue box, we want to call this TriggeredScript "TS_TitleCard", so type that in the Name: field and click OK.

Note: BIA EIB used a more standardized labeling scheme than RTH30, all level-specific TriggeredScripts are named a specific way; if I were creating this Triggered Script for Chateau I'd be naming it 'TS_D02_2300_TitleCard' or possibly 'TS_D022300_TitleCard'. This helps when opening multiple maps; TriggeredScripts naturally overwrite prior ones in the editor with the same name, so adding in the map name or date prevents that.

Step 3

So now after creating the new TriggeredScript, a new window should have popped up with 'TS_TitleCard' in the left column, and some text on a blue background in the right column; This is the window used for editing scripts.

Lets start by adding a Triggered state, whatever is inside the state will happen when the script is triggered, just add this text in a line or two under what is already there:

State Triggered


Now click on the Compile Changed Scripts button, or go to Tools -> Compile Changed. If everything was typed okay it should have compiled with a message of Success at the bottom of the window, and the number of lines and statements.

At this point we are going to drop this TriggeredScript into our level, if you haven't clicked on any other actors in the Actor class Browser, just right click anywhere around the start of the map, on the terrain (somewhere that makes sense) and select Add TS_TitleCard Here. Then save your level.

This should always be done as soon as you create a new TriggeredScript to be safe, because if the TriggeredScript hasn't been physically placed in the level, it won't be saved, and next time you open the level you won’t see it listed in the Actor Class Browser.

Now that we have our new TriggeredScript placed, we are going to begin editing it, if you don't have the script editing window still open, you can easily right click on the godzilla looking actor, and select Edit Script.

Step 4

Above State Triggered, add these two lines:

var WargamePlayerController MyPlayerController;
var WargamePawn MyPlayerPawn;

Those two lines are defining two variables we will use as 'shortcuts' to quickly access the LocalPlayerPawn and LocalPlayerController; basically 'you' in the game.

Now after Begin: copy and paste the following lines, don't worry about why right now, most of the commands with ACTION_ in front are self explanatory, and the //comments break this code up, explaining what each chunk is doing overall.

MyPlayerController = GetLocalPlayerController();
MyPlayerPawn = GetLocalPlayerPawn();

//turns off battle dialogue


//hides the HUD

ACTION_HideHUD( MyPlayerController, TRUE );

// Limits the player's input / locks movement

ACTION_BlockActionKeys( -1 ); ACTION_UnblockActionKeys( KEY_ACTION_SHOW_MENU ); ACTION_LimitPlayerInput( MyPlayerController, TRUE ); ACTION_LockPlayerMovement( MyPlayerPawn );

//sets up and shows the Map name, date, time

Level.Title = Localize( "LevelInfo" , "Title", Level.GetLevelFileName() ); Level.TitleDate = Localize( "LevelInfo" , "TitleDay", Level.GetLevelFileName() ) @ Localize( "LevelInfo" , "TitleDate", Level.GetLevelFileName() ); Level.TitleLocation = Localize( "LevelInfo" , "TitleLocation", Level.GetLevelFileName() ); ACTION_MapIntroTextPos( MyPlayerController, 50, 350 ); ACTION_MapIntroText( MyPlayerController, 1, 2.0 );

//waits for 5 seconds while displaying the map name, date and time

Sleep( 5.0 );

// Fades out text and fades into game // also unlocks player's controls and unhides the HUD

ACTION_MapIntroText( MyPlayerController, 2, 2.0 ); sleep( 2.0 ); ACTION_FadeOverlay( MyPlayerController, 2, 6.0 ); sleep( 0.5 ); ACTION_UnblockActionKeys( -1 ); ACTION_HideHUD( MyPlayerController, FALSE ); ACTION_EnableBattleDialogue(); ACTION_UnlockPlayerMovement( MyPlayerPawn ); ACTION_LimitPlayerInput( MyPlayerController, FALSE ); sleep( 0.5 );

Now, Compile changed, save your map. Make sure it compiles without errors.

Step 5

To be able to test the Title Card script, we will need to make it get triggered upon level startup, we could do this by adding TS_TitleCard to the first gbxPlayerStart in the 'Event' field, but since this map has checkpoints we will use the CheckpointManager.

Select the CheckpointManager icon in the level, or search for it, and in its property inspector, expand CheckpointManager, checkpointEvents, in the field for [0] there should be "IntroScript", we need to change that to TS_TitleCard.

Now the TitleCard script will be triggered when the level loads from the very first checkpoint, but what about our IntroScript which was made to spawn our squad, save a checkpoint and start the combat?

We need to edit the TS_TitleCard script, and add a couple lines which will do this for us, we could just make TS_TitleCard trigger IntroScript, but then things would happen out of order and we might see our squad spawn in from thin air.

Step 6

Add the follow line just after the ACTION_DisableBattleDialogue(); line:


Now at the end of the script after Sleep( 0.5 ); add these lines:

ACTION_CheckPointSave( 1 );

Compile changed and save! Now there is one last thing to do, open up the Level Properties, and under LevelInfo find 'm_fStartBlack', set it to 'True', this will cause our level to start with a black screen, so that the text is displayed in the same format as BIA EIB.

Save again, and test your level!

If everything was done correctly, the level should load up to a black screen with the Title Card information displayed for 5 seconds, and then fade into the game. If it doesn't work as expected, make sure TS_TitleCard is being triggered and that the script compiled successfully.

The first step in establishing the location is complete, now we can move on to setting up the scene and mood of our actors (your squad) before the combat begins.

Back to Main Page