Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

What

script_config.xml

Description

Configuration of a script in the FEWS Game

schema location

script_config.xsd

In a scenario script configuration, the start and end time of a scenario, and events for a scenario the script are specified. A scenario script must be a directory in the scenario/script database in which files relevant for that scenario script are collected.

Schema definition overview

The global structure of the XML-schema for the scenario script configuration is as follows:

The Name- Title key is an optional identifier for the scenarioscript. The start and end date/time for the scenario script have to be specified using attributes date and time in the format YYYY-MM-DD and hh:mm:ss, respectively. The NextEventButton- key can be set to yes true or no false and indicates whether or not a button for proceeding to the next event in the scenario script must be included in the user interface. The configuration of events and forecasts (or stories) and the forecast table for a scenario script are explained below.

...

Stories

In the section Events Stories of the scenario script configuration, an arbitrary number of stories can be specified. Two types of stories can be specified:

  • Inbox is optional and may be specified only once. The inbox consists of events (or messages) that are put in the inbox, which can be activated by the user.
  • Story can be specified an arbitrary number of times. Each story corresponds to a button in the user interface that can be activated by the user. The content of story buttons can be dynamic, i.e. different events may be triggered by pushing the story button at different times.

Each story according to the following schema:
Image RemovedEach event must have a title by specifying the Title-key key (but the title for the inbox is optional). This title will be used in as the list title of actions that the user can invoke from the drop-down menu in the scenario window of the FEWS Gamethe story button. The title can be different for various languages:

Code Block
xml
xml
<Event><Story>
   <Title lang="NL">Telefoongesprek</Title>
   <Title lang="GE">Anruf</Title>
   <Title>Telephone call</Title>
</Event>
If the language attribute for {{Title}} is specified and it corresponds to the preferred language in the [application configuration|Application configuration], then this title is used in the

...

 script. If no language attribute is found that corresponds to the

...

 preferred language, then the default {{Title}} for which no language attribute was specified will be used.

...

The Type of an event can be equal to either static, dynamic or static and dynamic. A static event will be executed at the indicated time and will be lost thereafter, i.e. the event can not be invoked again by the user. A dynamic event will be available after the indicated time as an action in the drop-down menu of the scenario window and can be invoked by the user. A static and dynamic event will be executed at the indicated time, but is also available as an action in the drop-down menu.

The Time-key indicates when a static event will be executed or when a dynamic event will be available as an action to the user. As with the Start- and Stop-keys, the Time-key has attributes date and time following the format YYYY-MM-DD and hh:mm:ss, respectively.

For a dynamic event, a delay can be specified with the Delay-key (which only has a time attribute). For example,

...


   <Delay time="00:00:30"/>

indicates that the event will be executed 30 seconds after the user invoked it.

A condition can be added to an event; the event will only be executed if this condition is fulfilled. For now, the only supported condition is one based on a forecast published by the user. A condition must be specified according to:
Image Removed
where

  • Type must be equal to "Forecast",
  • Station is the name of the forecast station (see below),
  • Operator is one of "lt" (less than), "gt" (greater than), "le" (less than or equal to), or "ge" (greater than or equal to), and
  • Value is the reference value to compare to.

An example in which a condition is used:

Code Block
xmlxml

<Event>
   <Title>condition</Title>
   <Type>static and dynamic</Type>
   <Time

A story may consist of an arbitrary number of frames according to the following schema:

The title of a frame in the inbox will be used in the list of actions that the user can invoke from the inbox drop-down menu. As explained above, the title can be different for various languages.

The {{Start}} and {{Stop}} keys indicate the time window in which the frame of a story is active. For a frame in the inbox this means that the associated event is available in the inbox between the start and stop time. For a frame in a regular story, the associated event will be executed if the user pushes the story button between the start and stop time. The {{Start}} and {{Stop}} keys have attributes {{date}} and {{time}} following the format {{YYYY-MM-DD}} and {{hh:mm:ss}}, respectively. Both the {{Start}} and {{Stop}} keys are optional. If these are not specified, then these default to the start and end time of the script, respectively.

The {{Popup}} key is a flag indicating whether or not to show a pop-up window at the start of the frame. For a frame belonging to the inbox this means that the associated event is executed. For a frame of a regular story, a message dialog appears informing the user that new content is available for a story, which can trigger the user to activate the relevant story button.

A condition can be added to a story frame; the associated event will only be executed if this condition is fulfilled. For now, the only supported condition is one based on a forecast published by the user. A condition must be specified according to:
!condition.png|border=1!
where
* {{Type}} must be equal to "Forecast",
* {{ColumnId}} is a reference to a column in the forecast table (see [below|#Forecast Table]), usually a parameter,
* {{RowId}} is a reference to a row in the forecast table (see [below|#Forecast Table]), usually a location,
* {{Operator}} is one of "lt" (less than), "gt" (greater than), "le" (less than or equal to), or "ge" (greater than or equal to), and
* {{Value}} is the reference value to compare to.

An example in which a condition is used:
{code:xml}
<Frame>
   <Title>condition example</Title>
   <Start date="2008-03-13" time="00:01:00"/>
   <Stop date="2008-03-13" time="00:0102:00"/>
   <Popup>true</Popup>
   <Condition>
      <Type>Forecast</Type>
      <ColumnId>water_level</ColumnId>
  <Station>Lowestoft</Station>    <RowId>Lowestoft</RowId>
      <Operator>ge</Operator>
      <Value>300</Value>
   </Condition>
   <File>emergency_telephone_call.txt</File>
</Event>

...

The File-key has an optional language attribute that behaves the same as for the Title-key. The NewTime-key has the same date and time attributes as Start, Stop, and Time.

Forecasts

Locations for which a water level forecast must be made are specified in the Forecasts-section. The schema for this section is as follows:

...