• 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.

GUI Trigger Help Map - Beginner Map Makers

Level 8
Joined
May 7, 2007
Messages
278
~~~~GUI Trigger Help Map~~~~
-------The Basics of WE--------

Those new to map making who want to learn simple GUI triggering might want to take a look at this map. This map will help people starting World Editor and want some extra help learning simple triggers to get started. Before I get started, here are some links that definatly helped me once I got the basics of triggering.

Contents:
1A - Links
2A - What to do once you have the map
3A - What to do do once the map is open (Opening
the trigger editor)
4A - Describing a trigger / Parts in a trigger
5A - Copying the trigger into your map
6A - Spawning a unit without using a building while still requiring resources
7A - Describing parts in the Spawning a Unit while requiring resources trigger

1A Other links that might help:
http://world-editor-tutorials.thehelper.net/cat_usersubmit.php - VERY useful for those who know the basics of triggering up to advanced triggering and want to learn things like creating a TD, tips on creating good terrain or effective triggers, and more.

http://www.wc3campaigns.net/showthread.php?t=81478 - Bob27's game cache tutorial, suggested to users who know triggers fairly well. What is a game cache? If you've played any of Blizzard's campaigns you have used game caches. Click on the tutorial site for more details.

http://www.wc3campaigns.net - Read their forums on triggering, they can be useful.

HIVE WORKSHOP!!!! - Read other triggering forums for a lot of advanced help for GUI and JASS.

Now that you know some helpful links once you know the basics of triggering, you'll be able to do some cool stuff, like creating tower defenses, game caches, and other things!

2A Once you download the map, you may want to open up the World Editor. If you have a shortcut to it, it'll be simple. Double-click on the icon (of course) and it'll load. If you dont have a shortcut, follow these simple steps:
  1. Open up the start menu.
  2. Go to all programs
  3. Find "Warcraft III" and open the Warcraft III World Editor

After you've done that, I'd suggest you create a shortcut.

3A Now that Warcraft III WE is open, open the map. To open the map, press Ctrl+O. Find the folder you saved the map in. The map name should be TestMapUSE. Now that it's open, you'll see a lot of stuff on the map, ignore them for right now.

Now, press F4 to open the trigger editor. You will notice a lot of triggers and folders on the screen. Take a few moments to look at the triggers and understand them a little.

4A I'll make an example of a simple trigger and how it is used. (Taken from the map)

  • Spawning a Unit
  • Events
    • Player - Player 1 [Red] types a chat message containing orc as An Exact Match
  • Conditions
    • None, I'll talk about that later on.
  • Actions
    • Set Point1 = [Position of Spawner Guy 0033 <gen>
    • Unit - Create 1 Grunt for Player 1 [Red] at Point1 facing [Position of [Triggering Unit]]

The event is what starts the action. In this case, if Player 1 types orc with no other chat, it will spawn an orc. Now to get into detail.

Event - Player 1 [Red] - The player that does the event.
Event - Types a chat message containing orc as an Exact Match - If the player just types in orc then the orc will be spawned, which means he cant type "spawn orc" or "hi orc" he has to just type "orc" in order for it to spawn.
__________________________________________
Conditions - Usually there is a condition. How does a condition work? Heres an example "Ability Being Cast Equal To [Animate Dead]". In order for this condition to be in effect, the event has to be something like, "Unit Begins Casting an Ability]. In this case, the condition defines what ability he is casting.
__________________________________________
Action - Set Point1 = [Position of Spawner Guy 0033 <gen> - This is a variable. Variables can be opened by pressing Ctrl+B in the trigger editor. The varible is being set to Spawner Guy, a unit in the game. This means once the unit is created, it will be created and Point1, the Spawner Guy.
Action - Unit - Create 1 Grunt for Player 1 [Red] at Point1 facing [Position of [Triggering Unit]] - Creates one Grunt (Unit) for player 1 at Point1 (the spawner guy) facing downwards.

Before
BeforeOrc1.jpg

After
AfterOrc2.jpg
And there you go. Thats how to spawn an orc beside the unit you want him to spawn by without using a building.

5A To copy a trigger to your map, or the whole folder, click on the trigger/folder and do ctrl+c. It should now be in your clipboard. Open your map, and go to the trigger editor. Press ctrl+v. It should now be copied to your map. Make sure you customize everything to fit into your map.

6A Now, if you've completed the simple spawning using a chat message, lets get advanced. Spawning a unit by using resources WITHOUT requiring a building to spawn it. Heres where we get into condtions.


  • Spawning a Unit Using Resources
  • Events
    • Player - Player 1 [Red] types a chat message containing orc as An Exact Match
  • Conditions
    • None, see Actions for reason
  • Actions
    • Set Point1 = [Position of Spawner Guy 0033 <gen>]
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Player 1 (Red) Current gold) Greater than or equal to 150
      • Then - Actions
        • Unit - Create 1 Grunt for Player 1 (Red) at Point1 facing (Position of (Triggering unit))
        • Player - Set Player 1 (Red) Current gold to ((Player 1 (Red) Current gold) - 150)
        • Game - Display to (All players) the text: You have been given an orc at the cost of 150 gold.
      • Else - Actions
        • Game - Display to (All players) the text: You do not have enough money to buy this unit.
7A
This trigger could be helpful in maps that you allow players to buy units at the position of their hero. All you have to do is change the Set Variable trigger to the hero, and change Grunt to whatever unit you want, and also change the event to say something else. Now that we've seen the trigger, most of you know exactly where to find them all, if you dont let me help you, and read below.

Event - Player - Player 1 [Red] types a chat message containing orc as An Exact Match: Look above, we went over that already.
__________________________________________
Conditions - There are no conditions in the main part, however, there is in the If,then,else trigger. So lets look at that. If Player 1 Red has exactly 150 gold OR greater than 150 gold it will allow him to purchase the orc. However, if he doesnt, it will go to the "Else" function.
__________________________________________
Action - We first use Set Point1 at Spawner Guy, once again, to make sure it spawns at him.

Then use the If,Then,Else multiple functions trigger. It will create a condtion, and two trigger areas.

The "Then" area is what happens if the condition is true. The "Else" are is what happens if the condition is false.

So in the "Then" area, we want the player to spawn an orc if he has enough money. First put Create 1 Grunt for Player 1 Red at Point1. That will create it. Then use the Player trigger, Set Property, and use Arithmatic, so It should be [Player 1 Red's current Gold] - 150 (minus 150 gold).

Then we place a Game - Display trigger, telling him the unit was purchased. "You have been given an orc at the cost of 150 gold"

NOW lets move on to the Else, this is the simple part. Simply put a Display trigger saying "You do not have enough money to buy this unit".

And there you have it! Theres your purchasing system!

You have to change the event to Player 2 Blue or Player 3 Teal etc. in order for other players to spawn them. I will post more if I can later.
___________________________________________________________
And there you go! :infl_thumbs_up: If you have made it this far, you have either completed and looked over all the steps or skipped ahead :hohum:

If you have any questions or comments, post in the thread.
 

Attachments

  • TestMapUSE.w3x
    846.4 KB · Views: 70
Last edited:
Top