Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
themeEclipse
languagejavascript
linenumberstrue
var returnValue = include("path/filename.js");

Parameters

ParameterTypeMandatoryDescriptionGame verison
"path/filename"String(tick)

The name of the file to include.(question) If it's in a different folder, include the relative path?path to the file that should be included.

The path starts at your mod folder.

For example, if you're writing an AI script and want to include a "whatever.js" script that's stored in the same folder as your AI script, you'd specify:

include("multiplay/skirmish/whatever.js");

Even though whatever.js is in the same folder as your AI script, you still need to specify the path to it!

3.1 Beta 1

Return value

In version 3.1 Beta 2 and earlier, this function would return undefined if the file was successfully loaded, however undefined is treated as false in an if statement, and false is the return value used to indicate the file failing to load!

...