$definevariable: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
($definevariable)
 
No edit summary
Line 1: Line 1:
Creates a named string variable. This is tiny subset version of [[$definemacro]] that only defines a string substitution that can be in other QC commands.
'''$definevariable''' is a QC command that creates a [[variable]]. The variable's name, if surrounded by <code>$</code>s, will be substituted by its value whenever encountered.


== Syntax ==
{{note|Variables do not work within "quote blocks"!}}


$definevariable (variablename) (string)
This command is a 'lite' version of [[$definemacro]].


== Examples ==
== Example ==


$definevariable baseFile "fighter1"
<source lang=php highlight=1>
$definevariable baseFile "fighter1"
$sequence attack $baseFile$_Attack
 
$sequence run $baseFile$_Run
$sequence attack $baseFile$_Attack
$sequence idle $baseFile$_Idle
$sequence run $baseFile$_Run
$sequence idle $baseFile$_Idle
</source>


[[Category:QC Commands|definevariable]]__NOTOC__
[[Category:QC Commands|definevariable]]__NOTOC__

Revision as of 08:13, 1 March 2011

$definevariable is a QC command that creates a variable. The variable's name, if surrounded by $s, will be substituted by its value whenever encountered.

Note.pngNote:Variables do not work within "quote blocks"!

This command is a 'lite' version of $definemacro.

Example

$definevariable baseFile "fighter1"

$sequence attack $baseFile$_Attack
$sequence run $baseFile$_Run
$sequence idle $baseFile$_Idle