Skip to content

UnitMotion

Examples

Example

<UnitMotion>
  <WalkSpeed>
    7.0
  </WalkSpeed>
  <PassabilityClass>
    default
  </PassabilityClass>
</UnitMotion>

XML Elements

The following elements can be used within this component:

UnitMotion

FormationController

Type: boolean (true or false)

Path: UnitMotion/FormationController

WalkSpeed

Basic movement speed (in meters per second).

Type: positive decimal

Path: UnitMotion/WalkSpeed

RunMultiplier

How much faster the unit goes when running (as a multiple of walk speed).

Type: positive decimal

Path: UnitMotion/RunMultiplier

InstantTurnAngle

Angle we can turn instantly. Any value greater than pi will disable turning times. Avoid zero since it stops the entity every turn.

Type: positive decimal

Path: UnitMotion/InstantTurnAngle

Acceleration

Acceleration (in meters per second^2).

Type: positive decimal

Path: UnitMotion/Acceleration

PassabilityClass

Identifies the terrain passability class (values are defined in special/pathfinder.xml).

Type: text

Path: UnitMotion/PassabilityClass

Weight

Makes this unit both push harder and harder to push. 10 is considered the base value.

Type: positive decimal

Path: UnitMotion/Weight

DisablePushing

Type: boolean (true or false)

Path: UnitMotion/DisablePushing

RELAX NG Grammar

<define name="component.UnitMotion">
  <element name="UnitMotion">
    <interleave>
      <element name="FormationController">
        <data type="boolean"/>
      </element>
      <element name="WalkSpeed">
        <ref name="positiveDecimal"/>
      </element>
      <optional>
        <element name="RunMultiplier">
          <ref name="positiveDecimal"/>
        </element>
      </optional>
      <element name="InstantTurnAngle">
        <ref name="positiveDecimal"/>
      </element>
      <element name="Acceleration">
        <ref name="positiveDecimal"/>
      </element>
      <element name="PassabilityClass"/>
      <element name="Weight">
        <ref name="positiveDecimal"/>
      </element>
      <optional>
        <element name="DisablePushing">
          <data type="boolean"/>
        </element>
      </optional>
    </interleave>
  </element>
</define>