INTERACTION XML PROPERTIES

The service interaction XML file is used in conjunction with the The Navigation Graph and the Navigation Services XML Properties to generate interactions between SimObjects. At it's most basic, an interaction will be comprised of three things:

  • A SimObject, which can be an aircraft, or some other object that has been spawned as part of a Navigation Service.
  • A Navigation Graph, which defines the paths and nodes the SimObject(s) will use for moving and interacting.
  • One or more interaction XML files, which is where the objects to interact are defined.

Note that you may define multiple XML files for an interaction, and they would all go into the interactions folder which should have been added at the root for the aircraft or SimObject (ie: beside the aircraft.cfg file or sim.cfg file). Which file is used will normally depend on the navigation FSM (as explained on the page discussing Navigation Services), but all of them will be loaded into the interaction manager, whether they are used or not. The exception to that is if the object has no navigation graph CFG file, in which case no interaction files will be loaded into the manager.

 

This file is formatted using XML and can be edited by using any text editor. The general format for the file is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<SimBase.Document>
    <WorldBase.Flight>
        <!-- Define Interactions -->
        <ServiceInteraction.Interaction InteractionName="NAME" id="ID" InstanceId="{GUID}">
            <!-- Add Actions To Interaction -->
            <Action>
                <ObjectReference id="ID" InstanceId="{GUID}"/>
                <!-- Further Action Objects Here-->
            </Action>
        </ServiceInteraction.Interaction>
        <!-- Define Finished Action -->
        <ServiceInteraction.Finished id="ID" InstanceId="{GUID}">
            <ObjectReference id="ID" InstanceId="{GUID}"/>
        </ServiceInteraction.Finished>
        <!-- Define Target Container -->
        <ServiceInteraction.TargetContainer InstanceId="{GUID}">
            <TargetId>name_here</TargetId>
            <ObjectReference id="ID" InstanceId="{GUID}"/>
        </ServiceInteraction.TargetContainer>
        <!-- Define Action Animations -->
        <SimMission.PlayBlendTreeStateAction id="ID" InstanceId="{GUID}">
            <!-- Animation Elements Here -->
        </SimMission.PlayBlendTreeStateAction>
    </WorldBase.Flight>
</SimBase.Document>

 

 

<SimBase.Document>

This is the main parent element that is used to contain the interaction data. It requires the following sub-element:

  1. <WorldBase.Flight>

 

 

<WorldBase.Flight>

This is the main container element for all other interaction elements in this file. This element has the following attribute:

 

Attribute Description Type Required
InstanceId The unique ID for the interaction file, as a GUID enclosed in {}. You can find more information on GUID's here: GUIDs String No

 

 

<ServiceInteraction.Interaction>

This child element of <WorldBase.Flight> is the main element for defining a single interaction that will be performed, usually by a navigation service. Interactions can be made up of more than one action object which will be performed in the order their objects are listed in the <Action> element.

IMPORTANT! If you use this element then you must provide an accompanying <ServiceInteraction.Finished> element, and an action object reference to this element.

 

This element can have the following sub-elements:

  1. <Descr> - Optional description which can be supplied as part of the XML to help identify elements.
  2. <Action> - Container element for one or more action object references.

 

This element also has the following attributes:

 

Attribute Description Type Required
InteractionName This is the common name of the interaction. It is required if the interaction is being called by a Navigation Service. If the interaction is not part of a navigation service then this attribute can be omitted. String Yes
id The ID string that can used to identify the interaction. String Yes
InstanceId The unique ID for the interaction, as a GUID enclosed in {}. You can find more information on GUID's here: GUIDs String Yes
CanBeDoneRemotely When this is set to "TRUE", the interaction can be performed at any point on the associated navigation graph. Boolean No

 

 

<Action>

This is a sub-element of <ServiceInteraction.Interaction> and is used to define the actions that should be performed as part of the interaction when it is called. It can have one or more <ObjectReference /> elements, which are used to add in action objects to be performed, and actions will be performed in sequence as listed in the container.

NOTE: The last one in the container must be a reference to the <ServiceInteraction.Finished> to flag the interaction as complete to the interaction manager and navigation service (if one is being used).

 

This element can have the following sub-elements:

  1. <Descr> - Optional description which can be supplied as part of the XML to help identify elements.
  2. <ObjectReference /> - An action object reference id.

 

This element also has the following attributes:

 

Attribute Description Type Required
id The ID string that can used to identify the interaction element. String Yes
InstanceId The unique ID for the interaction, as a GUID enclosed in {}. You can find more information on GUID's here: GUIDs String Yes

 

 

<ServiceInteraction.InteractionVolume>

This child element of <WorldBase.Flight> is used to define interactions that should happen when the interaction object enters or leaves the volume defined for the associated navigation graph node. Interactions can be made up of more than one action object which will be performed in the order their objects are listed in the <OnEnterAction> and/or <OnExitAction> elements. Note that regardless of the whether you include one, the other, or both the enter/exit elements, you must supply a reference to the <ServiceInteraction.Finished> element as the last action object reference. This will flag the interaction as complete to the interaction manager and the navigation service (if one is being used).

IMPORTANT! If you use this element then you must provide an accompanying <ServiceInteraction.Finished> element, and an action object reference to this element.

 

This element can have the following sub-elements:

  1. <Descr> - Optional description which can be supplied as part of the XML to help identify elements.
  2. <OnEnterAction> - Container element for one or more action object references. Actions will be performed on entering the node volume.
  3. <OnExitAction> - Container element for one or more action object references. Actions will be performed on exiting the node volume.

 

This element also has the following attributes:

 

Attribute Description Type Required
id The ID string that can used to identify the interaction. String Yes
InstanceId The unique ID for the interaction, as a GUID enclosed in {}. You can find more information on GUID's here: GUIDs String Yes
CanBeDoneRemotely When this is set to "TRUE", the interaction can be performed at any point on the associated navigation graph. Boolean No

 

 

<OnEnterAction>

This is a sub-element of <ServiceInteraction.InteractionVolume> and is used to define the actions that should be performed as part of the interaction when the interaction object enters into the interaction volume of the navigation node. It can have one or more <ObjectReference /> elements, which is used to add in action objects to be performed, and actions will be performed in sequence as listed in the container.

NOTE: If you do not also have an <OnExitAction> element, then you must supply a reference to the <ServiceInteraction.Finished> element as the last action object reference. This will flag the interaction as complete to the interaction manager and the navigation service (if one is being used).

 

This element can have the following sub-elements:

  1. <Descr> - Optional description which can be supplied as part of the XML to help identify elements.
  2. <ObjectReference /> - An action object reference id.

 

This element also has the following attributes:

 

Attribute Description Type Required
id The ID string that can used to identify the interaction element. String Yes
InstanceId The unique ID for the interaction, as a GUID enclosed in {}. You can find more information on GUID's here: GUIDs String Yes

 

 

<OnExitAction>

This is a sub-element of <ServiceInteraction.InteractionState> and is used to define the actions that should be performed as part of the interaction on the first frame of the interaction after the object enter into the interaction state. It can have one or more <ObjectReference /> elements, which is used to add in action objects to be performed, and actions will be performed in sequence as listed in the container.

NOTE: You must supply a reference to the <ServiceInteraction.Finished> element as the last action object reference. This will flag the interaction as complete to the interaction manager and the navigation service (if one is being used).

 

This element can have the following sub-elements:

  1. <Descr> - Optional description which can be supplied as part of the XML to help identify elements.
  2. <ObjectReference /> - An action object reference id.

 

This element also has the following attributes:

 

Attribute Description Type Required
id The ID string that can used to identify the interaction element. String Yes
InstanceId The unique ID for the interaction, as a GUID enclosed in {}. You can find more information on GUID's here: GUIDs String Yes

 

 

<ServiceInteraction.InteractionState>

This child element of <WorldBase.Flight> is used to define interactions that should happen when the interaction object enters or leaves the interaction state. The actions performed are made up of one or more action objects which will be performed in the order their objects are listed in the <FirstFrameAction> and/or <LastFrameAction> elements.

IMPORTANT! If you use this element then you must provide an accompanying <ServiceInteraction.Finished> element, and an action object reference to this element.

 

This element can have the following sub-elements:

  1. <Descr> - Optional description which can be supplied as part of the XML to help identify elements.
  2. <FirstFrameAction> - Container element for one or more action object references to be performed on the first frame of the interaction.
  3. <LastFrameAction> - Container element for one or more action object references to be performed on the last frame of the interaction.

 

This element also has the following attributes:

 

Attribute Description Type Required
id The ID string that can used to identify the interaction. String Yes
InstanceId The unique ID for the interaction, as a GUID enclosed in {}. You can find more information on GUID's here: GUIDs String Yes
CanBeDoneRemotely When this is set to "TRUE", the interaction can be performed at any point on the associated navigation graph. Boolean No

 

 

<FirstFrameAction>

This is a sub-element of <ServiceInteraction.InteractionState> and is used to define the actions that should be performed as part of the interaction on the first frame of the interaction after the object enter into the interaction state. It can have one or more <ObjectReference /> elements, which is used to add in action objects to be performed, and actions will be performed in sequence as listed in the container.

NOTE: If you do not also have a <LastFrameAction> element, then you must supply a reference to the <ServiceInteraction.Finished> element as the last action object reference. This will flag the interaction as complete to the interaction manager and the navigation service (if one is being used).

 

This element can have the following sub-elements:

  1. <Descr> - Optional description which can be supplied as part of the XML to help identify elements.
  2. <ObjectReference /> - An action object reference id.

 

This element also has the following attributes:

 

Attribute Description Type Required
id The ID string that can used to identify the interaction element. String Yes
InstanceId The unique ID for the interaction, as a GUID enclosed in {}. You can find more information on GUID's here: GUIDs String Yes

 

 

<LastFrameAction>

This is a sub-element of <ServiceInteraction.InteractionState> and is used to define the actions that should be performed as part of the interaction on the last frame of the interaction before the object leaves the interaction state. It can have one or more <ObjectReference /> elements, which is used to add in action objects to be performed, and actions will be performed in sequence as listed in the container.

NOTE: You must supply a reference to the <ServiceInteraction.Finished> element as the last action object reference. This will flag the interaction as complete to the interaction manager and the navigation service (if one is being used).

This element can have the following sub-elements:

  1. <Descr> - Optional description which can be supplied as part of the XML to help identify elements.
  2. <ObjectReference /> - An action object reference id.

 

This element also has the following attributes:

 

Attribute Description Type Required
id The ID string that can used to identify the interaction element. String Yes
InstanceId The unique ID for the interaction, as a GUID enclosed in {}. You can find more information on GUID's here: GUIDs String Yes

 

 

<ServiceInteraction.Finished>

This child element of <WorldBase.Flight> is used to send an "interaction finished" notification to the interaction manager and the navigation service (if there is one). This element must be included for every one of the following elements that are part of the interaction XML:

  1. <ServiceInteraction.Interaction>
  2. <ServiceInteraction.InteractionVolume>
  3. <ServiceInteraction.InteractionState>

 

This element can have the following sub-elements:

  1. <Descr> - Optional description which can be supplied as part of the XML to help identify elements.
  2. <ObjectReference /> - The action object reference for the interaction/interaction volume/interaction state to notify as finished.

 

This element also has the following attributes:

 

Attribute Description Type Required
id The ID string that can used to identify the interaction element. String Yes
InstanceId The unique ID for the interaction, as a GUID enclosed in {}. You can find more information on GUID's here: GUIDs String Yes

 

 

<ServiceInteraction.TargetContainer>

This is a sub-element of <WorldBase.Flight> is used to select a target "container" object that is part of the navigation service to interact with.

 

This element can have the following sub-elements:

  1. <Descr> - Optional description which can be supplied as part of the XML to help identify elements.
  2. <ObjectReference /> - The action object reference for the interaction/interaction volume/interaction state that will launch the finish notification for the behaviour object that is doing the interaction.
  3. <TargetId> - This element defines the container object type that you wish to use.

 

The following sub-elements may also be used, but only when the <TargetId> is "GRAPHOBJECT":

  1. <TargetBehaviour> - The target object behaviour to look for. You can use "all" to include all behaviour objects in the filter.
  2. <IsInteractiveObject> - Whether to look for an interactive object ("True") or a behaviour object ("False").
  3. <NodeOrder> - The order of detection on the navigation graph nodes.
  4. <NodeTag> - This element gives a specific node tag that will be used to look for the interactive object.

 

This element also has the following attributes:

 

Attribute Description Type Required
id The ID string that can used to identify the interaction element. String Yes
InstanceId The unique ID for the interaction, as a GUID enclosed in {}. You can find more information on GUID's here: GUIDs String Yes

 

 

<TargetId>

This is a sub-element of <ServiceInteraction.TargetContainer> and is used to define the container object type that you wish to use for the target container, and can be one of the following strings:

  • "Interactor": An object that is doing the interaction (this is normally for human object behaviours)
  • "Object": A basic object that can be interacted with (for example, seats, boxes, doores, etc...)
  • "GraphObject": An object that is found on the interative object navigation graph. When this is used you will need to use the following filter elments to define how to find the object on the graph:
    1. <TargetBehaviour>
    2. <IsInteractiveObject>
    3. <NodeOrder>
    4. <TaskName>

 

 

<TargetBehaviour>

This is a sub-element of <ServiceInteraction.TargetContainer> and is only required when the <TargetId> element is set to "GraphObject". It has no attributes and is used to set the target object behaviour to look for. You can use "all" to include all behaviour objects.

 

 

<IsInteractiveObject>

This is a sub-element of <ServiceInteraction.TargetContainer> and is only required when the <TargetId> element is set to "GraphObject". It has no attributes and is used to set whether to look for an interactive object ("True") or a behaviour object ("False") when searching for a target container.

 

 

<NodeOrder>

This is a sub-element of <ServiceInteraction.TargetContainer> and is only required when the <TargetId> element is set to "GraphObject". It has no attributes and is used to define the order of detection on the navigation graph nodes when searching for a target container. The order is defined using the following strings:

  • "Random": Choose the target container node randomly.
  • "Ascending": Choose from smallest to largest node (by id) for the target container.
  • "Descending": Choose from largest to smallest node (by id) for the target container.
  • "Distance": Choose the nearest node based on distance to the ineractive object.

 

 

<NodeTag>

This is a sub-element of <ServiceInteraction.TargetContainer> and is only required when the <TargetId> element is set to "GraphObject". It has no attributes and is used to give a specific node tag that will be used to look for the target container interactive object. You can use "all" to include all nodes.

 

 

<ServiceInteraction.PushCabinObjectTask>

This is a sub-element of <WorldBase.Flight> is used to push a specific task onto a behaviour object in the interaction.

 

This element can have the following sub-elements:

  1. <Descr> - Optional description which can be supplied as part of the XML to help identify elements.
  2. <ObjectReference /> - The action object reference for the interaction/interaction volume/interaction state that has the behaviour object being given the task.
  3. <CabinObjectList> - A container element for the behaviour object containers to push the task onto.
  4. <DoOnAllObjects> - Used to decide whether to push the task to all behaviour objects or the first one that is found.
  5. <TaskName> - The name of the task to push

 

This element also has the following attributes:

 

Attribute Description Type Required
id The ID string that can used to identify the interaction element. String Yes
InstanceId The unique ID for the interaction element, as a GUID enclosed in {}. You can find more information on GUID's here: GUIDs String Yes

 

 

<CabinObjectList>

This sub-element of <ServiceInteraction.PushCabinObjectTask> is a container element for one or more <ObjectReference /> and is used to define the behaviour object(s) that should have a task pushed onto it.

 

 

<DoOnAllObjects>

This sub-element of <ServiceInteraction.PushCabinObjectTask> is used to decide whether to push the task to all applicable behaviour objects ("True") or the first one that is found ("False").

 

 

<TaskName>

This sub-element of <ServiceInteraction.PushCabinObjectTask> is the name of the task that you want to push onto the applicable behaviour objects (as defined in the <AvailableTask> element of the services XML).

 

 

<ServiceInteraction.AttachToContainer>

This is a sub-element of <WorldBase.Flight> is used to attach an interaction object to another object. Attached objects will then be moved along with the object it is attached to, for example, if you have a passenger object in an airport bus and wish the passenger to move with the bus, then it would need to be attached to the bus object.

 

This element can have the following sub-elements:

  1. <Descr> - Optional description which can be supplied as part of the XML to help identify elements.
  2. <ObjectReference /> - The action object reference for the interaction/interaction volume/interaction state that has the behaviour object to be attached.
  3. <AttachOrDetach> - Whether the object should be attached or detached.
  4. <InteractorToAttach> - The interaction object that is to be attached.
  5. <ObjectToWhichAttach> - The container object which is being attached to.

 

This element also has the following attributes:

 

Attribute Description Type Required
id The ID string that can used to identify the interaction element. String Yes
InstanceId The unique ID for the interaction element, as a GUID enclosed in {}. You can find more information on GUID's here: GUIDs String Yes

 

 

<AttachOrDetach>

This is a sub-element of <ServiceInteraction.AttachToContainer> and has no attributes. The element is used to decide whether the object attach or detach from another object. The element can only have one of the following strings:

  • "Attach"
  • "Detach"

 

<InteractorToAttach>

This is a sub-element of <ServiceInteraction.AttachToContainer> and has no attributes. This element should contain a reference to the interactor that need to be attached (for example, a passenger), usually provided with the <ServiceInteraction.TargetContainer> (using the "Interactor" <TargetId>).

 

<ObjectToWhichAttach>

This is a sub-element of <ServiceInteraction.AttachToContainer> and has no attributes. This element should contain a reference to the object that is to be attached to (for example, a bas), usually provided with the <ServiceInteraction.TargetContainer> (using the "Object" <TargetId>).