$declaresequence: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Formatting)
(added info about sequence order and added "sequence name" to the example for further explanation of how the line works.)
Line 3: Line 3:
This is useful when you want to add other sequences as layers that aren't locally declared, such as when they're actually part of an external .mdl file (see [[$includemodel]]). $declaresequence makes a empty sequence entry so that the local sequence pointers can get set, and at run time these references are overwritten with the actual sequence index.
This is useful when you want to add other sequences as layers that aren't locally declared, such as when they're actually part of an external .mdl file (see [[$includemodel]]). $declaresequence makes a empty sequence entry so that the local sequence pointers can get set, and at run time these references are overwritten with the actual sequence index.


In simple man's terms: $declaresequence can be used to tell the compiler that the declared sequences are to be taken from the [[$includemodel]], but the ones not declared will be taken from the current compile. Useful to prevent sequence index mismatches if modding for multiplayer.
In simple man's terms: $declaresequence can be used to tell the compiler that the declared sequences are to be taken from the [[$includemodel]], but the ones not declared will be taken from the current compile. Useful to prevent sequence index mismatches if modding for multiplayer.<br>
Declared sequences will be compiled in the order the $declaresequence lines appear, not in the order of the original $includemodel file.


== Syntax ==
== Syntax ==
<syntaxhighlight lang=php highlight=4>
<syntaxhighlight lang=php highlight=4>
$declaresequence (name)
$declaresequence (sequence name)
</syntaxhighlight>
</syntaxhighlight>
[[Category:QC Commands|declaresequence]]
[[Category:QC Commands|declaresequence]]

Revision as of 14:36, 18 October 2018

The QC command $declaresequence forward declares a sequence.

This is useful when you want to add other sequences as layers that aren't locally declared, such as when they're actually part of an external .mdl file (see $includemodel). $declaresequence makes a empty sequence entry so that the local sequence pointers can get set, and at run time these references are overwritten with the actual sequence index.

In simple man's terms: $declaresequence can be used to tell the compiler that the declared sequences are to be taken from the $includemodel, but the ones not declared will be taken from the current compile. Useful to prevent sequence index mismatches if modding for multiplayer.
Declared sequences will be compiled in the order the $declaresequence lines appear, not in the order of the original $includemodel file.

Syntax

 $declaresequence (sequence name)