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
m (clean up)
m (Making use of the "this is a" template for the first line here, and removed todo - this command is specifically not affected by any other directory-altering commands.)
Line 1: Line 1:
The '''$include''' [[QC command]] 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.
{{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.


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


{{tip|Compiled [[MDL]] files can also be included with [[$includemodel]].}}
{{tip|Compiled [[MDL]] files can also be included with [[$includemodel]].}}

Revision as of 13:45, 14 July 2024

$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"