Scenario Editor

The **Scenario Editor**, simply referred to as the editor, is a tool featured in Dinogen Online.

## Overview

The editor allows the user to create custom scenarios and maps and publish them in the steam workshop.

### General

The **General** tab contains main scenario data:

* Workshop Item ID
* Filename
* Name
* Description
* Game Mode
* Map
* Path Nodes

Filenames must be unique, otherwise they will overwrite any existing scenario data with the same filename. In the general tab you can also publish your scenario/map to steam by clicking on "Share Scenario" and you can also save it.

### Settings

The **Settings** tab handles all game settings, for a full list of the settings visit the scenario settings page.

### Tiles

The **Tiles** tab allows you to place world tiles. This is only enabled when using the **map\_custom** map.

### Objects

The **Objects** tab allows you to create and modify game objects.

Objects are any physical game object, such as characters, dinosaurs, obstacles, trees, etc.

Objects can only be moved/modified while in the Objects tab. Click an object to view/modify its properties.

### Brush

The **Brush** tool is used for placing objects quickly on the map. This is useful for placing map details such as trees, rocks, and/or boxes.

Simply hold the mouse with an object selected to place it on the map.

### Structures

The **Structures** tabs allows you to place and modify structures.

### Triggers

The **Triggers** tab allows you create and modify game triggers.

A trigger is a core component to creating custom scenario missions. A trigger is composed of 3 properties:

* **ID** (string)
* **Event** (string)
* **Actions** (array of trigger actions)

Other optional properties include:

* **Repeats** (number)

### Functions

The **Functions** tab allows you to create and modify game functions.

Executing a function will execute a list of predefined actions. They are especially useful if you want to repeatedly execute a specific set of actions multiple times.

A function is composed of 2 properties:

* **ID** (string)
* **Actions** (array of trigger actions)

## Concepts

Having a basic knowledge of the JSON format is recommended. All scenario data is handled as JSON data with the editor being a UI interface for modifying this data.

### Object Types

* string
* number
* object
* array
* boolean (true or false)
* null (empty value)

If you want to use a property's default value, set the value to *null*.

### General Terms

* Pawn: a character or dinosaur
* Vehicle: any controllable vehicle, including mounted weapons

### Optimizing Performance

To ensure the best performance for your custom scenarios in game, you need to consider optimization.

A large number of objects can impact performance, particularly dynamic objects like characters and dinosaurs. Static objects, like trees, bushes, and rocks do not have a significant impact on performance.

When possible, make any map objects static if they do not need to move. You can do this by setting an object's **mass** to **0**.

#### Using Triggers

When possible, it's recommended to use triggers to spawn certain objects once the player reaches the respective area.

For example, if you set up a custom scenario mission that has groups of enemies in different areas, it would be better to have a *trigger area* that executes a trigger that spawns these enemies once the player approaches that particular area, as opposed to simply having all enemies spawned at the beginning of the mission.

You can also make use of the *numPawnsOnTeam* condition, which can be used to only spawn additional enemies if the enemy team has a certain amount of enemies. This will allow you to keep a cap on the number of enemies.

#### Automated Mounted Weapons

All mounted weapons can have the property *bAutomated* set. This allows the mounted weapon to automatically target and engage enemies. This removes the requirement of having an additional character spawned to control the mounted weapon.

## Triggers

Triggers are triggered when their **event** is executed. When triggered, they will execute their **actions**.

Trigger properties:

* **id** (optional if not using an event)
* **event**
* **name**
* **repeats** (optional)

**Trigger Conditions**

#### Event Conditions

Some trigger events have conditions. If set, these conditions must be satisfied in order for the trigger to be executed.

For example, the **objectRemoved** event has a single condition value; **objectId**. If set, the trigger will be executed when the object with the specified id is removed. Otherwise, any time an object is removed the trigger will be executed.

#### Trigger Conditions

Additional trigger conditions can be applied to each trigger. All conditions must be met in order for the trigger to be executed.

These conditions are setup using the following logic:

```
IF **<condition>** **<operator>** **<value>** THEN {executeTrigger}

```

##### Available Operators

* **==** (equal to)
* **<** (less than)
* **>** (greater than)
* **<=** (less than or equal to)
* **>=** (greater than or equal to)

The supplied *value* must be a string or number. In most cases it will be a number.

For example, this condition would only be satisfied if **team 0** currently has **more than 10 pawns**:

```
IF {**condition:numPawnsOnTeam, team:0**} {**operator:>**} {**value:10**} THEN {executeTrigger}

```

### Trigger Parameters

Some triggers will pass back parameters. These values can be used in any of a trigger's actions using the following format:

```
{parameterName}

```

For example, the **playerJoined** event will pass back 2 parameters; **playerId** and **playerIndex**. Since these values are different depending on the player that is joining, they can be referenced to in an action by typing **{playerId}** or **{playerIndex}** as the value.

In most cases, a trigger's parameters will be the same as their conditions.

A common example of parameter usage would be a **trigger area** that calls **applyDamage** to the **{objectId}** that touched it.

### Trigger Events

Each trigger has a single **event** that causes the trigger to execute.

For triggers that you want to execute yourself, such as in another trigger action, you can set the event to **null**. This means the trigger will only be executed when it is manually called.

### Trigger Actions

Each trigger has an array of **actions**, all of which are executed when the trigger is executed.

An action can have a **delay** (in seconds) set.

### Special Values

Instead of typing in a manual value, you can use a special value to use a dynamic value depending on its use.

* **{special:randomBoolean}** (true or false)
* **{special:randomRotation}** (degrees)
* **{special:randomAngle}** (radians)
* **{special:randomWeaponId}** (any weapon id, including firearms, melees, equipment, and grenades)
* **{special:randomFirearmId}**
* **{special:randomGrenadeId}**
* **{special:randomEquipmentId}**
* **{special:randomMeleeId}**
* **{special:randomDinoId}**
* **{randomMods:*<weaponId>*}**
* **{position:random}** (random map spawn point)
* **{position:*<objectId>*}**
* **{setting:*<settingId>*}**
* **{var:*<variableName>*}**
* **{playerId:*<index>*}**
* **{playerIndex:*<playerId>*}**
* **{playerTeam:*<playerId>*}**
* **{playerName:*<playerId>*}**
* **{playerLevel:*<playerId>*}**
* **{random:*<min>*:*<max>*}** (random integer from <min> to <max>)
* **{gameData:*<key>*}**
* **{special:uniqueId}** (gives a random unused four-character id)

## Functions

Functions have an **id** and list of **actions**, similar to triggers. However, unlike triggers, functions do not have an **event** used to execute them. Instead, functions must be called by using the executeFunction trigger action.

Functions can be reused, making them useful for actions that you want to execute multiple times within a game without the redundancy of creating the same actions.

Even if a function is only needed once, it is often easier to organize a custom scenario when using functions.

## Structures

Structures are complex static objects.

Structures are composed of multiple polygons and act as map obstacles. They cannot be destroyed and will be displayed on the minimap.

## Useful Pages

* Data Values
* Sound Ids