Time for action – Creating config variables
To let the game know that our class needs to save config variables, first we need to let it know which file to use.
class AwesomeActor extends Actor placeable config(Game);
This tells the game that our class' config variables will be defined in the Game ini files as opposed to Engine or Input and so on.
Now, let's make a config variable.
var config int MyConfigInt;
Config vars can have parentheses to let level designers change them, but they can NOT be put in the default properties block. Doing so will give a compiler error. Instead, we define their default properties in the INI file we specified. Since we used
Game
, we would put the default inDefaultGame.ini
. Let's open that up now.In
DefaultGame.ini
we can see a bunch of different sections, starting with a line surrounded by brackets. The inside of these brackets specifies the package and class that the section is defining defaults for, like this:[Package.Class]
In our case our package name...