Game Configs

The Untold Engine currently supports the Gravity Scripting Language for game configuration only. i.e., tweaking game objects parameters for gameplay.

As of today, it does not have full support, as in, the ability to create a whole game using only Gravity. That feature will come soon.

To tweak a game object parameter, you must do the following:

  1. Call an instance of the U4DGameConfig class.

  2. Set the configuration keys

  3. Load the configuration map values.

Here is an example:

//1. Call an instance of the U4DGameConfig class
U4DEngine::U4DGameConfigs *gameConfigs=U4DEngine::U4DGameConfigs::sharedInstance();

//2. set the configuration keys
gameConfigs->initConfigsMapKeys("config0","config1","config2",nullptr);

//3. load the configuration values by providing the path to the gravity file containing the data.
gameConfigs->loadConfigsMapValues("gameconfigs.gravity");

You must provide a path to the gravity file containing the values for each key specified. In the above example, the "gameconfigs.gravity" should look like this:

//You must declared an init function
func init(){

var scaleValue=1.17

//mapping of values and keys
var names = ["config0":32.0/scaleValue,
            "config1":0.05,
            "config2":40.0/scaleValue];

return names
}

Note, that you are required to have an init() function.

Last updated