GetCVarString

From ZDoom Wiki
Jump to: navigation, search


Error.gif
Warning: This feature has at least one use case where the outcome is indeterminate. This feature can break demo and multiplayer sync if an indeterminate result is used to modify the playsim (anything that uses the random number generator, modify level geometry, spawn obstacles, monsters, or powerups, and so on). Usage of the feature in conjunction with non-playsim related features, such as displaying a HudMessage, is safe.

Using non-playsim CVARs such as screenblocks or invertmouse will cause indeterminate behavior. Using Server or User variables, either internal or defined via CVARINFO, is however perfectly safe.

string GetCVarString (str cvar)

Usage

Returns the value of a particular cvar.

Parameters

Return value

(Verification needed)

The value of the specified console variable. For numerical values, see GetCVar instead. Also note that you can create your own console variables by using the CVARINFO lump.

If the console variable is a user CVAR, it will check the activator of the script. To check the user CVAR of a specific player, you can use GetUserCVarString.

If no such console variable exists, it will return an empty string.

Examples

Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contibutions are greatly appreciated.


See also

Console variable functions
GetCVar SetCVar
GetCVarString SetCVarString
GetUserCVar SetUserCVar
GetUserCVarString SetCVarString
CVARINFO