|
|
(55 intermediate revisions by 24 users not shown) |
Line 1: |
Line 1: |
| [http://nnnslogan.freehostia.com/fort-de1.htm fort de kock] [http://orel-na-vole.freehostia.com/blog/altoparlanti-autoradio/ altoparlanti autoradio] [http://rasa18.ifrance.com/grafico-azione/ grafico azione] [http://rasa18.ifrance.com/kanye-west6/ kanye west slow jams] [http://nnnslogan.freehostia.com/un-giorno26.htm un giorno di sole] [http://rasa18.ifrance.com/perry-fred/ perry fred] [http://orel-na-vole.freehostia.com/blog/video-skunk/ video skunk anansie] [http://orel-na-vole.freehostia.com/blog/affitti-liguria/ affitti liguria] [http://nnnslogan.freehostia.com/explotacion.htm explotacion] [http://rasa18.ifrance.com/un-angelo12/ un angelo legato al palo] [http://rasa18.ifrance.com/rocki/ rocki] [http://orel-na-vole.freehostia.com/blog/rz-navigator/ rz1710 navigator] [http://orel-na-vole.freehostia.com/blog/cravata/ cravata] [http://nnnslogan.freehostia.com/condizionatore-a2.htm condizionatore a pavimento] [http://naughtygirl92.ifrance.com/data/sandisk.html sandisk] [http://nnnslogan.freehostia.com/pectolite.htm pectolite] [http://rasa18.ifrance.com/kabhi-aar/ kabhi aar] [http://orel-na-vole.freehostia.com/blog/perlasca/ perlasca] [http://nnnslogan.freehostia.com/nena-feat.htm nena feat kim wild] [http://nnnslogan.freehostia.com/fotocamera-e1.htm fotocamera e custodia subacquea] [http://orel-na-vole.freehostia.com/blog/ragazza-di16/ ragazza di bube trama] [http://nnnslogan.freehostia.com/renard-alphonse.htm renard alphonse] [http://orel-na-vole.freehostia.com/blog/hp214/ hp 4500] [http://nnnslogan.freehostia.com/siemens-c12.htm siemens c345] [http://rasa18.ifrance.com/si-tratta/ si tratta dell amore di edordo bennato] [http://naughtygirl92.ifrance.com/data/rilegare-libri.html rilegare libri] [http://orel-na-vole.freehostia.com/blog/sankt-michel/ sankt michel] [http://rasa18.ifrance.com/usb-bluetooth5/ usb bluetooth] [http://rasa18.ifrance.com/profumi-uomo14/ profumi uomo chanel] [http://nnnslogan.freehostia.com/anabaena.htm anabaena] [http://nnnslogan.freehostia.com/kp-ip1.htm kp 36ip] [http://orel-na-vole.freehostia.com/blog/un-piccolo6/ un piccolo grande amore] [http://nnnslogan.freehostia.com/tweaknow-powerpack.htm tweaknow powerpack] [http://orel-na-vole.freehostia.com/blog/asics-komodo/ asics komodo] [http://rasa18.ifrance.com/le-avventure58/ le avventure di garfield 3] [http://nnnslogan.freehostia.com/crub.htm crub] [http://nnnslogan.freehostia.com/purgatorio-dante.htm purgatorio dante] [http://rasa18.ifrance.com/peugeot21/ peugeot 206 11] [http://nnnslogan.freehostia.com/rex-lavatrice4.htm rex lavatrice 1200] [http://nnnslogan.freehostia.com/fx17.htm fx5500 256] [http://rasa18.ifrance.com/un-team/ un team europeo per world of warcraft] [http://rasa18.ifrance.com/quel-ti1/ quel ti amo maledetto paolo me] [http://rasa18.ifrance.com/seagate-external/ seagate external] [http://naughtygirl92.ifrance.com/data/harbi.html harbi] [http://nnnslogan.freehostia.com/biancaneve-e2.htm biancaneve e i sette] [http://orel-na-vole.freehostia.com/blog/la-montagna5/ la montagna incantata] [http://rasa18.ifrance.com/tutti-i58/ tutti i nokia memory card] [http://nnnslogan.freehostia.com/corinna-schumacher1.htm corinna schumacher nuda] [http://nnnslogan.freehostia.com/n-gage3.htm n gage nokia] [http://nnnslogan.freehostia.com/wings-of1.htm wings of honour] [http://nnnslogan.freehostia.com/gay-wrestling.htm gay wrestling] [http://nnnslogan.freehostia.com/eminescu-mihail.htm eminescu mihail] [http://nnnslogan.freehostia.com/ascolta-senza1.htm ascolta senza parole di vasco] [http://naughtygirl92.ifrance.com/data/tosti-spa.html tosti spa] [http://nnnslogan.freehostia.com/el-pueblo5.htm el pueblo unido jamas sara vencido] [http://orel-na-vole.freehostia.com/blog/ericsson-cellulari1/ ericsson cellulari mp3] [http://naughtygirl92.ifrance.com/data/accoglienza.html accoglienza] [http://rasa18.ifrance.com/hauppauge-wintv14/ hauppauge wintv hvr] [http://naughtygirl92.ifrance.com/data/ventola-pin.html ventola 3pin] [http://rasa18.ifrance.com/il-destino5/ il destino cieco in shopenhauer] [http://naughtygirl92.ifrance.com/data/canciones-de20.html canciones de britney spears] [http://rasa18.ifrance.com/tappi-nuoto/ tappi nuoto] [http://nnnslogan.freehostia.com/zaino-giordani.htm zaino giordani] [http://naughtygirl92.ifrance.com/data/solo-scooter.html solo scooter] [http://orel-na-vole.freehostia.com/blog/curveball-pin/ curveball pin pong] [http://rasa18.ifrance.com/air-classic1/ air classic] [http://orel-na-vole.freehostia.com/blog/hedi-donia/ hedi donia] [http://nnnslogan.freehostia.com/rache-winchester.htm rache winchester] [http://orel-na-vole.freehostia.com/blog/giradischi-usati/ giradischi usati] [http://nnnslogan.freehostia.com/nokia-454.htm nokia 6630 memory card] [http://naughtygirl92.ifrance.com/data/numeri-telefono9.html numeri telefono cabine] [http://orel-na-vole.freehostia.com/blog/obsessio/ obsessio] [http://nnnslogan.freehostia.com/rimaneggiato.htm rimaneggiato] [http://nnnslogan.freehostia.com/ricoh-aficio25.htm ricoh aficio toner] [http://rasa18.ifrance.com/un-altro28/ un altro final fantasy portatile] [http://nnnslogan.freehostia.com/mandarino-botanica.htm mandarino (botanica)] [http://nnnslogan.freehostia.com/altalena-per1.htm altalena per bambini] [http://nnnslogan.freehostia.com/ferrari-it.htm ferrari it] [http://nnnslogan.freehostia.com/instant-guerlain.htm instant guerlain] [http://nnnslogan.freehostia.com/www-yaahoo.htm www yaahoo com] [http://orel-na-vole.freehostia.com/blog/matteo-setti/ matteo setti] [http://nnnslogan.freehostia.com/singolo-lenny.htm singolo lenny kravitz] [http://rasa18.ifrance.com/legnopan-srl/ legnopan srl] [http://orel-na-vole.freehostia.com/blog/www-igre1/ www igre hr] [http://naughtygirl92.ifrance.com/data/macos-x.html macos x su intel non su pc] [http://orel-na-vole.freehostia.com/blog/chiese-it/ chiese it] [http://naughtygirl92.ifrance.com/data/terratec-cinergy13.html terratec cinergy 400] [http://naughtygirl92.ifrance.com/data/biberon-primigiorni.html biberon primigiorni] [http://rasa18.ifrance.com/stylus2/ stylus 1160] [http://rasa18.ifrance.com/hotel-venezia2/ hotel venezia] [http://orel-na-vole.freehostia.com/blog/transesual/ transesual] [http://rasa18.ifrance.com/dip-it3/ dip it low] [http://rasa18.ifrance.com/cps-snc/ cps snc] [http://orel-na-vole.freehostia.com/blog/batteria-per82/ batteria per motorola v50] [http://orel-na-vole.freehostia.com/blog/universal-remote/ universal remote] [http://naughtygirl92.ifrance.com/data/digimon-.html digimon 2 top] [http://naughtygirl92.ifrance.com/data/elfie-eschke.html elfie eschke] [http://rasa18.ifrance.com/skoda-km/ skoda km zero] [http://naughtygirl92.ifrance.com/data/assorbente-salerno.html assorbente salerno] [http://orel-na-vole.freehostia.com/blog/porno-fre/ porno fre]
| | {{LanguageBar}} |
| For a description, see [[Developer_Console#Commands_and_Variables|Commands and Variables]]. | | {{src topicon}} |
| | |
| | {{stub}} |
| | |
| | '''ConVar''' is the C++ class used to create a [[console variable]] (frequently shortened to "cvar"), which is used in the [[Developer Console]]. |
| | |
| | Documentation on specific console variables can be found at [[:Category:Console variables]]. |
| | For creating a new Console Variable see this. [[Developer_Console_Control#Using_the_ConVar_class|Developer Console Control]] |
|
| |
|
| Documentation on specific console variables can be found at [[:Category:Console Variables]].
| |
| <!-- only info on console variables _in general_ should be on this page --> | | <!-- only info on console variables _in general_ should be on this page --> |
| ==Good Practices== | | |
| Commands that are wish to be saved should be marked with flag [[FCVAR_ARCHIVE]]. Any cheat ConVar defined should not be archived.
| | ConVar uses the constructor shown below: |
| [[Category:Glossary]] | | |
| | {{code|highlight=cpp|ConVar( const char *pName, const char *pDefaultValue, int flags, const char *pHelpString, bool bMin, float fMin, bool bMax, float fMax );}} |
| | |
| | The default value given as the second argument of the ConVar constructor is '''not''' the value set. To set a value, use: |
| | |
| | {{code|highlight=cpp|pName->SetValue([value])}}; |
| | |
| | == Good Practices == |
| | * Variables that you wish to be saved should be marked with flag [[FCVAR_ARCHIVE]]. These will be saved with the user bindings in <code>config.cfg</code>. Any cheat cvar should not be archived. |
| | |
| | * After whatever flags you may want to add (or 0 if you don't want any), you can set a help string. This will display when someone enters in the ConVar without any value or if they enter an invalid value. You can use {{code|\n}} to make a new line and use spaces after that to indent lines. Make your help-strings as rich and detailed as you want! |
| | |
| | * Use the flag [[FCVAR_CHEAT]] to signify a ConVar that can only be used when sv_cheats is turned on. |
| | :{{bug|Some games will ignore this flag in singleplayer.}} |
| | * Use the flag [[FCVAR_REPLICATED]] to signify a server variable which is then ''replicated'' onto clients. For example, round timers or game rules should have this flag. |
| | |
| | * For multiplayer games, use [[FCVAR_NOTIFY]] to send a message in chat whenever this variable is changed. Use this for ConVars that change game mechanics. |
| | |
| | For more tips using ConVar flags, see [[Developer Console Control#The FCVAR flags|this page]]. |
| | |
| | == Examples == |
| | The code below will define a cvar named <code>cl_test</code>: |
| | |
| | {{code|highlight=cpp|ConVar cl_test("cl_test", 0, 0, "Example ConVar");}} |
| | |
| | Whats happening here is first, we are declaring the variable to be a <code>ConVar</code>, then we are setting the name of the cvar that would be used in games console, |
| | and after that, we set the default value, then flags, and finally, the help text for the console. |
| | |
| | We can use use these cvars to initialize other variables, like if you wanted to create a integer named test you could do as so |
| | |
| | {{code|highlight=cpp|int test {{=}} cl_test.GetInt();}} |
| | |
| | You could also have it be a float, and call <code>GetFloat()</code> |
| | |
| | Finally, don't forget to include <code>convar.h</code> in your file |
| | |
| | == See also == |
| | [[Developer Console Control]] |
| | [[Category:Classes]] |
Stub
This article or section is a stub. You can help by expanding it.
ConVar is the C++ class used to create a console variable (frequently shortened to "cvar"), which is used in the Developer Console.
Documentation on specific console variables can be found at Category:Console variables.
For creating a new Console Variable see this. Developer Console Control
ConVar uses the constructor shown below:
ConVar( const char *pName, const char *pDefaultValue, int flags, const char *pHelpString, bool bMin, float fMin, bool bMax, float fMax );
The default value given as the second argument of the ConVar constructor is not the value set. To set a value, use:
pName->SetValue([value])
;
Good Practices
- Variables that you wish to be saved should be marked with flag FCVAR_ARCHIVE. These will be saved with the user bindings in
config.cfg
. Any cheat cvar should not be archived.
- After whatever flags you may want to add (or 0 if you don't want any), you can set a help string. This will display when someone enters in the ConVar without any value or if they enter an invalid value. You can use \n to make a new line and use spaces after that to indent lines. Make your help-strings as rich and detailed as you want!
- Use the flag FCVAR_CHEAT to signify a ConVar that can only be used when sv_cheats is turned on.
Bug:Some games will ignore this flag in singleplayer. [todo tested in ?]
- Use the flag FCVAR_REPLICATED to signify a server variable which is then replicated onto clients. For example, round timers or game rules should have this flag.
- For multiplayer games, use FCVAR_NOTIFY to send a message in chat whenever this variable is changed. Use this for ConVars that change game mechanics.
For more tips using ConVar flags, see this page.
Examples
The code below will define a cvar named cl_test
:
ConVar cl_test("cl_test", 0, 0, "Example ConVar");
Whats happening here is first, we are declaring the variable to be a ConVar
, then we are setting the name of the cvar that would be used in games console,
and after that, we set the default value, then flags, and finally, the help text for the console.
We can use use these cvars to initialize other variables, like if you wanted to create a integer named test you could do as so
int test = cl_test.GetInt();
You could also have it be a float, and call GetFloat()
Finally, don't forget to include convar.h
in your file
See also
Developer Console Control