Master-Slave

A Master-Slave Behavior (beMasterSlave) binds a slave entity position and/or orientation to a master entity bone, with optional offsets. It must be placed on Slave EntityType, and reference its master. The master-slave binding is done on a one-to-one basis, for each entity of those types.
 
A beMasterSlave Behavior in the Behavior Editor
 
Note that this behavior depends on EntityType / Advanced Attributes / Master-Slave Level. In order to bind a slave entity to a master, one must ensure that the master is updated first. See EntityType
 
Note that Master-Slave relations can only be achieved into the same CrowdField.

Creation

  • Behavior Editor / Behavior Library: 
  • Golaem Menu: Crowd Behaviors / Behaviors / CrowdBeMasterSlave Node
  • MEL command: glmCrowdBeMasterSlaveCmd;

Configuration

A MasterSlave Behavior defines the following specific attributes. For common attributes see Behavior Common Attributes.

Assignment Attributes


 
Assignment Mode

Closest Entity: The entity will find the closest entity/bone matching the configured criterions. This is useful to put passengers in a car for example. Note that closest entity is searched first, from the root position. Thus, it may occur that another entity have a bone closer to the target, but the root further. In that case, the closest root is selected first, and the closest bone of this entity in a second time.

Colliding Entity: The entity will find the first entity / bone matching the configured criterions, and keep the same offset as when the behavior starts. This is useful to stick arrows in shields for example. In this mode, it is expected that a start trigger detects a collision before starting this behavior, or it may just fail if there is no collision at start time (the behavior will not wait for collision, but will exit or fail if no collision is found at first call). The entity will keep its relative position and orientation, to the hit bone/entity, until the behavior stops.

Master Idx <-> Slave Idx: The entity will be slaved to a given entityType / bone name with an optional offset in bone local position / orientation. Matching is made per entity of same index (with modulo) : first entity of this type will be slaved to first entity of the configured type.

In Master EntityTypes

Specify which Entity Types will be used as master Entity Type

Master Bone Names

The given names must be valid bone names of the selected Entiy Type (click helper to pick them)

Collider Bone Names Same as above but helper will only show Physicallized bones of the Character File

Offset Attributes

Offset attributes are only available if the Assignment Mode is set to Closest Entity or Master Idx <-> Slave Idx modes

Master Offset Mode

Automatic: The entity will keep its relative position and orientation when the behavior starts until the behavior stops.

Manual: Offset will be defined by the parameters below

Orientation Mode

Specify how the slave entity orientation must be constrained to the master bone orientation.

 Aim At XYZ

If the Orientation Mode is set to Aim At, specifies if the slave entity orientation must be aiming at the master bone position for the XYZ components.

Orientation Offset

Adds an offset to the master bone orientation, in master bone referential, before applying it to the slave.

Constraint Position XYZ

Specify if the slave entity position must be constrained to the master bone position in the XYZ components.

Position Offset

When non null, this offset will be applied in Master bone referential, in addition to the Master bone position, before applying it to the slave.

Scale Position Offset

When using position offset, it may be suitable, or not, to scale it according to master scale.