End Screen Creation – Arma Reforger
The End Screen (interchangeably called Game Over screen) are screens shown when the game ends. This guide will go through each part and how to set up your own game over screen.
The end screen consists out of various parts:
Element | Type | Description |
---|---|---|
GameMode.EndGameMode() (from SCR_BaseGameMode.c) | Method | The end screen is called by means of the GameMode.EndGameMode() method and uses the data provided, combined with the local player data to decide what to display. |
SCR_GameModeEndData | Data | Data used in the EndGameMode method combined with wining player(s) and winning faction(s). See the script itself as well as the SCR_GameModeEndData.Create() and SCR_GameModeEndData.CreateSimple() to get more information as to how to call end game. |
EndScreen.layout | Layout | This is the base layout which fades in when game over is called. The specific game over widgets are spawned within this layout. |
GameOverScreensConfig.conf | Config | This holds all the gameover screens and is referenced to by various scripts to get the specific information that needs to be shown such as but not limited to: The specific layout spawned within the EndScreen.layout, the localized title, subtitle, briefing, the icon shown, audio played as well as various optional parameters. |
EndScreenContent_Default.layout |
Layout | These are two standard layouts used in the End Screens in the config. These are spawned within the EndScreen.layout and hold the actual visuals. (It is possible that there are more layouts by the time you are reading this). Use these as an example if you want to display any specific information like: Score or some custom screen. Create your own if you want to modify the end screen (Keep in mind that changing the basic ones will change it for all game modes). Do take note that some widgets like text widgets and the image will need specific naming, though leaving them out will not cause any issues. |
SCR_GameOverScreenContentUIComponent | Script | This is the main widget component found on the EndScreen_Default and EndScreen_NoImage layout. If you want to do something special with the layout then it would be advised to inherit from this component and override the methods. |
EGameOverTypes.c | Enum | This hold the enums used as identifiers within the config. Config endscreens mostly use this as an identifier for developers but any editor or custom endscreen will need a specific unique enum. |
Config Modding
Add New End Screen
- Open GameOverScreensConfig.conf
- Press the '+' to start creating a new End Screen. Here you will be presented with a few options.
These are the options by the time of writing this guide:
Class Description SCR_BaseGameOverScreenInfo Basic game over screen to set a title, subtitle, briefing and image. If you create any new End Screens this is the base you will inherent from SCR_FactionGameOverScreenInfo If the end condition contains one or more factions then this allows you to get the faction flag for the image and faction name as parameter in the Subtitle SCR_FactionVictoryGameOverScreenInfo Similar to SCR_FactionGameOverScreenInfo but also sets the Vignette color to the winning faction SCR_EditorFactionGameOverScreenInfo Similar to the above but supports multiple winning factions which by default it does not. SCR_DeathMatchGameOverScreenInfo Used to get the wining player name(s) and show it as params in the Subtitle. Note that by the time of writing, this is not used.
Main Variables
The following variables must be filled in:
Variable | Description |
---|---|
Game Over Content Layout | This is the actual layout spawned within the game over screen. You can use EndScreenContent_Default.layout, EndScreen_NoImage.layout or create your own. Just make sure it has the SCR_GameOverScreenContentUIComponent (or an inherited version).
More information about the layout in the steps below. |
Game Over Screen Id | The ID of the game over screen. Make sure it is an unique enum which you added to the EGameOverTypes enum. |
{{Feature|informative|Some of the End screen types such as SCR_EditorFactionGameOverScreenInfo have additional variables (see Optional Variables and Optional Game Master Variables below). As usual, hover over the description to read what they mean.
Optional Variables
The following are optional parameters which affect various base UI elements. To use this Press the Optional Params' set class button.
Variable | Description | |
---|---|---|
Title | This is the localized string for the title. | |
Subtitle | The localized string for the subtitle. | |
Image Texture | What image will be shown. Note that using SCR_FactionGameOverScreenInfo will show the players faction, or in case of SCR_FactionVictoryGameOverScreenInfo will show the faction that won. | |
Debriefing | The localised string for debriefing text | |
Audio One Shot | The audio music one shot that will be played upon the opening of the end screen. | |
Title Param | %1 param shown in Title | |
Subtitle Param | %1 param shown in Subtitle. This is the player faction's name if using the SCR_FactionGameOverScreenInfo or the winning faction's name if SCR_FactionVictoryGameOverScreenInfo. | |
Debriefing Param | %1 for debriefing param |
Optional Game Master Variables
In most cases you would want to make sure your end screen is compatible with Game Master; one thing you need to keep in mind is that there can be more than one winning faction in Game Master.
Similarly to the Optional Variables above press the set class button to add Game Master compatibility. If you leave this null then the game will never allow Game Masters to access this particular End Screen.
Variable | Description |
---|---|
Can Be Set By Game Master | Set to true if you want the Game Master to specifically be able to set this End Screen. You can leave this false, see the 'Mirrored State' variable below for more information. |
Needs Playable Factions | Some End screens such as FactionVictory will need factions to be set, while others like EndSession do not need any factions.
If your end screen checks factions then make sure this is true. Only relevant if 'Can Be Set By Game Master' is true. |
Display Name | This is the localised string name seen by the Game Master when selecting the End Screen. Only relevant if 'Can Be Set By Game Master' is true. |
Description | This is the localized string description the player sees when selecting the End Screen. Only relevant if 'Can Be Set By Game Master' is true. |
Description Param1 and Description Param2 | %1 and %2 of Description. Generally this is set through script rather then in the config. Only relevant if 'Can Be Set By Game Master' is true. |
Mirrored State | In some cases you don't want the Game Master to be able to choose the End Screen directly.
Think of Defeat End Screen if there is already a Victory End Screen. In this cause you set 'Can Be Set By Game Master' true for victory and false for defeat and set the Mirrored state of Victory to Defeat and vice versa. If the Victory End screen is chosen then any faction that is not selected will automatically get the Defeat End Screen. |
Layout
The End screen layout is the actual layout shown when the end screen is called and needs to be set to the 'Game Over Content Layout' variable in the config. Most things are already explained in the steps above. Here though you can go in the most details for your custom End Screen.
The following Table will show all the Default widgets which are affected by the config element we set up before. Do not worry though, you can delete the widgets you do not need as the system will check if they exist. Also the widget names are the default names and can be changed in the SCR_GameOverScreenContentUIComponent class.
Widget Name | Widget Type | Target | Description |
---|---|---|---|
GameOver_Image | ImageWidget | Image Texture | The image shown in the end screen |
GameOver_State | TexWidget | Title | The title shown in the end screen |
GameOver_Condition | TextWidget | Subtitle | The Subtitle Shown in the end screen |
GameOver_Description | TextWidget | Debrief | The Debrief shown in the end screen |
Scripting
Layout Component
If you create a new End screen layout then do make sure it has the SCR_GameOverScreenContentUIComponent or an inherited version of it.
The SCR_GameOverScreenContentUIComponent is the base component used to initilize the end screen. If you want to make a fully custom end screen simply inherent from this script. Simply override the InitContent() method to initialise the end screen. This method will give you the SCR_GameModeEndData as well as all the data set in the config as mentioned above. You can always use super.InitContent() in the method if you want to keep the base functionality.
Screen Manager Component
The SCR_GameOverScreenManagerComponent handles things like displaying the right endscreen depending on local player faction and winning faction but you can also handle this within the layout script as well. You will need to set up the End screen in the SCR_GameOverScreenManagerComponent specifically in the GetGameOverType() method. It is a bit convoluted as the GameOverData and the Game Over Screens are not very compatible in some causes. It mostly is about factions (or winning player Id) and if the local player should get the victory or defeat game end screen.
Either use the existing code as a guide or use the code below to ignore this section altogether:
End the Game
The last step is to actually make sure to call your end game.
Use the GameMode.EndGameMode() to actually end the game. This method takes a new SCR_GameModeEndData which you can create with the SCR_GameModeEndData.CreateSimple() and SCR_GameModeEndData.Create() static methods.
Create Simple method params:
Variable | Description |
---|---|
int reason | The end reason. Generally if using a custom end screen you will be using the EGameOverTypes enum you created as the reason. Check the SCR_GameModeEndData class for more in-depth information. |
int winnerId | The winner player ID. Leave -1 if no winning player |
int winnerFactionId | The winning faction index. Leave -1 if no winning faction |
Create method params:
Variable | Description |
---|---|
int reason | Same as Create Simple |
array<int> winnerIds | An array of winning players. Leave null if no winning players. |
array<int> winnerFactionIds | An array of wining factions. Leave null if no winning factions. |
Example of calling end game in script: