(info) Other great resources: Official JS API docs, Scripting Forum

scriptPath

The path to the main script loaded in to a particular scripting environment...

 

Syntax

scriptPath

Values

This is the path, without the filename or extension, of the main script that was loaded in to your scripting environment.

Examples:

  • for AIs, for something like "multiplay/skirmish/nullbot.js" the scriptPath would be "multiplay/skirmish/"
  • for rules.js, it will be "multiplay/skirmish/"
  • for scavfact.js, it will be "multiplay/script/"

Notes

This global is useful for dynamically loading additional scripts in the same folder, or a sub-folder, of your main script.

Example

// load foo.js from the config folder that's located alongside your main script
include(scriptPath+"config/foo.js");
Availability 3.2+

Requires:

  • Warzone 3.2 or above
Contents

Jump to:

Â