Scripting System

Description
Implementing a system that executes a set of actions when a certain condition is met.

Implementation
Scripts are set for each map and are in a yaml file with the following format "_scripts.yaml" where map_name is the file name of the map without the extension.

Each script file has 2 sections Scripts and Conditions.

Scripts
This section contains a list of scripts which themselves contain a list of actions.

An Action is represented by a list and has the following format:

,, [, command to execute before the action is run, parameters for the command]

The Name, Parameters, and Time are mandatory the rest is optional.

The parameters, both for the action and the command, are a string that is being passed to the python eval function which is run within the Scripting Environment.

Example of a script section: Scripts: janie_greet: - [Talk, Janie, 0, approach, 'Janie.fifeagent, PlayerCharacter.fifeagent.behaviour.agent']

Conditions
This section contains a list of conditions.

A Condition is represented by a list and has the following format:

,

The evaluation string is a string that is being passed to the python eval function which is run within the Scripting Environment.

If the evaluation string evaluates to True then the script with the given name is being executed.

Example of a condition section: Conditions: - ["not met('Janie')", "janie_greet"]

Example of a complete script file: Scripts: janie_greet: - [Talk, Janie, 0, approach, 'Janie.fifeagent, PlayerCharacter.fifeagent.behaviour.agent'] Conditions: - ["not met('Janie')", "janie_greet"]