Jump to: navigation, search

Tutorial Trigger Zones

Working with Trigger Zones

A Trigger Zone is an invisible 3D space that knows when a player (and hopefully more things) enters or leaves it.

The purpose of a TZ (Trigger Zone) is to trigger game logic when a player enters it (such as spawn things, or show some HUD text, or move onto the next level in your game) or when a player leaves it (so you can block the way behind them, etc.. )


Trigger Zone Mode

Editing in Cubiverse is caused by you equipping the world editor, if you do not have the world editor then you cannot edit the world (i.e. you don't own it!). For more information on how to equip the world editor, see this article

Select the trigger zone editing mode, by clicking the Trigger Zone button:

TriggerZoneMode.png

The tool-bar also contains larger buttons on the left side that present the modes of operation.

TriggerZoneToolBar.png

Remember you can use the keyboard to switch modes quickly, the small number (or letter) in the bottom left of the icon shows they correct key to use. For example 1.. add TZ, 2.. delete TZ, etc..


Mode Selection colors

When you change the TZ edit mode, the selection cube will change color:

TriggerTypeSelecton.png


Add Trigger Zone

When you first select the "Add Trigger Zone" button you will see a single purple selection square. However, it's very unlikely that you want the smallest trigger zone as most entrances or areas are large. Therefore you will probably want to expand the size of the trigger zone.

Changing the size of the new trigger zones

The following buttons are used to increase to descrease the selection cubes height, width or depth.

TriggerZoneResizerButtons.png

For example, clicking Height x 3 and Depth x 2 - you get a selection cube of this size:

TriggerZoneResized_.png

If you were to stamp down this selection cube, you would see this Trigger Zone:

TriggerZoneResizeStamped.png


Deleting a Trigger Zone

To delete an trigger zone simply select the "delete trigger zone" operation and move the mouse over the Trigger Zone you wish to delete. When you click the mouse the TZ will be deleted,. The only way to undo a delete is to click the "abort changes" button, but this will undo all changes applied since you entered the editor.

When you "play" the world any deleted Trigger Zones are permanently deleted.


Move Trigger Zone

Sometimes you need to move a Trigger Zone, for example: if you have increased the size of an entrance or zone.

Using the move operations tool you can select the trigger zone to move and then press down the MOUSE button and drag the trigger zone to it's new location (either using sticky cubes or free cubes)

Resizing an existing trigger zone

Often you want to increase or alter the size of a Trigger Zone as your worlds develop.

You must select the Trigger Zone you wish to alter using the "Move Trigger Zone" mode, as soon as you have highlighted it you can click the normal resize buttons to change it's dimensions.

TriggerZoneFinalResizeExample.png


Edit or Add Script to Trigger Zone

We have a whole section of how to write scripts, but from a world editor point of view you simply select the "Edit Script" mode, and move the grey selection cube over the Trigger Zone you wish to apply or edit the script on.


Sticky or Free Cubes?

First thing you will notice when adding Trigger Zones (or other things) causes the new TZ's to stick to other cubes. This makes it easier to add Trigger Zones to existing structures, because they snap onto the edge of other cubes.

Using the "stick cube" or "free cube" buttons:

stickyCubes.png

For "free" cubes, you can use the mouse wheel to change the distance of where the Trigger Zone is placed..

stickyFreeCubesExample.png