GVM Blocks

Top  Previous  Next

Block is the base for the Global VM script. Without at least one block, the script does nothing. The Block will specify to what object the code belongs to.

 

A simple block looks like this:

 

PRE "Menu 1"
  GPRM1+=2
END

This tells us that the code inside the block is a PRE command of Menu 1

You can easily add an empty block using the Add Block Handle function (as a button or in the menu Global VM):

clip0176

This will open a dialog with all existing objects listed.

clip0177

You can then choose what block you want to create: PRE, POST or Both.
Optional feature "Grab a Script from Object..." will also get a VM command lines from the object if they exist in the Objects "A" Sequence of Custom Commands. (Note: Any Goto in VM Commands will be converted using labels)

clip0178

This will create following:

//*** PRE "Menu 1" Command Sequence ***
PRE "Menu 1"
  GPRM1 = 2
END

 

Please note: An empty block without any commands will remove all commands from that section of Object. If you don't want the object to change commands (for example previously added in VM Command editor) then simply do not create any block for the object!

Block types

There are few different type of blocks:

PRE "Object"
POST "object"
FIRSTPLAY
TITLEBUTTON

 

Each block must end with END.

 

Both PRE and POST object have the same syntax:

PRE "Object"

where the Object is the name of the object as in Project tree, for example:

PRE "Menu 1"

 

The PRE block can have two special cases:

 

PRE "NULL"

This allows for creating a dummy block - the script inside will be checked, translated to VM code, but it will be not written anywhere. This is good for just playing around or saving blocks to be used later for different objects. If you need to change particular object, just replace the NULL with the name of the object (for example Menu 1) and Build. If you don't need the block, just replace the name of the object with NULL. It is faster than commenting out and un-commenting the code.

 

PRE "VTSROOT n"
Where n is the VTS number (1...99) for example: PRE "VTSROOT 1"

This correspond to the code referred in Project as "Root". The Root is a special dummy menu (PGC1) that is inserted in front of all other menus in VTS and do some special work (like sending player to a certain menu from movie etc.)

 

clip0171

Any link from VMG menu to the VTS Root menu (this means PGC 2 here) or from a VTS movie to any VTS menu will first go through this Root (PGC 1) command.Only PRE command is applicable, because the Abstraction Layer will not run the POST command of VTSROOT.

 

FIRSTPLAY

This is a block for First Play code

 

TITLEBUTTON

This is a block for Title Button code (VMG PGC 1)