Overview

Top  Previous  Next

After you start creating advanced interactive projects that involves large amount of scripting, you may ask if there is a better way to enter all that script into the objects.

Yes, there is. It is called Global VM.

There is a reason that this topic comes after VM commands. While Global VM is a higher, more comfortable level of VM scripting, in order to see how all this fit into the place it is important that you already know how a normal VM script is created and how it relate to the object (Menu, Movie...).

 

When we previously used VM Commands, we had to open each object and then place the command sequence inside them. This is a more visual approach, good for small amount of code.

 
Global VM uses a programmers approach. In Global VM there is no separate script place for different objects. There is only one Global VM script that can (and will) have blocks of a code related to these different objects. You can easily save the script as a single text file and use it in different projects or share it with other people.

 

A Global VM script window can be opened simultaneously with other windows while you are working on the project.

 

Here is a simplified relationship between the VM Commands and the Global VM

 

clip0169

After the Global VM script is Build, it creates VM code and injects it into the Objects. This can be verified later by opening VM Commands of the object.

 

Some basic rules

 

Global VM doesn't necessary have to change code for all the objects. You will specify code blocks only of objects you want to modify. The rest will remain unchanged.
The Global VM script is not build automatically with the compilation - you have to Build it at least once and also each time you made changes to it. However, building Global VM is nothing more than just pressing Build button and then checking if it builds without errors or not.
You can use VM Commands editing with Global VM at the same time, but you have to remember that Global VM it has priority over the code entered directly in VM Commands. Each time you Build Global VM, any manually entered code in the specified blocks will be overwritten.
Global VM script can add its code only before the Abstraction Layer Code. This is illustrated by the following image:

clip0170

The reason for this become quite obvious later when you check the VM code generated by the Global VM.