Create Blueprint Scenario

Read more about blueprints in this chapter.

Let's create a scenario: a sequence of instructions that will be executed in the game. In this example, we will create a scenario that triggers the repair of a building when it becomes enabled.

  1. In Outliner, select scene_settings > scene_settings_prefab > scenarios:

    This is a list of scenarios that are attached to the scene. Sometimes scenarios can also be attached to objects: we will create such a scenario in the next chapter.

  2. In Inspector, click + next to the Level scenarios property, select LevelScenarioClient and click Apply:

  3. Click Open:

    An empty window will open:

    This is the Blueprint Editor where you can create scenarios using blueprints.

  4. Right-click on any empty place — a dropdown menu should appear:

  5. Use the search bar to find the nodes and click on the nodes to add them to the scenario. Find and add the following nodes:

    • Get First Tagged Actor
    • On Enabled
    • Force Build

    Tip

    If you don't see the added nodes, try to zoom in by holding Ctrl and scrolling with a mouse wheel.

  6. Connect the nodes and fill the Tag parameter in the Get First Tagged Actor node with build_1:

The created scenario works this way:

  1. In the beggining of the level, the game finds an object tagged as build_1.
  2. The game waits for the moment the building becomes enabled (its Enable Disable state is set to Disabled by default), for example, by an action Unlock Object Logic.
  3. When the building becomes enabled, the game restores the building; the game knows which bulding to restore because the Force Build node is connected to the Get First Tagged Actor node.

See the next step.