Sign in to follow this  
Followers 0
atrX

Dvars

1 post in this topic

Server Dvars

Server dvars (or host dvars) are a kind of variable accessible through console (though, cheat protected). You can both modify and request the value of a server dvar through script.

 

Saved Dvars

Saved dvars are saved in the save game and are reset to default on level change. Saved dvar functions only work on dvars that have the 'SAVED' parameter set.

 

Client Dvars

Client dvars are, as the name suggest, client side dvars. Using GSC, these can only be adjusted, not retrieved. There is however a few workarounds which I might cover in later tutorials. Client dvars are always accessible through CSC (clientscript), which, again, might be covered later on in another tutorial.

 

Functions

getDvar( <dvar> );

Usage: Get the value of a dvar as a string. This can only fetch server/host dvars, not client dvars. Client dvars can be fetched through clientscript using getDvar().

 

Arguments:

<dvar>: The dvar name as a string.

 

Example:

Please login or register to see this code.

 

setDvar<dvar>, <value> );

Usage: Set the value of a dvar. If the 'development' dvar is set then any dvar can be set, otherwise only external dvars (dvars that are not set through code) can be set. This will only work for server dvars.

 

Arguments:

<dvar>: The dvar name as a string.
<value>: The new dvar value.
 

Example:

Please login or register to see this code.

 

getDvarInt<dvar> );

Usage: Gets the value of a dvar as an integer.

 

Arguments:

<dvar>: The dvar name as a string.

 

Example:

Please login or register to see this code.

 

getDvarFloat<dvar> );

Usage: Gets the value of a dvar as a float.

 

Arguments:

<dvar>: The dvar name as a string.

 

Example:

Please login or register to see this code.

 

setSavedDvar<dvar>, <value> );

Usage: Sets the value of a dvar. Saved dvars are saved in the save game and are reset to default on level change. Only works on dvars that have the 'SAVED' parameter set.

 

Arguments:

<dvar>: The dvar name as a string.

<value>: The new dvar value.

 

Example:

Please login or register to see this code.

 

setClientDvar<dvar>, <value> );

Usage: Sets the value of a client dvar.

 

Arguments:

<dvar>: The dvar name as a string.

<value>: The new dvar value.

 

Example:

Please login or register to see this code.

 

setClientDvars<dvar>, <value>, <dvar>, <value>, ... );

Usage: Sets the value of a list of client dvars.

 

Arguments:

<dvar>: The dvar name as a string.

<value>: The new dvar value.

Note: You can have as many of these as you'd like.

 

Example:

Please login or register to see this code.
1 person likes this

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0