This article's documentation is for anything that uses the Source engine. Click here for more information.

$include: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(5 intermediate revisions by 5 users not shown)
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.
{{tabsBar|main=gs|base=$include}}
* [[MDL]] files can also be included by using the [[$includemodel]] command.
{{this is a|QC command|name=$include}} It's 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.


==QC syntax example 1==
{{note|The new QC is always loaded relative to the current QC's directory - it is '''not''' affected by [[$pushd]] or [[$cd]]!}}
* 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]].}}


[[Category:QC Commands|I]]
== Example ==
 
When the included file is in the same folder as the current one:
 
$include "ragdoll.qci"

Latest revision as of 21:12, 18 July 2025

$include is a QC command available in all Source Source games. It's 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 - it is not affected by $pushd or $cd!
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"