Placeholders
Placeholders are special strings in that can be used to access specific paths, Windows settings, or other such things across the engine. They are defined in placeholders.xml
stored in the engine data directory. Additional placeholders can be added with ease for future extensibility.
Configurable Placeholders
These placeholders are placed into placeholders.xml
by default, but can be changed by the user if desired.
APD_ROAMING
- The folder path to the current user's AppData (Roaming) folder.-
Default:
%APPDATA%
-
DOCUMENTS
- The folder path to the current user's My Documents folder. -
Default:
%USERPROFILE%\Documents
-
USER_HOME
- The folder path to the current user's folder. - Default:
%USERPROFILE%
Reserved Placeholders
These placeholders are built into the engine automatically.
APPDIR
- The directory of the application file.-
Value:
<location of blam.exe>
-
DEF_ENGINE_VER
- Returns the engine version. -
Example:
00004.05.13.19.0001.blamite
-
DEF_ENGINE_VER_FULL
- Returns the full engine version as it is printed in non-stylized logs and theversion
command. -
Default:
core debug pc 00004.05.13.19.0001.blamite Sep 8 2019 07:39:43
-
DEF_ENGINE_VER_FULL_DS
- Same asDEF_ENGINE_VER_FULL
, but with a second space in between the month and day -
Default:
core debug pc 00004.05.13.19.0001.blamite Sep 8 2019 07:39:43
-
DEF_MOVIES_DIR
- The directory where.bik
videos are stored -
Default:
bink
-
DEF_BUILD_DATE
- The date the engine was built, using__DATE__
. -
Default:
Sep 8 2019
-
DEF_BUILD_DATE_TIME
- The date and time the engine was built, using__DATE__
and__TIME__
-
Default:
Sep 8 2019 07:39:43
-
DEF_CACHE_DIR
- The directory where.map
files are stored -
Default:
maps
-
DEF_PLATFORM
- The target platform of the engine -
Default:
pc
-
DEF_PRODUCT_ID
- The product ID of the engine's runtime -
Default:
core
-
DEF_REL_TYPE
- The release type of the engine. -
Default:
debug
-
DEF_GAME_AFFILIATES
- Any affiliated organizations of the game -
Default:
Chaotic United, Elaztek Studios
-
DEF_GAME_COPYRIGHT
- The copyright for the game -
Default:
(c) Elaztek Studios/Chaotic United 2013-2019
-
DEF_GAME_DEVELOPER
- The developer of the game -
Default:
Elaztek Studios
-
DEF_GAME_PUBLISHER
- The publisher of the game -
Default:
Elaztek Studios
-
DEF_GAME_TITLE
- The title of the game - Default:
Project: Infinity
Using Placeholders
Placeholders can be used in code by including this line in a .cpp
file:
#include "placeholders.h"
You can get a string with it's placeholders evaluated by calling Blam::Placeholders::ApplyPlaceholders()
.
Usage Example
Using the following code:
std::string original_string = "Built with Blamite version {$DEF_ENGINE_VER}";
std::string evaluated_string = Blam::Placeholders::ApplyPlaceholders(original_string);
cout << evaluated_string << endl;
Will output:
Built with Blamite version 00004.05.13.19.0001.blamite