Page tree
Skip to end of metadata
Go to start of metadata


Introduced in

Version:1.24

Description

Description:

Returns an absolute path to directory specified by the given ID.

In V1.5, the directory returned by dirtype of 1 (mission folder) is a temporary path, and always points to the same location (except for unpacked MP scenarios). For packed (exported) missions in training or networking scenarios, the path is relative, but can nevertheless be used in commands that expect an absolute path (for example, in loadBiotope).

  • Editor: C:\Users\(username)\Documents\VBS3\mpmissions\__tmpPreviewDir\__tmpPREVIEWsave.Intro\
    If the mission has a name (has been saved already), the absolute path can be retrieved using: format["%1MPmissions\%2.%3",getDirectory 0,missionName,worldName]
  • Training Scenario: missions\__cur_sp.intro\
  • Network Scenario (packed): mpmissions\__cur_mp.Intro\
  • Network Scenario (unpacked): C:\Users\(username)\Documents\VBS3\mpmissions\(missionname)\

Syntax

Syntax:getDirectory dirtype
Parameters:
  • dirtype: Number - directory type. Possible values are:
    • 0: User Directory
    • 1: Mission Directory (see note in description)
    • 2: Installation Directory
    • 3: Directory of EXE (which might be different from installation folder for Buldozer) (V1.33+)
Return Value:String - Absolute path. The returned path ends with a backslash for dirtype of 0 and 1, but not for dirtype of 2 and 3.

Examples

Examples:
_userPath = getDirectory 0
// Might return: C:\Users\SomeUser\Documents\VBS3\

Additional Information

See also: ListFiles, missionName
Multiplayer: 
Problems: 

Notes