The console
Although not directly linked to debugging, the CryENGINE console provides the means for creating commands that can execute functions directly from the game, and the creation of variables that can be modified to change the way the world behaves.
Note
Fun fact: by using the hashtag (#
) sign in the console, we can execute Lua directly in-game, for example, #System.Log("My message!");
Console variables
Console variables, commonly referred to as CVars, allow the exposure of variables in your code to the CryENGINE console, effectively allowing the tweaking of settings at runtime or through config (.cfg
) files.
Pretty much every subsystem uses console variables at runtime in order to tweak the behaviour of systems without requiring code modifications.
Registering a CVar
When registering a new CVar, it's important to distinguish between by-reference variables and wrapped variables.
The difference is that a by-reference CVar points to a variable defined in your own code that updated...