Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

API C_CVar.SetCVar

From Wowpedia
Jump to: navigation, search

Sets a console variable.

success = C_CVar.SetCVar("name" [, value, "scriptCVar"])

Arguments

name 
string - name of the CVar.
value 
string (optional) - the new value of the CVar. If omitted, defaults to "0".
scriptCVar 
string (optional) - if passed, fires the CVAR_UPDATE event with this as the first parameter.

Returns

success 
boolean - whether the CVar was successfully set.

Details

  • Settings that are changed using this will be applied to the game UI immediately, however settings are not saved to Config.wtf until properly logging out or reloading the game.
  • Some options require a reload/relog before they take effect.
  • Character and Account specific variables are stored server-side depending on synchronizeConfig
    Character - Character-specific variables can be found in \World of Warcraft\_retail_\WTF\Account\<AccountName>\<Server>\<Character>\config-cache.wtf
    Account - WoW account-wide variables can be found in \World of Warcraft\_retail_\WTF\Account\<AccountName>\config-cache.wtf
    Other variables are game-wide and can be found in \World of Warcraft\_retail_\WTF\Config.wtf

Patch changes

  • Battle for Azeroth Patch 8.1.5 (2019-03-12): Moved to C_CVar. The previous alias SetCVar is still available as a slightly sanitized script wrapper. [1]
  • WoW Icon update.png Patch 1.1.0 (2004-11-07): Added.

See also