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
m (SirYodaJedi moved page $cd to $cd (GoldSrc) without leaving a redirect)
No edit summary
Line 1: Line 1:
{{gldsrc topicon}}
{{gldsrc topicon}}
{{tabsBar|main=gs|base=$cd}}
{{tabsBar|main=gs|base=$cd}}
{{gldsrc|only}}{{src|not|addtext={{src04|in|addtext-front=''except''}}}}<br> Used to set the current working directory for the QC script.
{{gldsrc|only}}<br> Used to set the current working directory for the QC script.
 
{{modernImportant|{{src06|since}} For {{src|4.1}}, starting directory is inferred to be QC file location, with [[$pushd]] and [[$popd]] being used to change the directory instead.}}


==Description==
==Description==
  $cd "path/to/files/"
  $cd "path/to/files/"
The default working directory will be the folder of the .qc file.


==Parameters==
==Parameters==
* The path should be a full or relative path on the file system.
* The path should be a full or relative path on the file system. For the path where the QC script is, use {{code|"."}}


==Example==
==Example==

Revision as of 17:29, 3 April 2025

(only in GoldSrc)
Used to set the current working directory for the QC script.

Description

$cd "path/to/files/"

Parameters

  • The path should be a full or relative path on the file system. For the path where the QC script is, use "."

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"

$sequence "idle" "shell"