• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Basics of Triggers

Archian

Site Director
Level 64
Joined
Jan 1, 2006
Messages
3,106
Note, that the tutorial is still in progress. Feel free to post comments & suggestions for improval :)

Basics of Triggers
By Archian

My ten-year-old cousin has just started warcraft III modding, and has begun experimenting with the Trigger Editor.
I promised that I would make a little tutorial relating to how to make some *very* basic, but useful triggers for custom maps.
This tutorial is also meant as a source of information that may encourage newcomer's to start triggering and from there, develop their knowlege.
So when you're done reading this tutorial, go inside the World Editor and do some experimenting yourself :)
Click the images for larger versions.

The "target group" of this tutorial is of course; beginners.

Table of Content



48px-Warcraft_III_World_Editor.png
Introduction to The World Editors' "Trigger Editor"
The trigger editor is where the map script is written, either in GUI triggers or directly in JASS.
The map script controls any in-game events not dictated by the user. Triggers are essential for creating maps with complicated goals and atmosphere.

Trigger Editor: (Menu Bar\Module\Trigger Editor) TriggerEditor.jpg

TriggerModules.jpg
(From left to right: Variables... (Ctrl+B), New Category (Ctrl+G), New Trigger (Ctrl+T), New Trigger Comment (Ctrl+M), New Event (Ctrl+E), New Condition (Ctrl+D), New Action (Ctrl+R).

Button:Functions:
Variables....jpgVariable Editor ~ MrApple's Beginner's Guide to Variables.
NewCategory.jpgCreates a new category for triggers; useful in custom maps with many triggers to keep a better overview.
NewTrigger.jpgCreates a new trigger.
TriggerComment.jpgA "comment category" which you can use for "headlines" under (for example) categories so each trigger "group" is kept well organized.
NewEvent.jpgCreates a new event for a trigger.
NewCondition.jpgCreates a new condition for a trigger.
NewAction.jpgCreates a new action for a trigger.

Of course, you can just right-click on the list, a trigger or a category to create the above mentioned.

RightClick.jpg

GUI (Graphical User Interface)
A graphical user interface, is a particular case of user interface for interacting with a computer which employs graphical images and widgets in addition to text to represent the information and actions available to the user.
Usually the actions are performed through direct manipulation of the graphical elements.

Trigger Functions: "ECA" (Events, Conditions & Actions)

sticky.gif
Note; each individual trigger can be created using various of countless (describing many) methods.
You will most likely come to discover that as you gain more experience.

There are 3 "categories" of trigger functions (Events, Conditions & Actions):
  • Trigger Functions
    • Events
    • Conditions
    • Actions
Notice, that these could be compared with the "cause and effect" theory. The cause and effect (Event and Action) with an optional "Condition" included.
When the event(s) occur, all conditions are met, the action(s) will take place.

Events.gif Events
A trigger will start when any of the events listed occur.
Note; you can "run" a trigger from another trigger without having those events occuring.

Condition.gif Conditions
Conditions are specific requirements which the trigger must observe.
It cannot perform it's actions unless all the condition requirements have been covered.
Note; that you can have 'And' / 'Or' conditions as well. Triggers that are run from another trigger have the option to ignore these conditions.

Actions.gif Actions
If the event occurs, all conditions have been met, then this is the action(s) that the trigger will perform.
Note; that you can may 'Run' other triggers or turn other triggers OFF or ON as well.

sticky.gif
Note; You may put any new triggers in the original Melee Initialization category created by the world editor, but you are not obligated to.
Categories have no influence on the functionality of the trigger, so it doesn't matter which order you put them in.

Enable, Initially On & Trigger Comments
Notice that there are 3 fields at the top of each trigger (highlight'ed below).
TriggerFields.jpg
  • Enabled - Determines whether or not the trigger is enabled in your map. If 'disabled', the trigger has no function.
  • Initially On - Triggers can be turned ON and OFF. When checked, the trigger will initially be ON when the game begins.
  • Trigger Comment - Is a text field area where you can add any comments regarding the specific trigger. Keep in mind that it has no impact on functionality.

Trigger Examples
Below is shown some basic trigger samples.

Opening A Gate #1 Events.gifActions.gif
In this example, I will demonstrate a way to open a Gate without any condition(s).
Here's the trigger i'm using:
  • Gate
    • Events
      • Destructible - Lever 0039 <gen> dies
    • Conditions
    • Actions
      • Destructible - Open Gate (Horizontal) 0038 <gen>
Gate.jpg

Opening A Gate #2 Events.gifCondition.gifActions.gif
In this example, I shall demonstrate a way to open a Gate with a condition.
Here's the trigger:
  • Gate
    • Events
      • Destructible - Lever 0039 <gen> dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Destructible - Open Gate (Horizontal) 0038 <gen>
Gate2.jpg

The Sunken Brigde Events.gifCondition.gifActions.gif
Here's the trigger i'm using for this demonstration:
  • Sunken Brigde
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to Player 1 (Red)
    • Actions
      • Destructible - Resurrect Short Natural Bridge (Vertical) 0000 <gen> with 2500.00 life and Show birth animation
      • Animation - Change Short Natural Bridge (Vertical) 0000 <gen>'s animation speed to 95.00% of its original speed
      • Trigger - Turn off (This trigger)
showregion.jpg

Brigde.jpg

The Specific Key
Coming soon...

Links



To be continued »
 
Level 1
Joined
Aug 23, 2007
Messages
3
hey ive just started war3 modding and i would rly like to now to to set a unit patrol on a target region because im been trying for ages.
 
Level 12
Joined
Aug 20, 2007
Messages
866
I like this

This looks like it could be a tremendously great tutorial if it was continued

I would also suggest adding in a little section on loops, how they work and what they do, but add that later, much later so players don't get overwhelmed
 
Level 2
Joined
Sep 1, 2007
Messages
7
That helps alot (10/10)

I just started trigger modding and i am amazed at how many things I can do with them

World editor is one of the easiest-to-use editors I've ever used
(UT04,Gmax,and EA command and conquer are the worst.)

your tutorial is genius (for all the new modders)!!!
 
Level 1
Joined
Jan 3, 2008
Messages
2
yea how do i make my units look like they are walkin on the walls cuz i got some models and i have no idea how to make them walk on the models do i have to make a trigger to make them fly or somthing
 
Level 2
Joined
Aug 30, 2007
Messages
23
This is most helping, thank you oh repped one...

Im very glad about this, since im kinda a newbie in triggers and other stuff... am good at terraining of course... ANYWAY just wanted to thank you... do something else now... don't keep reading... :slp:
 

Archian

Site Director
Level 64
Joined
Jan 1, 2006
Messages
3,106
yea how do i make my units look like they are walkin on the walls cuz i got some models and i have no idea how to make them walk on the models do i have to make a trigger to make them fly or somthing
I made this tutorial long ago, might be of use to you.
I think I posted it here at the Hive as well, but I'll redirect you to it here: http://www.wc3campaigns.net/showthread.php?t=85356

Now any further questions should be posted in the World Editor Help Zone forum.
 
Level 1
Joined
Jan 4, 2009
Messages
7
how do u get the lever?

Press the 'Object manager', then go to 'Destructibles', open the folder 'Trees/Destructibles' in there you can find the Lever. Right click it when you've fount it and click on 'Select in tool palette', now you can create levers!

Hope this brings abit help to you! :smile:
 
Level 1
Joined
Jan 4, 2009
Messages
7
By the way, great help Archian!
Opening a gate #1 and The sunken bridge, worked perfectly. But Opening a gate #2 didn't work out for me .. I wonder why :confused:
Anyways, as I've already said great help! +rep :thumbs_up:
 
Level 3
Joined
Mar 1, 2014
Messages
41
Hello! I am TOTALLY new on this, I've been checking out your tutorial and I do get it perfectly! VERY nice thank you VERY much! :)

But a little question, if I want the door to be 'Invulnerable' so it can't be destroyed and the only way to open it would be the lever, what shall I do?

Thank you!
 
Hello! I am TOTALLY new on this, I've been checking out your tutorial and I do get it perfectly! VERY nice thank you VERY much! :)

But a little question, if I want the door to be 'Invulnerable' so it can't be destroyed and the only way to open it would be the lever, what shall I do?

Thank you!

You would simply make a trigger on map initialization to make the gate invulnerable:
  • Invulnerable Gate
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Destructible - Make (Gate 0001 <gen>) Invulnerable
 
Level 1
Joined
May 13, 2018
Messages
2
Note, that the tutorial is still in progress. Feel free to post comments & suggestions for improval :)

Basics of Triggers
By Archian

My ten-year-old cousin has just started warcraft III modding, and has begun experimenting with the Trigger Editor.
I promised that I would make a little tutorial relating to how to make some *very* basic, but useful triggers for custom maps.
This tutorial is also meant as a source of information that may encourage newcomer's to start triggering and from there, develop their knowlege.
So when you're done reading this tutorial, go inside the World Editor and do some experimenting yourself :)
Click the images for larger versions.

The "target group" of this tutorial is of course; beginners.

Table of Content



48px-Warcraft_III_World_Editor.png
Introduction to The World Editors' "Trigger Editor"
The trigger editor is where the map script is written, either in GUI triggers or directly in JASS.
The map script controls any in-game events not dictated by the user. Triggers are essential for creating maps with complicated goals and atmosphere.

Trigger Editor: (Menu Bar\Module\Trigger Editor) View attachment 4505

View attachment 4507
(From left to right: Variables... (Ctrl+B), New Category (Ctrl+G), New Trigger (Ctrl+T), New Trigger Comment (Ctrl+M), New Event (Ctrl+E), New Condition (Ctrl+D), New Action (Ctrl+R).

Button:Functions:
View attachment 4508Variable Editor ~ MrApple's Beginner's Guide to Variables.
View attachment 4498Creates a new category for triggers; useful in custom maps with many triggers to keep a better overview.
View attachment 4501Creates a new trigger.
View attachment 4504A "comment category" which you can use for "headlines" under (for example) categories so each trigger "group" is kept well organized.
View attachment 4500Creates a new event for a trigger.
View attachment 4499Creates a new condition for a trigger.
View attachment 4497Creates a new action for a trigger.

Of course, you can just right-click on the list, a trigger or a category to create the above mentioned.

View attachment 4502

GUI (Graphical User Interface)
A graphical user interface, is a particular case of user interface for interacting with a computer which employs graphical images and widgets in addition to text to represent the information and actions available to the user.
Usually the actions are performed through direct manipulation of the graphical elements.

Trigger Functions: "ECA" (Events, Conditions & Actions)

sticky.gif
Note; each individual trigger can be created using various of countless (describing many) methods.
You will most likely come to discover that as you gain more experience.

There are 3 "categories" of trigger functions (Events, Conditions & Actions):
  • Trigger Functions
    • Events
    • Conditions
    • Actions
Notice, that these could be compared with the "cause and effect" theory. The cause and effect (Event and Action) with an optional "Condition" included.
When the event(s) occur, all conditions are met, the action(s) will take place.

View attachment 4494 Events
A trigger will start when any of the events listed occur.
Note; you can "run" a trigger from another trigger without having those events occuring.

View attachment 4493 Conditions
Conditions are specific requirements which the trigger must observe.
It cannot perform it's actions unless all the condition requirements have been covered.
Note; that you can have 'And' / 'Or' conditions as well. Triggers that are run from another trigger have the option to ignore these conditions.

View attachment 4491 Actions
If the event occurs, all conditions have been met, then this is the action(s) that the trigger will perform.
Note; that you can may 'Run' other triggers or turn other triggers OFF or ON as well.

sticky.gif
Note; You may put any new triggers in the original Melee Initialization category created by the world editor, but you are not obligated to.
Categories have no influence on the functionality of the trigger, so it doesn't matter which order you put them in.

Enable, Initially On & Trigger Comments
Notice that there are 3 fields at the top of each trigger (highlight'ed below).
View attachment 4506
  • Enabled - Determines whether or not the trigger is enabled in your map. If 'disabled', the trigger has no function.
  • Initially On - Triggers can be turned ON and OFF. When checked, the trigger will initially be ON when the game begins.
  • Trigger Comment - Is a text field area where you can add any comments regarding the specific trigger. Keep in mind that it has no impact on functionality.

Trigger Examples
Below is shown some basic trigger samples.

In this example, I will demonstrate a way to open a Gate without any condition(s).
Here's the trigger i'm using:
  • Gate
    • Events
      • Destructible - Lever 0039 <gen> dies
    • Conditions
    • Actions
      • Destructible - Open Gate (Horizontal) 0038 <gen>
View attachment 4496

In this example, I shall demonstrate a way to open a Gate with a condition.
Here's the trigger:
  • Gate
    • Events
      • Destructible - Lever 0039 <gen> dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Destructible - Open Gate (Horizontal) 0038 <gen>
View attachment 4495

Here's the trigger i'm using for this demonstration:
  • Sunken Brigde
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to Player 1 (Red)
    • Actions
      • Destructible - Resurrect Short Natural Bridge (Vertical) 0000 <gen> with 2500.00 life and Show birth animation
      • Animation - Change Short Natural Bridge (Vertical) 0000 <gen>'s animation speed to 95.00% of its original speed
      • Trigger - Turn off (This trigger)
View attachment 4503

View attachment 4492

The Specific Key
Coming soon...

Links



To be continued »
I have a question?
Will the trigger will work withlut the event just conditions and actions?
 
Level 5
Joined
Aug 15, 2022
Messages
96
I apologize for posting here but I have a question, I am making private edits on a map that has a "pick a race" trigger so I wanna change the name of that one race, how can I do that? pleas can anyone tell me
 
Top