Server Events: Difference between revisions

From Tygron Preview Support Wiki
Jump to navigation Jump to search
Line 15: Line 15:
Below is a list describing the available Logic Server Event Types:
Below is a list describing the available Logic Server Event Types:
{| class="wikitable"
{| class="wikitable"
|-
|'''ACTION_LOG_EXPORT'''
|''Export history of actions taken by participants''
|-
|-
|'''ACTION_MENU_SET_FUNCTION_AVAILABLE'''
|'''ACTION_MENU_SET_FUNCTION_AVAILABLE'''
Line 24: Line 27:
|'''ACTION_MENU_SET_UPGRADE_AVAILABLE'''
|'''ACTION_MENU_SET_UPGRADE_AVAILABLE'''
|''Add or remove an upgrade from a particular Action Menu''
|''Add or remove an upgrade from a particular Action Menu''
|-
|'''AREA_SET_ACTIVE'''
|''Activate/deactivate a Area''
|-
|'''AREA_SET_ATTRIBUTE'''
|''Set Area Attribute to given number Value''
|-
|'''AREAS_SET_ATTRIBUTES'''
|''Per entry in the array, set the value of the attribute for the Area.''
|-
|'''BUILDING_SET_ATTRIBUTE'''
|''Set Building Attribute to given number Value''
|-
|'''BUILDING_SET_ATTRIBUTES'''
|''Per entry in the array, set the values of the attribute for the Building''
|-
|-
|'''CINEMATIC_STAKEHOLDER_START'''
|'''CINEMATIC_STAKEHOLDER_START'''
Line 30: Line 48:
|'''CINEMATIC_STAKEHOLDER_STOP'''
|'''CINEMATIC_STAKEHOLDER_STOP'''
|''Stop any cinematic for a specific stakeholder''
|''Stop any cinematic for a specific stakeholder''
|-
|'''MEASUREMENT_LINE_ADD'''
|''Add a LineMeasurement for an Overlay for a specific timeframe.''
|-
|'''MEASUREMENT_POINT_ADD'''
|''Add a PointMeasurement for an Overlay.''
|-
|'''MEASUREMENT_ITEM_ADD'''
|''Add a ItemMeasurement for an Overlay.''
|-
|'''MEASUREMENT_SET_SUM'''
|''Set a Measurement to add its base Overlays to itself.''
|-
|'''MEASUREMENT_REMOVE'''
|''Remove a measurement.''
|-
|'''MEASUREMENT_SAVE'''
|''Save a measurement.''
|-
|'''MEASUREMENT_SET_OVERLAYS'''
|''''
|-
|-
|'''SCENARIO_SET_ACTIVE'''
|'''SCENARIO_SET_ACTIVE'''
Line 36: Line 75:
|'''SPECIAL_EFFECT_SET_ACTIVE'''
|'''SPECIAL_EFFECT_SET_ACTIVE'''
|''Activate/deactivate a special effect''
|''Activate/deactivate a special effect''
|-
|'''AREA_SET_ACTIVE'''
|''Activate/deactivate a area''
|-
|'''AREA_SET_POLYGON'''
|''Change the polygon (shape, location, or both) of an area''
|-
|'''TIME_SET_SIM_MULTIPLIER'''
|''Set the simulation time multiplier. A value of 1 means that 1 sec in real life is also 1 sec in simulation time. 2 means 1 sec in real life is 2 sec in simulation time''
|-
|-
|'''UNIT_SET_ACTIVE'''
|'''UNIT_SET_ACTIVE'''

Revision as of 14:58, 4 October 2022

Template:Learned

What is a Server Event

Server events are events which are communicated to the server, and may affect all stakeholders. An example of this is the activation of a measure. These events may affect the 3D world and the indicator scores.

How do Server Events relate to the Tygron Platform

Server Events can be used in multiple locations in the Tygron Platform; as part of a measure, when a scenario is activated, as part of a larger event bundle in the action menu, or during a cinematic sequence. Server Events allow for events to be triggered during a session, which will result in a reaction from the server.

See also: Measures, Scenarios, Actions & Cinematics

Different Server Event types

There are two flavors of Server Events: Logic Events and Player Events. The difference between these Event Types is that for Player Events at least one dedicated stakeholder needs to be assigned to the Server Event itself as event property. A good example of this is the asking for or receiving of a money transfer (MONEY_TRANSFER_ASK & MONEY_TRANSFER_GIVE) as a Server Event.

Logic Events do not require such a dedicated stakeholder and can be fired without one being assigned as property. A good example of this is the activation of a specific area (AREA_SET_ACTIVE) when creating a flooding as part of a measure. Events like CINEMATIC_STAKEHOLDER_START are also Logic Event Types, because the stakeholder is not a property of the event, but of the linked cinematic.

Logic Event Types

Below is a list describing the available Logic Server Event Types:

ACTION_LOG_EXPORT Export history of actions taken by participants
ACTION_MENU_SET_FUNCTION_AVAILABLE Add or remove a function from a particular Action Menu
ACTION_MENU_SET_MEASURE_AVAILABLE Add or remove a measure from a particular Action Menu
ACTION_MENU_SET_UPGRADE_AVAILABLE Add or remove an upgrade from a particular Action Menu
AREA_SET_ACTIVE Activate/deactivate a Area
AREA_SET_ATTRIBUTE Set Area Attribute to given number Value
AREAS_SET_ATTRIBUTES Per entry in the array, set the value of the attribute for the Area.
BUILDING_SET_ATTRIBUTE Set Building Attribute to given number Value
BUILDING_SET_ATTRIBUTES Per entry in the array, set the values of the attribute for the Building
CINEMATIC_STAKEHOLDER_START Start a cinematic for a specific stakeholder
CINEMATIC_STAKEHOLDER_STOP Stop any cinematic for a specific stakeholder
MEASUREMENT_LINE_ADD Add a LineMeasurement for an Overlay for a specific timeframe.
MEASUREMENT_POINT_ADD Add a PointMeasurement for an Overlay.
MEASUREMENT_ITEM_ADD Add a ItemMeasurement for an Overlay.
MEASUREMENT_SET_SUM Set a Measurement to add its base Overlays to itself.
MEASUREMENT_REMOVE Remove a measurement.
MEASUREMENT_SAVE Save a measurement.
MEASUREMENT_SET_OVERLAYS '
SCENARIO_SET_ACTIVE Activate a scenario in a project session
SPECIAL_EFFECT_SET_ACTIVE Activate/deactivate a special effect
UNIT_SET_ACTIVE Activate/deactivate a unit (vehicles etc)
WEATHER_SET_DATA Set rain data of the weather
ZOOMLEVEL_SET_ACTIVE Activate or deactivate a zoom level

Player Event Types

Below is a list describing the available Player Event Types:

ACTION_MENU_SET_ACTIVE Set a category of actions available for a stakeholder
MEASURE_CANCEL_CONSTRUCTION Cancel a measure planned by a stakeholder while in pre-construction phase
MEASURE_PLAN_CONSTRUCTION Plan construction of a measure by a stakeholder that is not yet planned
MESSAGE_NEW Send a message between Stakeholders through the message panel
MONEY_TRANSFER_ASK Ask for money from one stakeholder to another
MONEY_TRANSFER_GIVE Give money from one stakeholder to another
SETTINGS_SET_ALLOWED_WATER_LEVEL_INCREASE Set the maximum allowed water rise amount in meters in 'polder water' (= open water)

Adding Server Side Events to a project

As mentioned above, events can be added to a project element on multiple occasions and locations. Please refer to the main article relating to these elements for more information about the specific steps to take.

In general, adding Events to an element in the Tygron Platform happens on the right panel, after selecting the element (ex. measures, levels, etc) to have an event added to on the left panel first. Select on the right panel bottom the 'Add Event' button; a default blank event named NO_DEF is created in the list above the buttons. Selecting an Event on the list and using the 'Remove Event' button deletes the event from the list.

Selecting an event on the right panel also opens up the bottom panel where the actual event type can be selected. This selection can then be confirmed on the bottom panel by using the 'Commit' button. The 'Cancel' button clears the selection on the bottom panel.

Event bundle bottom panel with 'Commit' and 'Cancel' buttons


How to add events to a project element:
  1. Select Project Element to have events added to
  2. Select the Event option on the left panel
  3. Select 'Add event' on the bottom of the right panel
  4. Select the newly added event on the right panel
  5. Select the desired server event from the bottom panel
  6. Confirm the selection with the 'Commit' button (or use the 'Cancel' button to clear the selection

Changing the properties of a Server Side Event in a project

The properties of events can be edited on the bottom panel (see image above). On this panel a linked ID of a measure or cinematic can be linked to an event for instance. Also can a dedicated stakeholder be selected here for Player Type Events. Again, any changed made need to be confirmed first with the 'Commit' button, or cancelled with the 'Cancel' button.