Skip to main content

Instances

An Instance can be seen as a level inside your level. They are very useful if you need to build or script the same thing multiple times. A good example would be a door that can be opened by AI or a power box that can appear in random locations. ble_instance_level2.jpg

Instead of having to build and script it multiple times, you do it once and either spawn the instance multiple times or move it using InstancePoint Elements. ble_instancepoint.jpg

In gameplay, you won’t notice any difference between Instance and Units in your level.

Spawning

You can either use vanilla instances, or make your own custom ones, in both cases you can find them in the “Instance” tab in the Spawn Menu.

Create A Custom Instance

To create your own Instance, simply open your Map in the Project Manager, add a new module, select “Instance” and give it a unique name.
ble_instance_module.png

You can now open your new Instance like any regular level and edit it. While scripting your Instance, you can set up InstanceInput and InstanceOutput elements to send signals between the instance and your level.
After spawning the Instance in your level, you can send signals to it using the InstanceInputEvent Element in your level, and receive signals from the Instance with InstanceOutputEvent Element. ble_instance_events.png

Keep the amount of elements below the Instance Index size, which is 250 by default. It can be increased if necessary, though it’s better to keep your instance size as small as possible. the Index size is basically the amount of element IDs in your level's script that are reserved for the Instance.

Instances can easily have randomized locations using the InstancePoint Element. Toggle the “Mission Placed” option in your Instance. Spawn and place the InstancePoint Element where you want the Instance to appear and link it with it. When executing the Element, the Instance will be spawned at the same location as the Element.