$include: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
The [[$include]] [[QC command]] is used to include the contents of an external .qc, or .qci file as though they were part of the parent file.
The [[$include]] command is used to insert the contents of another <code>.qc</code> (or <code>.qci</code>, for clarity) file as though they were part of the parent file.
* [[MDL]] files can also be included by using the [[$includemodel]] command.


==QC syntax example 1==
{{note|The new QC is always loaded relative to the current QC's directory ({{todo|or is it the root's?}}) - it is '''not''' affected by [[$pushd]]!}}
* If another model uses a very similar skeleton to the one you're compiling, simply copy its <code>ragdoll.qc</code> to your model’s folder.
* Otherwise, copy <code>$hl2/models/ragdoll.qc</code> to your model’s folder.
* Then, at the end of your model’s .QC file, add :
[[$include]]     "ragdoll.qc".


{{tip|Compiled [[MDL]] files can also be included with [[$includemodel]].}}
== Example ==
When the included file is in the same folder as the current one:
[[$include]] "ragdoll.qci"


[[Category:QC Commands|I]]
[[Category:QC Commands|I]]

Revision as of 05:59, 2 August 2010

The $include command is used to insert the contents of another .qc (or .qci, for clarity) file as though they were part of the parent file.

Note.pngNote:The new QC is always loaded relative to the current QC's directory (
Todo: or is it the root's?
) - it is not affected by $pushd!
Tip.pngTip:Compiled MDL files can also be included with $includemodel.

Example

When the included file is in the same folder as the current one:

$include "ragdoll.qci"