A Controller Definition contains the setup of a mannequin character.
It refers to the Tag Definition File (xxxTags.xml) and FragmentID Definition File (xxxActions.xml) used by this character. It is typically referred to by the game entity, as the file is needed by the entity to create a Mannequin ActionController. See the overview picture in the Mannequin Files document.
Creating a Controller Definition
You create a controller definition manually. See the File Format section.
Editing a Controller Definition
The scopemasks and related flags can be edited in the Mannequin FragmentID Editor.
All the rest has to be edited manually in the xml file. See the File Format section.
This is an example Controller Definition File:
The Tags element contains a reference to the Tag Definition File (xxxTags.xml) used by this setup.
The Fragments element contains a reference to the FragmentID Definition File (xxxActions.xml) used by this setup.
The SubContexts element lists all the different Mannequin SubContexts available for this controller definition.
The FragmentDefs element has to contain exactly one entry for each fragmentID specified in the FragmentID Definition. Typically editing of these elements is done automatically by the editor.
For each of the fragmentIDs:
- scopes attribute: defines the ScopeMasks for this fragmentID.
- flags attribute: optionally provides flags in the Flags attribute. If more than one flag is set, separate them by a "+" character. Supported flags:
Forces the action that requested this fragmentID to keep playing, even when the fragment that is playing is not looping and has ended.
Constantly checks whether there is a fragment available that matches the current Mannequin TagState.
If so, the system will push the new, better matching fragment for you. Useful for basic 'idling' actions. Typically used together with the "Persistent" flag.
- Override element: overrides the scopemask for this fragmentID when certain tags (and fragtags) are matched. In the example, when the fragmentID "burst_fire" is requested, normally the scopemask would be "Torso+Weapon". But if the global tag "heavyMortar" and fragtag "boosted" is set at that time, the scopemask "Torso" is used instead.
The ScopeDefs elements defines the scopes as well as the scope contexts used by this setup. Each element inside the ScopeDefs element defines a scope. The element name is the scope name. Each scope has the following attributes:
The index of the first layer in the animation system this scope is bound to.
Careful: When picking a layer, make sure it doesn't clash with the layer being in use by the Pseudo Lip-Sync feature. Mannequin and Pseudo LipSync don't know about each other and therefore can't detect when one uses a layer that is already in use by the other!
The number of animation layers this scope is bound to. A scope is bound to the animation layers with indices "layer" up to "layer+numLayers-1".
The name of the scope context used by this scope.
An optional tag, sometimes called the 'scope tag'. If set, it will be a tag that is required for fragments playing on this scope.
In the above example, it is possible to have different fragments playing on the FullBody and Face scope. If you start an action on "FullBody+Face", the system will select two different fragments.