(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > Warcraft III Tutorials > Trigger (GUI) Editor Tutorials

Trigger (GUI) Editor Tutorials Contains tutorials concerning the usage of GUI features.
Read the Rules before posting.

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 01-03-2006, 03:11 PM   #1 (permalink)
Owner, Developer & Technical Director
 
Ralle's Avatar

WoW! StarCraft II
 
Join Date: Oct 2004
Posts: 6,629

Ralle has disabled reputation (1490)Ralle has disabled reputation (1490)Ralle has disabled reputation (1490)Ralle has disabled reputation (1490)Ralle has disabled reputation (1490)Ralle has disabled reputation (1490)Ralle has disabled reputation (1490)


Basic Triggering

Introduction
This tutorial describes the difference between Events, Conditions and Actions.
I will show some examples along the way and help you to understand the effects and power of triggers.
We have many things to do, so let's get started.

To begin we must create a new blank trigger using WE’s Trigger Editor. Press F4 on your keyboard or select the lowercase “c” button on the toolbar. Now select New>Trigger from the trigger menu and…presto! A new trigger is born.
Untitled Trigger 001
Events
Conditions
Actions
Let’s give our triggers names to make them easy to identify. When new triggers are created, you always have the option to give them unique names. If you forget, in the left hand pane, double click on the trigger you want to rename and enter a name for it.

Events
Events are the functions that “trigger” your triggers.
For example, when you make a timed bomb, the event will activate the trigger when the timer reaches 0.
We can make simple events for triggers by right clicking on the event and selecting “New Event.” The Configure Event window then opens and displays Map Initialization as the default event. We’ll chose a different event for our first trigger so scroll down the list until you find Unit - Generic Unit Event and select it. The default event in this category is A Unit Dies and this is the event that we want. Notice how the word “Dies” is colored and underlined? This means that you can change the value for that field to a variety of other generic unit events. For now, let’s leave it alone and proceed.
Unit Dies
Events
Unit - A unit Dies
Conditions
Actions
This trigger will start every time a unit dies.

To create a timed trigger select the event: Time - Periodic Event.
The default value for this event is two seconds. Let’s edit this value so that our trigger fires every minute. Click on the underlined and colored 2.00 and a window opens that allow us to change this value to any real number. Use the tiny arrow button or type in 60 to make the change.
Timed Trigger 001
Events
Time - Every 60.00 seconds of game time
Conditions
Actions
This trigger will start every 60 seconds of the game.

For a region specific event use: Unit - Unit Enters Region.
Unit Enters Region
Events
Unit - A unit enters Region 000 <gen>
Conditions
Actions
This trigger will start when a unit enters a region (regions are made in Terrain Editor, Region Palette)

Conditions
Conditions are present to make your trigger run only under certain conditions. In the above example, the trigger would fire when any unit owned by any player enters Region 000. Say you wanted only certain units or players to trip the trigger?

Let's just add a simple condition to our trigger to make only certain unit types operate it. Again, right click on the condition to create a new one. Since the default condition is Boolean Comparison, scroll down and select Unit Type Comparison. This applies the condition:
Unit Enters Region
Events
Unit - A unit enters Region 000 <gen>
Conditions
(Unit-type of (Triggering unit)) Equal to Footman
Actions
This is the trigger from above, the one where a unit enters a region. This time, the trigger will only be executed if the entering unit is a Footman.

Another simple condition would allow only a certain player (or players) to set off the trigger:
Unit Enters Region
Events
Unit - A unit enters Region 000 <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 1 (Red)
Actions
Under this condition the trigger would affect only units owned by Player 1.

This condition would qualify our timed trigger:

We could also add a condition like this:
Unit Dies
Events
Unit - A unit Dies
Conditions
(Unit-type of (Dying Unit)) Equal to Archer
Actions
This is the example we used before, the one where a unit dies. But the difference is that this time the trigger will only be executed if the Dying unit is an Archer.

Conditions are necessary for a trigger to work properly but that doesn't mean that you will be forced to use them in order to make the trigger work.

Actions
Actions are the main part of a trigger. If we take the example from before with the bomb, this will be the explosion of your bomb.
So when something triggers your event, it checks if it matches the conditions (if they exist). Then it runs your actions.
So here we have our trigger again. The one with the dying archer:
Unit Enters Region
Events
Unit - A unit Dies
Conditions
(Unit-type of (Entering unit)) Equal to Archer
Actions
Unit - Create 2 Archer for (Owner of (Dying unit)) at (Center of (Playable map area)) facing Default building facing (270.0) degrees
This trigger will endlessly create 2 archers when one dies and could cause the game to crash because it will create archers all the time.

Unit Enters Region
Events
Unit - A unit enters Region 000 <gen>
Conditions
(Unit-type of (Entering unit)) Equal to Footman
Actions
Unit - Kill (Entering unit)
This is another example, the one where a footman enters a region. This time it also has an action. When the footman enters the region, the trigger action kills it.

All my examples have only one event, one action and one condition. They could have an unlimited of each, like this more advanced trigger:
Unit Enters Region
Events
Unit - A unit enters Region 000 <gen>
Conditions
(Unit-type of (Entering unit)) Equal to Footman
(Owner of (Entering unit)) Equal to Player 3 (Teal)
Actions
Unit - Kill (Entering unit)
Again the same trigger with the footman but this time the owner of the footman has to be player 3.

You could also make a trigger like this:
Unit Dies
Events
Unit - A unit Dies
Conditions
(Unit-type of (Dying unit)) Equal to Archer
Actions
Unit - Create 2 Archer for (Owner of (Dying unit)) at (Center of (Playable map area)) facing Default building facing (270.0) degrees
Unit - Change ownership of (Last created unit) to (Owner of (Killing unit)) and Change color
This trigger is the same example with the dying archer again: it creates 2 archers. But now it also takes the last created unit, which is an archer, and changes the owner of it to the owner of the unit that killed your archer in the first place.

I hope you learned something about this subject and that it wasn't a waste of our time. I’m sure that you now realize that the question: "is it an event, a condition, or an action???" is unnecessary and you will always know just how to make a trigger. Beginning trigger editors should start simple, learn some of the many options available, and practice, practice, practice!

Last edited by Wolverabid; 03-26-2007 at 08:07 PM.
Ralle is offline  
Old 04-03-2007, 03:25 PM   #2 (permalink)
 
xXMephistoXx's Avatar

Born into Attitude!
 
Join Date: Sep 2006
Posts: 545

xXMephistoXx is on a distinguished road (70)xXMephistoXx is on a distinguished road (70)


Basic Trigger Functions

OK, the first function we're going to look at is creating a unit:
First of we create ourselves an Event. It creates many possibilities for different things we can do. We do not NEED an event, we could also use another trigger to activate this Trigger, but then that Trigger would require an Event...
We also sometimes have 1 or more conditions which makes the Event more specific.
In the End, there are Actions, this is what happens when the Event is activated and (sometimes) the Condition is right.

Note: Words underlined like this Word is words you can replace with your own. Like No unit = 013 Paladin

For example we can let one or more units spawn periodically:
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
Unit - Create 1 Footman for Player 1 (Red) at (Center of [u](Playable map area)[/u]) facing Default building facing degrees

Or... We can spawn one or more units when a unit enters a region, read Archian's Tutorial on Regions
Events
Unit - A unit enters [u]No region[/u]
Conditions
Actions
Unit - Create 1 Footman for Player 1 (Red) at (Center of [u](Playable map area)[/u]) facing Default building facing degrees

We can also only use this Trigger if a specific unit enters the Region:
Events
Unit - A unit enters [u]No region[/u]
Conditions
((Triggering unit) is [u]A Hero[/u]) Equal to True
Actions
Unit - Create 1 Footman for Player 1 (Red) at (Center of [u](Playable map area)[/u]) facing Default building facing degrees

Now we are going to take a look at Special Effects. Jazz is much more "unlaggy" at this, but that's not what this tutorial is for...

A Trigger which makes abilities look cooler than before with Triggers. Is also possible simply with Buffs:
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to [u]Animate Dead[/u]
Actions
Special Effect - Create a special effect attached to the [u]origin/overhead/hand right/ hand left/foot right/foot left/head/chest[/u] of [u](Triggering unit) using [u]Abilities\Spells\Human\Avatar\AvatarCaster.mdl[/u]

Making a unit go. Can also use AI, much better...
Events
Unit - A unit enters [u]No region[/u]
Conditions
((Triggering unit) is [u]A Hero[/u]) Equal to True
Actions
Unit - Set Rally Point for [u](Triggering unit)[/u] to (Center of [u]No region[/u])

Teleporting a unit:
Events
Unit - A unit enters [u]No region[/u]
Conditions
((Triggering unit) is [u]A Hero[/u]) Equal to True
Actions
Unit - Move [u](Triggering unit)[/u] to (Center of [u]No region[/u])

These two last Triggers we can also use for many units:
Making units go. Can also use AI, much better...
Events
Unit - A unit enters [u]No region[/u]
Conditions
Actions
Unit Group - Pick every unit in (Units in [u]No region[/u]) and do (Unit Set Rally-Point for (Picked Unit) to (Center of [u]No region[/u]))

Teleporting units:
Events
Unit - A unit enters [u]No region[/u]
Conditions
Actions
Unit Group - Pick every unit in (Units in [u]No region[/u]) and do (Unit Move (Picked Unit) instantly to (Center of [u]No region[/u]))

Cinematics (have to be done before, but I'll look at them anyway):
Events
Map initialization
Conditions
Actions
Cinematic - Turn cinematic mode On for [u](All players)[/u]
Cinematic - Clear the screen of text messages for [u](All players)[/u]
Cinematic - Turn on letterbox mode (hide interface) for [u](All players)[/u]: fade out over 0.00 seconds
Cinematic - Disable user control for [u](All players)[/u]

When we are in Cinematic, we often have messages from units in game:
Events
Unit - A unit enters [u]No region[/u]
Conditions
(Unit-type of [u](Triggering unit)[/u]) Equal to [u]Paladin[/u]
Actions
Wait [u]5.00[/u] seconds
Cinematic - Send transmission to [u](All players)[/u] from a [u]Player 1 (Red)[/u] [u]Footman[/u] named [u]Name[/u] at [u](Random point in (Playable map area))[/u]: Play [u]No sound[/u] and display [u]Message[/u]. Modify duration: Add [u]5.00[/u] seconds and [u]Wait[/u]

Now we have covered some of the most basic Triggering functions.

Last edited by xXMephistoXx; 07-09-2007 at 06:18 PM.
xXMephistoXx is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Spell Zephyria World Editor Help Zone 9 09-25-2007 05:12 PM
AOS Map Editing help (triggering/basic) JMan11 Map Development 2 08-31-2006 06:07 PM
Basic question, help Jaakko Texturing & Surfacing 2 05-31-2006 06:54 PM
Need basic triggering help with floating text Mattwashere Map Development 0 09-03-2005 05:31 PM
Gmax Basic Help Ryxian Modeling & Animation 1 09-09-2004 02:19 PM

All times are GMT. The time now is 05:19 PM.






Your link here 
Mobile Phone | Cheap Magazine | Bad Credit Mortgages | Online Advertising | Shares
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Copyright©Ralle