Local stimulation
General informations
If you run the engine by choosing "Local Stimulation", the display can then be stimulated by scenarii embedded in scene files.For now, you have to edit them manually by opening scene XML files into a text editor.
Note that in local stimulation, you have access to less commands than in remote stimulation.
Since the scene is described using the XML specification (markup, nodes, attributes, etc...), embedded scenarii commands (also called nodes) are also described by nodes that may contain attributes (or parameters).
We recommand you to take a look at the scenarii section in cross.xml file. You can also check the other scene files in the scene directory, some have embedded scenarii also.
Scenarii are contained in the <scenarii> node, you can put as many scenarii as you want :
<scenarii> <scenario id="scenario1" logString="First_scenario" position="0,0,0" roation="0,90,0"> ... scenario commands ... </scenario> <scenario id="scenario2" logString="Second_scenario" position="0,10,0" roation="0,00,0"> ... scenario commands ... </scenario> ... </scenarii>
Each scenario has to contain at least one <end logString="my_log"> node in order for the engine to know that the scenario is finished, see the description of this command bellow.
Here is a simple scenario example :
<scenario id="reward_N_start_S" logString="S;N" position="0.0,0.5,16.5" rotation="0.0,0.0,0.0"> <wait during="500"/> <image file="arrow_up.png" during="5000"/> <joystick_check during="5000"> <up> <move z="1.5" during="6000"/> <image file="success.png" during="2000"/> <wait during="2000"/> <end logString="1"/> </up> <default> <image file="failure.png" during="2000"/> <wait during="2000"/> <end logString="0"/> </default> </joystick_check> <image file="failure.png" during="2000"/> <wait during="2000"/> <end logString="0"/> </scenario>
Nodes list
General notes :- Syntax : [...] : optional parameter, {...} : parameter type cast, | : or.
- Attributes as well as their values are case-sensitive but can be given in any order.
- Some commands can have child nodes.
- In you forget a non-optional node attribute, the resulting command may not be processed.
General nodes
<scenario id="{string_id}" logString="{string_log}" position="{real_x},{real_y},{real_z}" rotation="{real_rx},{real_ry},{real_rz}">
...commands...
</scenario>
Starts a new scenario description.
id : the scenario id.
logString : the string to put in the logfile to identify this scenario for further external log analysis.
position : the absolute x, y, z vector describing the start camera position.
rotation : the absolute rx, ry ,rz vector describing the start camera rotation.
<end logString="{string_log}"/>
Ends the scenario. Depending on how you configured the engine, next scenario is then processed.
You can insert multiple end nodes at different points.
logString : the string to put in the logfile to identify how this scenario has ended. Examples : success, failure, 1, 0, etc.
<log id="{string_element_id}" attribute="{string_attibute_name}"/>
Appends an element attribute value to the log.
<wait during="{integer_millis}"/>
Pauses the engine for a given time.
No keyboard input are processed while the engine is paused.
Keyboard related nodes
<joystick_check during="{integer_millis}">
<up>
...commands...
</up>
<down>
...commands...
</down>
<left>
...commands...
</left>
<right>
...commands...
</right>
<default>
...commands...
</default>
</joystick_check>
Waits for keyboard input.
Give at least one of the up, down, left, right or default node.
"Up", "down", "left", and "right" match their corresponding keyboard arrow.
The "default" node matches any keyboard input if not matched by "up", "down", "left" or "right". If you only give a "default" node, any keyboard input matches.
You can add joystick_check commands into joystick_check commands. The depth limit is not specified.
Camera related nodes
<move [x="{real}"] [y="{real}"] [z="{real}"] [rx="{real}"] [ry="{real}"] [rz [@]{real}] [during="{integer_millis}"]/>
Moves the camera, give at least one coord.
If during is omitted or is = 0, the camera "jumps" at the given coord.
The camera works like a state machine. For each omitted coord, the current value is kept (0 by default).
The movement is linearly interpolated such that the camera arrives at position at the command start plus the given interval. Thus, the speed in milliseconds of the movement for a given position/rotation is the difference between the current position/rotation and the given one divided by the during parameter, the speed is distinctly calculated for each direction/rotation.
Example :<move x="0" ry="0"/>
<move x="5" ry="90" during="1000"/>The camera moves to x = 5 at 5 units/second and rotates to ry = 90 at 90 degrees/second.
Rotating over rx is pitch (look up/down), over ry is yaw(look right/left), over rz is roll (roll right/left).
Note that you can't use the pitch, yaw or roll attribute instead of rx, ry, rz in the XML version of the move command (like with the console/remote version). The following illustration is given for better understanding, use rx in place of pitch, ry in place of yaw and rz in place of roll.
Pitch yaw & roll illustration
Screen related nodes
<image file="{string_filename_relative_to_textures_path}" during="{integer_millis}"/>
Displays an image.
This function is not blocking, further commands are processed normally.
Scene alteration related nodes
<set id="{string_element_id}" attribute="{string_attibute_name}" value="{variant_attribute_value}"/>
Alters an element attribute value (ex : visible, material, etc...).
See the advanced element properties in the editor for available attributes.


