Post by Max on Jul 11, 2005 13:53:34 GMT 1
In this tutorial will be explained how triggers work.
First open existing map or create a new one.
Open Trigger Editor by pressing F4 or you can access it through Module -> Trigger Editor in upper toolbar.
There are 3 basic items in Trigger Editor:
Triggers are divided into 3 parts:
One last thing:
Under the toolbar there are two option which you can set. There is a tick in both of them.
Enabled - when you turn this off, you'll disable the selected trigger, that means that the game won't have access to this trigger. Use this if you want to test something and you don't want the trigger to run anyhow.
Initially On - turn this off to turn off also the trigger. It means that even when the events are achieved, the trigger won't be executed. The trigger can turn off itself vie Turn off (this trigger) action. Triggers can turn on or off other triggers via actions that are in Trigger section.
Every trigger can be initially off, causing it nor to run. Only when another trigger turn it on, it can be executed.
Summary:
A trigger can be run by 2 ways:
At least one of Events is achieved.
Or another trigger runs it (you can specify if you want conditions to be checked or not).
This only work if the trigger is ENABLED and ON.
After events are achieved or it is run by another trigger, the conditions are checked. All must be true (with exepton of Or condiiton). And then trigger is executed runnig all actions in exact order.
If you are total beginners in WE this tutorial can seem to be a bit complicated. But don't worry you will understand it after practicing.
First open existing map or create a new one.
Open Trigger Editor by pressing F4 or you can access it through Module -> Trigger Editor in upper toolbar.
There are 3 basic items in Trigger Editor:
- Folders: They are used just for categorization, which is important when you have more triggers.
- Comments: Useful when you need to divide triggers in a folder.
- Triggers: The main part of all. This is source of the map and very powerful tool. By Triggers you can do everything. Triggers contol the map.
Triggers are divided into 3 parts:
- Events: Events are used to run the trigger. You do not specify what happens exactly, just in general. Ex.: (A unit Dies) event means that when any unit on the map dies, the trigger will run. When there are for example 3 events, and all 3 events achieves, the trigger runs 3 times. The trigger runs every time any of the events achieves. Mostly only 1 event is used (A unit Gains a level). But it is possible to use more: When you want a trigger run only when a unit enters 2 possible regions, you use 2 events (A unit enters Region) and different regions in each.
- Conditions: What if you want to make an event (A unit enters Region) and you want to specify which unit or whose player? You need Conditions. When an event is achieved, ALL conditions must be verified, before the trigger executes. Conditions are made by comparisons. Ex.: You create a integer varible (a) and you want it to be equal to 3. You must use Integer Comparison: a is equal to 3. Remember that ALL conditions must return TRUE value, only then can trigger be executed.
- Actions: They are most important part of trigger. Actions are executed in order you place them and after an event is achieved and conditions are verified. Remember that if you don't want the trigger to run more than once, the first action should be Turn off (This trigger).
One last thing:
Under the toolbar there are two option which you can set. There is a tick in both of them.
Enabled - when you turn this off, you'll disable the selected trigger, that means that the game won't have access to this trigger. Use this if you want to test something and you don't want the trigger to run anyhow.
Initially On - turn this off to turn off also the trigger. It means that even when the events are achieved, the trigger won't be executed. The trigger can turn off itself vie Turn off (this trigger) action. Triggers can turn on or off other triggers via actions that are in Trigger section.
Every trigger can be initially off, causing it nor to run. Only when another trigger turn it on, it can be executed.
Summary:
A trigger can be run by 2 ways:
At least one of Events is achieved.
Or another trigger runs it (you can specify if you want conditions to be checked or not).
This only work if the trigger is ENABLED and ON.
After events are achieved or it is run by another trigger, the conditions are checked. All must be true (with exepton of Or condiiton). And then trigger is executed runnig all actions in exact order.
If you are total beginners in WE this tutorial can seem to be a bit complicated. But don't worry you will understand it after practicing.