Unreal Console Variables - CVars : how create; set console, command line, or ini file - UE C++

preview_player
Показать описание
Console variables ( cvars ) allow you to type into the console to affect the game.
You can enable or disable features via console variables.
You can change levels of a feature via console variables.
It just depends on how you use them.
There are "reference" versions of console variables, that allow you to hook up a console variable to a persistent variable.
There is also a templated TAutoConsoleVariable that defines the variable for you, but you have to query it via special functions like GetValueOnGameThread().
You can set console variables from the command line ( cmd line).
Console variables can be set from ini files, letting non programmers change the default values of console variables.
Or having platform specific ini files define different behavior for their given platform.
For testing you can also specify the console variable via command line, which will replace the default value for the console varaible.
Console variables are ubiquitous in the engine, understanding them is a valuables skill in working with the Unreal Engine.

additions:

0:00 Writing a console variable in code with FAutoConsoleVaraibleRef
1:10 Reading simple console variables
1:32 console variables can bet set from command line and from ini config files
1:46 Debug testing a reading a cvar (console variable)
2:28 Getting notified when a cvar changes ; subscribing to OnChangedDelegate
3:05 Debug testing callback for when a cvar (console variable) value changes
3:37 How to set cvars (console variables) from ini config files
4:59 How to set cvars (console variables) from the command line
6:06 How blueprints can read your code defined console variables
6:36 Unreal Official Console Variable Documentation
6:49 TAutoConsoleVariable vs FAutoConsoleVariableRef
7:08 GetValueOnGameThread explained (see also GetValueOnRenderThread GetValueOnAnyThread)
Рекомендации по теме
Комментарии
Автор

I found the information I was looking for in this video !

l_t_m_f
Автор

Hey, which ini files are eligible for setting console variable? Also can we set console variable from ini file in packaged build?

rohitsutreja
visit shbcf.ru