Legacy:EvaluateScript

The EvaluateScript(filename) command will execute the code in the file called "filename" in the scripts directory of the current game. Common usage is to separate code into multiple files, making it easier for the programmer to go through the game's code.

Examples

Notes

As said, the main usage of the EvaluateScript command is to be able to separate the game's code into multiple files, making it easier to find particular bits of code. As such, the files being evaluated by this command usually contains definitions of functions, objects, etc. such as

Caution

Both the EvaluateScript() and eval() commands take considerable computer resources to execute, and as such, should only be used for loading or running commands that are not used multiple times a second. This for example, will run very slow, and consume a lot of memory: