Virtual Machine 

DarkMachine Engine's Virtual Machine loads and executes scripts. Scripts are loaded with DarkMachine commands:

BlitzScriptLoad(filename$)
BlitzScriptExec(filename$)
Note: Filename extensions are omitted when using these commands.

When scripts are loaded, the VM will check for the pcode (*.dmo) version of the script first. If the *.dmo is found, it loads it, otherwise it will search for *.dm or *.dmc version of the file to compile it. The *.dm version of the file is converted to *.dmc by the Preprocessor for compilation. The Compiler compiles the *.dmc into *.dmo. If no *.dm or *bsc version of the file is found the compiler will error with no file found. This loading behavior is useful for increased loading speed and allows you to remove *.dm and *.dmc after compilation if you do not desire the scripts to be visible.

The VM is updated within the main application loop with the engines dmcvm_ThreadUpdate() Function. Each script is processed one at a time. The behavior of script updates can be controlled in a variety of ways.