Hey there! Welcome register/Sign in here!

A new warcraft 3 Modding site.
HomePortalCalendarGalleryFAQSearchMemberlistUsergroupsRegisterLog in

Share | 

 Simple Unit Triggering Tutorial

View previous topic View next topic Go down 
Jr. Staff Member
Jr. Staff Member

Warning :
Level : 1
Power : 1
Int: : 1
HP: : 1
My Pet :
Posts : 43
Reputation : 3
Join date : 2011-09-24
Age : 19
Location : Lincoln, Nebraska

Character sheet
Character Sheet:

PostSubject: Simple Unit Triggering Tutorial   Sat Sep 24, 2011 10:46 pm

NOTE: I added this both to tutorials and Triggers, not knowing which one it would fit more. Feel free to move/remove one. ~Stygian_Shadow


So you've played with the World Editor, terrained a map, created some custom units for it, and realized nothing happened. This is because you need triggers. In this tutorial, I will teach you about these triggers.


Ok, so first of all, open a map in the World Editor or JNPG. Go to the Trigger Editor and remove the Map Initialization folder. Create a new folder titled "Triggering" and a new subfolder titled "Part I." We will be starting with a very simple way to spawn a unit, advancing it after each step.
First, create a "Map Initialization" event under the Part I subfolder. Next, go to Actions - Unit - Create Units Facing Angle, then change the unit to a Rifleman (Click on Create 1 FOOTMAN and change it to RIFLEMAN) , and change the number to 2. Keep the player as 1 and the center of the map as the location. Now, whenever you start the game, 2 rifleman will appear on the map's center.
Somebody who did searching could probably figure that out, so let's make it a little bit more complicated.
We're going to make this happen only if Player 1 (Red) is in game. To do this, go back to the trigger and instead go to Conditions. Go to Player - Player Slot Status Comparison. It should say Player 1 (Red) slot status)) is equal to playing (or something like that.) Hit ok. Now if the player is not used or is a computer, the rifleman will not spawn.
Let's go really advanced now.
Create a new subfolder titled Part I: Advanced.
It should be empty. Instead of Map Initialization, this time choose Generic Unit Event - A Unit Dies.
Make the conidtions "Unit-type of dying unit is equal to Arthas (with Frostmourne)."
Place a Arthas (with Frostmourne) unit on the map near enemies on the map so you can see what happens.
Last of all, make an action that says "Instantly revive (Dying Unit) at (Position of Dying Unit), Hide Revival Graphics" and one that says "Kill (Killing Unit)." The first one will be under Hero (Revive INstantly), the second one Under Unit - Kill. Doing this will make your dying unit (in this case Arthas) revive at his last location and kill the unit that killed him. If you only want this to happen once (making him only revive once and kill the unit that killed him), simply put Trigger - Turn Off (This Trigger) at the beginning before any actions happen. Running this twice or more before it turns off will require and integer variable. If you need this, contact me on WCIII (Stygian_Shadow) or on here, because it takes a long time to explain.


Create a new subfolder titled Part II. This is the opposite of the one we just made, where if you kill a unit it updates your quest or something. Let's start basic again. Make a trigger that says Event - Generic Unit Event - Unit Dies, a condition that say Unit-Type of Dying Unit Equal to (whichever unit you want - place him on the map. Make sure an enemy controls this unit), and an action that says Game - Victory. This will give victory to the player that kills the certain unit.

Now if both the teams have the same unit and you only want one of them to win if they kill this unit, delete the condition you have - not the events or actions.
Instead of that condition make an "And." For Condition 1 make the condition you just had. Make Condition 2 "Player - Owner of (Dying Unit) equal to Player 2 Blue." Now only opponents of blue will win if they kill the unit. You can also make the second one "Player - Owner of (Killing Unit) equal to Player 1 Red." so that only red can win if they kill the footman.

Now let me show you how to make it so that multiple units have to die for you to win. So there are 12 footman you have to kill, all owned by player 2 (Blue) and you have to kill all 12. Simply run the same event and action, but make the condition "Integer - Number of units in ((units owned by player blue of Footman is equal to 0." This will make it so that when there are 0 footmen owned by player 2 blue, you will win. If you have 3 different units that you need to kill, make an "And (Multiple Conditions" followed by 3 of the triggers, like for example:

"Integer - Number of units in ((units owned by player blue of Footman is equal to 0."
"Integer - Number of units in ((units owned by player blue of Rifleman is equal to 0."
"Integer - Number of units in ((units owned by player teal of Priest is equal to 0."
This will make it that when blue is out of footman and rifleman, and teal is out of priests, red wins.
If you want to destroy an entire enemy, you don't have to spam all their units into this though. All you have to do is:
"Integer - Number of units in ((units owned by player blue)) equal to 0. "
Not selecting the unit type.
I hope this helped, and I will soon supply more triggering tutorials. You may ask any questions below, and I will also answer any triggering questions here.
Back to top Go down
View user profile http://www.worldofterrosia.ucoz.com

Warcraft3 Account Name: : Asip
Warning :
Level : ??Unknown??
Power : 9999999999
Int: : 9999999999
HP: : 9999999999
My Pet : Masters Pet(asips)
Posts : 52
Reputation : 18
Join date : 2011-09-12
Age : 29

Character sheet
Character Sheet: I am the almighty Gamemaster.

PostSubject: Re: Simple Unit Triggering Tutorial   Sun Sep 25, 2011 12:24 am

Nice Tutorial.

"You see that I was right! The truth is written in blood!" -Darth Revan
Back to top Go down
View user profile http://warcraftiii.forumotion.com
Simple Unit Triggering Tutorial
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
» Great Tank and Weathering tutorial
» I.C.U. (Intensive Care Unit) Clan
» Power Sword Tutorial (with more to follow)
» Most powerful 40k unit
» Instant Mold Tutorial

Permissions in this forum:You cannot reply to topics in this forum
War3Modding :: Wc3 Modding :: World Editor Help :: Tutorials-
Jump to: