This article's documentation is for the "GoldSrc" engine. Click here for more information.

$cd (GoldSrc): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
Line 15: Line 15:
==Example==
==Example==
{{codeblock|lang=qc|src=shell.qc|//brass shell model for GoldSrc
{{codeblock|lang=qc|src=shell.qc|//brass shell model for GoldSrc
'''$cd "."''' //use same directory as QC file
'''$cd "."''' // use same directory as QC file
[[$modelname]] "shell.mdl"
[[$modelname]] "shell.mdl"
[[$cdtexture]] "."
[[$cdtexture]] "." // look for textures in same folder as QC file
[[$body]] "Shell" "shell.smd"
[[$body]] "Shell" "shell.smd"
[[$sequence]] "idle" "shell.smd"
[[$sequence]] "idle" "shell.smd"

Revision as of 15:15, 13 August 2023

(only in GoldSrc)(not in Source(except'in Source 2004))
Used to set the current working directory for the QC script.

Icon-Important.pngImportant:(in all games since Source 2006) For Source Source, starting directory is inferred to be QC file location, with $pushd and $popd being used to change the directory instead.

Description

$cd "path/to/files/"

The default working directory will be the folder of the .qc file.

Parameters

  • The path should be a full or relative path on the file system.

Example

shell.qc
qc
//brass shell model for GoldSrc

$cd "." // use same directory as QC file $modelname "shell.mdl" $cdtexture "." // look for textures in same folder as QC file $body "Shell" "shell.smd"

$sequence "idle" "shell.smd"