- Joined
- Jul 24, 2007
- Messages
- 308
Hello, in this toturial you will start as a beginner with GUI (even if you just start now), and in the end you will be an expert with it
First, open your world editor at your warcraft 3 directory, then create a new map (of your choice), then hit F4 or open the trigger editor from "Triggers".
Now you will see a new window opened, and you will see a "Trigger" looks like this:
Now create a new trigger (Press CTRL+T)
You will see something looks like this:
"Untitled Trigger 001" : this is the name of the trigger, you can edit it by right-clicking it then renaming it.
We will start from actions, just a matter of understanding the other functions.
"Actions" : Those are what a trigger is supposed to do, they are alot, they can be effects, creating(or moving) units, animations, AI, camera, cinematic, window, dialog, hero, sound, and so on..
You will wonder now, when and how do the actions happen?
"Events" : when an event happen, it runs the action(s) if the conditions happen
"Conditions" : Those are the event conditions for the action to happen, if they dont happen the action wont affect or work.
Below is an example of some triggers:
now lets see this trigger
If you understand that trigger, know you are getting much better!
Now lets use a trigger with conditions
hint : put a space before "Has been killed", just so it display correctly and not stick to the player's name.
now thats enough of examples, but dont stop here! never! there are two very dangeroes points that you should, you must know!
1-Varibales :These are just variables which are used to refer to a number/unit or any other thing.
Variables are very important to any map, without them any map goes very bad!
now lets get you started with the "Variables"
Hit CTRL+B then a new small window will appear, you will propably see a blank if you use a new map, anyway to create a new variable press CTRL+N!
Now you will see three fields that MUST be written:
Variable Name : The name of the variable which you will use.
Variable Type : This refers to the variable type which you will use, like you cant make a unit and a region refered of same variable, thats the use of the variable type.
[Checkable]Array : An arrayed trigger is useful for multiplayer maps. how?
it will reduce lag, save time, gives more functions to be used by you!
How do they look like? a non-array variable will just have name when referring to it, but an arrayed one will have the name AND a number which must be written behind it.
what the number? the number is the variable number of the one you will use, i will show you examples of variables with or without arrays below.
believe it or not, its very, very easy!
Lets explain this trigger:
When the game time is 5 seconds, the actions will excute instantly because there are no conditions!
actions: what those actions will do is they pick (take) all player (even if not playing), and make a variable of random unit which is created in a unit group.
Now you may see some use for arrays, the array of the variable unit in the last trigger will refer to the player's number. Cool if you understand it
Now lets get into something yet more important and harder (still its easy)
2-Leaks!
Leaks are what ruins ~80% of maps! they can be called "Lagness"
hmm if name is not enough, i will explain more.
this is an example of a leak
Every 2 seconds, any unit owned by player 1 (red) will be killed!
whats the leak?
The leak is the unit group which is "Units owned by player 1(Red) of type footman)", heres the way to fix them:
To know much more about leaks (which you must do), please refer to this link: http://www.hiveworkshop.com/forums/showthread.php?t=35124
Now you are advanced in GUI triggers if you fully understanded all above
Now i will give you useful tips which help you making triggers
-Always remove melee initialization trigger for any map
-Always avoid leaks! they will cause the game permanently lag!
-Try to compress actions with loops
-Try to use the If/Then/Else function, which is useful and looks alike mini trigger, it will check if the "IF" condition happens, it will run "Then" actions, but if the "IF" condition fails, it will run "Else" functions.
-Try to always use custom and cool stuffs, like effects, animations, systems and so on..
-Variables must be used in any map that is supposed to be "good"
-Try to learn JASS after long time of map making with GUI, JASS has more functions and more map optimizing, know your brain in future will automatically lead you to JASS if you be expert in GUI.
-Try to use triggered-spells in your map, with them many maps succeeded
If you have any comment post it, and if the tutorial has helped you please tell
sorry for some grammar mistakes )
First, open your world editor at your warcraft 3 directory, then create a new map (of your choice), then hit F4 or open the trigger editor from "Triggers".
Now you will see a new window opened, and you will see a "Trigger" looks like this:
-
Melee Initialization
-
Events
- Map initialization
- Conditions
-
Actions
- Melee Game - Use melee time of day (for all players)
- Melee Game - Limit Heroes to 1 per Hero-type (for all players)
- Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
- Melee Game - Set starting resources (for all players)
- Melee Game - Remove creeps and critters from used start locations (for all players)
- Melee Game - Create starting units (for all players)
- Melee Game - Run melee AI scripts (for computer players)
- Melee Game - Enforce victory/defeat conditions (for all players)
-
Events
Now create a new trigger (Press CTRL+T)
You will see something looks like this:
-
[COLOR="red"]Untitled Trigger 001
- Events
- Conditions
- Actions[/COLOR]
"Untitled Trigger 001" : this is the name of the trigger, you can edit it by right-clicking it then renaming it.
We will start from actions, just a matter of understanding the other functions.
"Actions" : Those are what a trigger is supposed to do, they are alot, they can be effects, creating(or moving) units, animations, AI, camera, cinematic, window, dialog, hero, sound, and so on..
You will wonder now, when and how do the actions happen?
"Events" : when an event happen, it runs the action(s) if the conditions happen
"Conditions" : Those are the event conditions for the action to happen, if they dont happen the action wont affect or work.
Below is an example of some triggers:
-
Untitled Trigger 001
-
Events
- Time - Elapsed game time is [COLOR="red"]4.00 [/COLOR]seconds
- Conditions
-
Actions
- Game - Display to (All players) the text: [COLOR="red"]Welcome to this map![/COLOR]
-
Events
now lets see this trigger
-
Untitled Trigger 001
-
Events
- Unit - A unit Dies
- Conditions
-
Actions
- Player - Set ([COLOR="red"]Owner of (Dying unit[/COLOR])) [COLOR="red"]Current gold[/COLOR] to ((([COLOR="red"]Owner of (Dying unit[/COLOR])) [COLOR="red"]Current gold) - 5[/COLOR])
-
Events
If you understand that trigger, know you are getting much better!
Now lets use a trigger with conditions
-
Untitled Trigger 001
-
Events
- Unit - A unit [COLOR="red"]Dies[/COLOR]
-
Conditions
- ((Dying unit) is A [COLOR="red"]Hero[/COLOR]) [COLOR="red"]Equal to True[/COLOR]
-
Actions
- Game - Display to (All players) the text: [COLOR="red"]((Name of (Owner of (Dying unit))) + Has been killed!)[/COLOR]
-
Events
hint : put a space before "Has been killed", just so it display correctly and not stick to the player's name.
now thats enough of examples, but dont stop here! never! there are two very dangeroes points that you should, you must know!
1-Varibales :These are just variables which are used to refer to a number/unit or any other thing.
Variables are very important to any map, without them any map goes very bad!
now lets get you started with the "Variables"
Hit CTRL+B then a new small window will appear, you will propably see a blank if you use a new map, anyway to create a new variable press CTRL+N!
Now you will see three fields that MUST be written:
Variable Name : The name of the variable which you will use.
Variable Type : This refers to the variable type which you will use, like you cant make a unit and a region refered of same variable, thats the use of the variable type.
[Checkable]Array : An arrayed trigger is useful for multiplayer maps. how?
it will reduce lag, save time, gives more functions to be used by you!
How do they look like? a non-array variable will just have name when referring to it, but an arrayed one will have the name AND a number which must be written behind it.
what the number? the number is the variable number of the one you will use, i will show you examples of variables with or without arrays below.
-
Untitled Trigger 001
-
Events
- Time - Elapsed game time is 5.00 seconds
- Conditions
-
Actions
-
Player Group - Pick every player in (All players) and do (Actions)
-
Loop - Actions
- Set Unit_Variable[(Player number of (Picked player))] = (Random unit from Unit_Group_Variable)
-
Loop - Actions
-
Player Group - Pick every player in (All players) and do (Actions)
-
Events
believe it or not, its very, very easy!
Lets explain this trigger:
When the game time is 5 seconds, the actions will excute instantly because there are no conditions!
actions: what those actions will do is they pick (take) all player (even if not playing), and make a variable of random unit which is created in a unit group.
Now you may see some use for arrays, the array of the variable unit in the last trigger will refer to the player's number. Cool if you understand it
Now lets get into something yet more important and harder (still its easy)
2-Leaks!
Leaks are what ruins ~80% of maps! they can be called "Lagness"
hmm if name is not enough, i will explain more.
this is an example of a leak
-
Untitled Trigger 001
-
Events
- Time - Every [COLOR="red"]2.00 [/COLOR]seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in ([COLOR="red"]Units owned by Player 1 (Red) of type Footman[/COLOR]) and do (Actions)
-
Loop - Actions
- Unit - Kill ([COLOR="red"]Picked unit[/COLOR])
-
Loop - Actions
-
Unit Group - Pick every unit in ([COLOR="red"]Units owned by Player 1 (Red) of type Footman[/COLOR]) and do (Actions)
-
Events
Every 2 seconds, any unit owned by player 1 (red) will be killed!
whats the leak?
The leak is the unit group which is "Units owned by player 1(Red) of type footman)", heres the way to fix them:
-
Untitled Trigger 001
-
Events
- Time - Every 2.00 seconds of game time
- Conditions
-
Actions
- Set Unit_Group_Variable = (Units owned by Player 1 (Red) of type Footman)
-
Unit Group - Pick every unit in Unit_Group_Variable and do (Actions)
-
Loop - Actions
- Unit - Kill (Picked unit)
-
Loop - Actions
- Custom script: call DestroyGroup(udg_Unit_Group_Variable)
-
Events
To know much more about leaks (which you must do), please refer to this link: http://www.hiveworkshop.com/forums/showthread.php?t=35124
Now you are advanced in GUI triggers if you fully understanded all above
Now i will give you useful tips which help you making triggers
-Always remove melee initialization trigger for any map
-Always avoid leaks! they will cause the game permanently lag!
-Try to compress actions with loops
-Try to use the If/Then/Else function, which is useful and looks alike mini trigger, it will check if the "IF" condition happens, it will run "Then" actions, but if the "IF" condition fails, it will run "Else" functions.
-Try to always use custom and cool stuffs, like effects, animations, systems and so on..
-Variables must be used in any map that is supposed to be "good"
-Try to learn JASS after long time of map making with GUI, JASS has more functions and more map optimizing, know your brain in future will automatically lead you to JASS if you be expert in GUI.
-Try to use triggered-spells in your map, with them many maps succeeded
If you have any comment post it, and if the tutorial has helped you please tell
sorry for some grammar mistakes )