About Natural Language

Natural Language is a simple language that enables to describe, with natural sentences, actions triggered by events. The actions are known as capacities.

You can use Natural Language to create scenarios.

This page discusses:

General Structure

Each number identifies a specific area in a Natural Language scenario. Areas are described in the following table.

Number Element Description
1 Act Sequence of a scenario.
2 Paragraph Group of sentences.
3 Sentence Element that includes:
  • a conditional part
  • an action part

Sentence Structure

Before using Natural Language, you need to understand the structure of a Natural Language sentence.

Conditional and Action Parts

In a Natural Language sentence, there are two parts: a conditional part and an action part.

A conditional part is a part of a sentence that triggers the action part if valid.

An action part is a part of a sentence that contains the action to perform when the conditional part is valid.

Each part includes different elements that are described in the following table.

Part Element Description
Conditional part Conditional operator Word that begins a condition.
  • If: if the condition is valid, it executes the action.

    Note: You can use this operator with event sensors and function sensors.

  • Each time: if the condition is valid, it executes the action multiple times. The condition repeats as soon as the action ends.

    Note: You can use this operator with event sensors and function sensors.

  • While: if the condition is valid, it executes the action multiple times. Unlike Each time, the value of the condition affects the action during its execution and stops if it is no longer valid.

    Note: You can use this operator with function sensors.

Sensor block Block of the conditional part.
Logical operator Word that connects sensor blocks.
  • And: both conditions must be valid to validate the conditional part.

  • Or: only one block must be valid to validate the conditional part.
Note: And has the priority on Or.

Example: A And B Or C And D = (A And B) Or (C And D)

Action part Do Generic operator that represents the beginning of the action part.
Driver block Block of the action part.
Sequential operator

Word that manages the execution sequence of the blocks.

  • And: executes both actions at the same time.
  • Then: executes the second action only when the first one is finished.
  • After: executes the action before with a delay (s or ms).
  • During: executes the action for a duration (s or ms).

Example of Conditional and Action Parts

Number Element
C Conditional part
1 Conditional operator
2 Logical operator
S1 / S2 Sensor blocks
A Action part
3 Do operator
4 Sequential operator
D1 / D2 Driver blocks

Blocks and Capacities

A block is an element of a sentence that is made of a subject and a capacity.

A capacity is a condition or an action that is related to a subject.

Each element is described in the following table.

Element Description
Block

A block contains:

  • a subject (3D actor, ambience, human...)
  • a capacity
  • a parameter (optional):
    • it provides information on how an action is performed.
    • it can be of any type (number, actor, Boolean, ambience, string...)

There are two types of blocks:

  • sensor blocks
  • driver blocks

Capacity A capacity shows what the subject can do, according to its type and its hosted behaviors.

There are two types of capacities:

  • sensors:
    • They belong the conditional part.
    • They describe a condition.
    • Two types of sensors are available:
      • Event sensor: condition that is validated after an event happens.
      • Function sensor: condition that is validated by verifying an actor's state.
  • drivers:
    • They belong to the action part.
    • They describe an action.
    • Two types of drivers are available:
      • Service driver: action that takes time to complete.
      • Function driver: action that modifies the state of an object instantaneously.

Example of Blocks and Capacities

Number Element
S1 / S2 Sensor blocks
D1 / D2 Driver blocks
1 / 3 / 5 / 8 Subject
2 Event sensor
4 Function sensor
6 Service driver
7 Parameter
9 Function driver