Tutorials

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

Black-Hole
Forum Fanatic
Posts: 315
Joined: October 16th, 2007, 7:32 pm

Tutorials

Post by Black-Hole »

Basic GUI Tutorials (Part 1 of 2)

Triggered Custom Spell
Spoiler:
This is my first tutorial so say if something is missing.
I did this for the people who don't know how to make triggered abilities work of course. You should know few things about triggering before doing this.

1.
First of all, create new map, size of 32x32. It should be big enough for this spell. This spell is going to be a "nova" like spell, so it needs space.

Now, go to object editor, to the Units category.
Make here the hero who casts the ability.
I created new custom unit from paladin and deleted his abilities.

2.
After that, go to Abilities category and make new custom ability from Fan of Knives. Now we need to remove missile art and effect from it. Then set damage per target and maximum total damage to 0.

I did some other changes to it that you don't need to do.

3.
Now, go to trigger editor and create new category and new trigger. Then make variables called:

Name - Type
Nova_Caster = Unit
Nova_Dummy = Unit (array 12)
Nova_Group = Unit Group
Nova_Point = Point
Nova_Angle = Real
Nova_Distance = Real
Nova_Around = Real (array 12)



After that we are going to start the triggering!
First we need event that responds to our need

Code: Select all

Events
   Unit - Unit Starts the effect of an ability
Without this condition it does the actions when you cast any spell. Make sure that you put your ability to the condition

Code: Select all

Conditions
   (Ability being cast) Equal to Lighning Nova
4.
Hold it! Back to object editor, to the units category! Are you going to do the nova without dummy unit? If you don't know what are dummy units I won't tell that in this tutorial. However, we are going to make one.
Now, create new unit based of a Footman and name it to Dummy Ball.
Remove all the abilites of our new dummy and add there abilities called:Invulnerable (Neutral) and Locust.

We use locust because we don't want to have dummy that you can select or dummy that stop going when wall comes to its way.

Changes in dummy:
Art - Model File = Chain Lighning <Missile.
Art - Shadow Image (Unit) = None.
Combat - Attacks Enabled = None.
Movement - Speed Base = 522
Movement - Type = Fly
Pathing - Collision Size = 0
Stats - Food Cost = 0
Stats - Sight Radius (Day) = 100
Stats - Sight Radius (Night) = 100

5.
Now the Dummy Ball should be ready for use. So, back to the trigger Editor.
Let's begin our trigger.
Now we use my style of creating dummies to the game (We use loop ).

Code: Select all

Actions
   Wait 0.20 seconds
   Set Nova_Caster = (Casting unit)
   Set Nova_Point = (Position of Nova_Caster)
   Set Nova_Angle = 0.00
   Set Nova_Distance = 0.00
   For each (Integer A) from 1 to 12, do (Actions)
       Loop - Actions
           Unit - Create 1 Dummy Ball for (Owner of Nova_Caster) at Nova_Point facing Nova_Point
There you see, it creates 12 balls to the point. But now we have to move the units to their own places. Just wait and read.

Code: Select all

Actions
   Wait 0.20 seconds
   Set Nova_Caster = (Casting unit)
   Set Nova_Point = (Position of Nova_Caster)
   Set Nova_Angle = 0.00
   Set Nova_Distance = 0.00
   For each (Integer A) from 1 to 12, do (Actions)
       Loop - Actions
           Unit - Create 1 Dummy Ball for (Owner of Nova_Caster) at Nova_Point facing Nova_Point
           Set Nova_Dummy[(Integer A)] = (Last created unit)
           Unit - Move Nova_Dummy[(Integer A)] to (Nova_Point offset by 20.00 towards Nova_Angle degrees)
           Set Nova_Angle = (Nova_Angle + 30.00)
There you see, it moves the Dummies to their points (from 0 to 360)
360/12 = 30 and we have 12 dummies created, so now they are there "systematically". Lets continue.

Code: Select all

Actions
   Wait 0.20 seconds
   Set Nova_Caster = (Casting unit)
   Set Nova_Point = (Position of Nova_Caster)
   Set Nova_Angle = 0.00
   Set Nova_Distance = 0.00
   For each (Integer A) from 1 to 12, do (Actions)
       Loop - Actions
           Unit - Create 1 Dummy Ball for (Owner of Nova_Caster) at Nova_Point facing Nova_Point
           Set Nova_Dummy[(Integer A)] = (Last created unit)
           Unit - Move Nova_Dummy[(Integer A)] to (Nova_Point offset by 20.00 towards Nova_Angle degrees)
           Set Nova_Angle = (Nova_Angle + 30.00)
   Unit - Pause Nova_Caster
   For each (Integer A) from 1 to 12, do (Actions)
       Loop - Actions
          Set Variable Nova_Around[(Integer A)] = (Angle from (Position of Nova_Caster) to (Position of Nova_Dummy[(Integer A)]))
   Wait for 0.20 seconds
   Unit - Unpause Nova_Caster
Now it sets variable Nova_Around to different for all arrays. We need that variable when we are making Dummy Balls to move. Now we have to stop making this trigger for a while.

6.
Now we are making the balls to move so, create new trigger. And lets start from the event of course. Turn the Initially off for this trigger.

Code: Select all

Events
   Time - Every 0.01 seconds of game time
We are going to make the Dummy Balls to move every 0.01 second.
No conditions are needed for this trigger.
So, we can go to the actions right away:

Code: Select all

Actions
    For each (Integer A) from 1 to 12, do (Actions)
        Loop - Actions
            Unit - Move Nova_Dummy[(Integer A)] instantly to (Nova_Point offset by Nova_Distance towards Nova_Around[(Integer A)] degrees
            Set Nova_Distance = (Nova_Distance + 0.10)
            Set Nova_Around[(Integer A)] =  (Nova_Around[(Integer A)] + 1.00)
7.
Okay, so now it moves unit away from the Nova_Point and it makes them move around it too.
That trigger is ready, but it doesn't go when you test? Of course not! Initially is off, so what we'll do now is open the first trigger. Okay.. The last thing we made to this trigger was the unpausing caster? Lets continue it:

Code: Select all

Actions
   Wait 0.20 seconds
   Set Nova_Caster = (Casting unit)
   Set Nova_Point = (Position of Nova_Caster)
   Set Nova_Angle = 0.00
   Set Nova_Distance = 0.00
   For each (Integer A) from 1 to 12, do (Actions)
       Loop - Actions
           Unit - Create 1 Dummy Ball for (Owner of Nova_Caster) at Nova_Point facing Nova_Point
           Set Nova_Dummy[(Integer A)] = (Last created unit)
           Unit - Move Nova_Dummy[(Integer A)] to (Nova_Point offset by 20.00 towards Nova_Angle degrees)
           Set Nova_Angle = (Nova_Angle + 30.00)
   Unit - Pause Nova_Caster
   For each (Integer A) from 1 to 12, do (Actions)
       Loop - Actions
          Set Variable Nova_Around[(Integer A)] = (Angle from (Position of Nova_Caster) to (Position of Nova_Dummy[(Integer A)]))
   Wait for 0.20 seconds
   Unit - Unpause Nova_Caster
   Trigger - Turn on "The trigger that you made a while ago" <gen>
   Wait for 6.00 seconds
   Trigger - Turn off "The trigger that you made a while ago" <gen>
   For each (Integer A) from 1 to 12, do (Actions)
      Loop - Actions
         Unit - Kill Nova_Dummy[(Integer A)]
Hold it again! That loop kills every Nova_Dummy [Every array from 1 to 12. But, something isn't right here... Oh! Memory leaks? Say idiot if im not right please! I'll show you all what I have in my pocket! Lets continue this:

Code: Select all

Actions
   Wait 0.20 seconds
   Set Nova_Caster = (Casting unit)
   Set Nova_Point = (Position of Nova_Caster)
   Set Nova_Angle = 0.00
   Set Nova_Distance = 0.00
   For each (Integer A) from 1 to 12, do (Actions)
       Loop - Actions
           Unit - Create 1 Dummy Ball for (Owner of Nova_Caster) at Nova_Point facing Nova_Point
           Set Nova_Dummy[(Integer A)] = (Last created unit)
           Unit - Move Nova_Dummy[(Integer A)] to (Nova_Point offset by 20.00 towards Nova_Angle degrees)
           Set Nova_Angle = (Nova_Angle + 30.00)
   Unit - Pause Nova_Caster
   For each (Integer A) from 1 to 12, do (Actions)
       Loop - Actions
          Set Variable Nova_Around[(Integer A)] = (Angle from (Position of Nova_Caster) to (Position of Nova_Dummy[(Integer A)]))
   Wait for 0.20 seconds
   Unit - Unpause Nova_Caster
   Trigger - Turn on "The trigger that you made a while ago" <gen>
   Wait for 6.00 seconds
   Trigger - Turn off "The trigger that you made a while ago" <gen>
   For each (Integer A) from 1 to 12, do (Actions)
      Loop - Actions
         Unit - Kill Nova_Dummy[(Integer A)]
   Custom script:  call RemoveLocation (udg_Nova_Point)
   Set Nova_Distance = 0.00
   Set Nova_Angle = 0.00
   Set Nova_Caster = No unit
8.
This have been too easy... Something is missing again, I thought that it was a perfect spell with all those long codes and things. What we have to do now is damaging? So, make new trigger again. Initially off for this trigger too.
Event for this trigger is:

Code: Select all

Events
   Time - Every 0.05 seconds of game time
We are making it to damage the enemy units every 0.05 seconds of game time.
In this trigger there are not conditions yet. Im not so sure about custom script that is waiting us in future, but say if Im not right. We use loop again to pick nearby enemy units.

Code: Select all

For each (Integer A) from 1 to12, do (Actions)
   Loop - Actions
This is the part where Im not sure what I do, but lets continue:

Code: Select all

For each (Integer A) from 1 to 12, do (Actions)
   Loop - Actions
      Custom script   set bj_wantDestroyGroup = true
      Unit Group - Pick every unit in (Units within 50.00 of (Position of Nova_Dummy[(Integer A)])) and do (Actions)
We used loop because of this... There is 12 dummies so we have to pick every nearby units of them. Continue

Code: Select all

For each (Integer A) from 1 to 12, do (Actions)
   Loop - Actions
      Custom script   set bj_wantDestroyGroup = true
      Unit Group - Pick every unit in (Units within 50.00 of (Position of Nova_Dummy[(Integer A)])) and do (Actions)
          Loop - Actions
             Set Nova_Group = (Last created unit group)
             If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Picked unit) Magic Immune) Equal to False
                    ((Picked unit) belongs to an ally of (Owner of Nova_Caster)) Equal to False
Okay.. So there it checks if the unit is ally of the caster or if it is magic immune. If it is either of them, then actions won't affect to them. Continue again:

Code: Select all

For each (Integer A) from 1 to 12, do (Actions)
   Loop - Actions
      Custom script   set bj_wantDestroyGroup = true
      Unit Group - Pick every unit in (Units within 50.00 of (Position of Nova_Dummy[(Integer A)])) and do (Actions)
          Loop - Actions
             Set Nova_Group = (Last created unit group)
             If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                   ((Picked unit) Magic Immune) Equal to False
                   ((Picked unit) belongs to an ally of (Owner of Nova_Caster)) Equal to False
                Then - Actions
                   Unit - Cause Nova_Caster to damage (Picked unit), dealing ((Real((Level of Lighning Nova for Nova_Caster))) x (Nova_Distance / 20.00)) damage of attack type Spells and damage type Normal
                Else - Actions
                   Do Nothing
That trigger is ready, now it damages all enemy units that aren't magic immunes. That damage thing is kinda simple, distance is about 600 at the end of the ability.

Level 1: 1 x (Nova_Distance / 20.00) = 30
Level 2: 2 x (Nova_Distance / 20.00) = 60
Level 3: 3 x (Nova_Distance / 20.00) = 90


The damage depends on the distance of the balls from the Nova_Point to the Dummy Balls. Now it's ready and we can go to the first trigger again.

9.
Now we have to turn on the trigger that we made and destroy group of course.

Code: Select all

Wait 0.20 seconds
   Set Nova_Caster = (Casting unit)
   Set Nova_Point = (Position of Nova_Caster)
   Set Nova_Angle = 0.00
   Set Nova_Distance = 0.00
   For each (Integer A) from 1 to 12, do (Actions)
       Loop - Actions
           Unit - Create 1 Dummy Ball for (Owner of Nova_Caster) at Nova_Point facing Nova_Point
           Set Nova_Dummy[(Integer A)] = (Last created unit)
           Unit - Move Nova_Dummy[(Integer A)] to (Nova_Point offset by 20.00 towards Nova_Angle degrees)
           Set Nova_Angle = (Nova_Angle + 30.00)
   Unit - Pause Nova_Caster
   For each (Integer A) from 1 to 12, do (Actions)
       Loop - Actions
          Set Variable Nova_Around[(Integer A)] = (Angle from (Position of Nova_Caster) to (Position of Nova_Dummy[(Integer A)]))
   Wait for 0.20 seconds
   Unit - Unpause Nova_Caster
   Trigger - Turn on "The trigger that you made a while ago" <gen>
   Trigger - Turn on "The trigger that we just made" <gen>
   Wait for 6.00 seconds
   Trigger - Turn off "The trigger that you made a while ago" <gen>
   Trigger - Turn off "The trigger that we just made" <gen>
   For each (Integer A) from 1 to 12, do (Actions)
      Loop - Actions
         Unit - Kill Nova_Dummy[(Integer A)]
   Custom script:  call RemoveLocation (udg_Nova_Point)
   Custom script:  call DestroyGroup (udg_Nova_Group)
   Set Nova_Distance = 0.00
   Set Nova_Angle = 0.00
   Set Nova_Caster = No unit

Jass to GUI (Very Very Helpful!)
Spoiler:
For all you people like me that want to learn JASS, and know the GUI pretty well, I am working on a small little list/guide which will show you how to convert a little bit to JASS.

1. Abilities
2. Attack Types
3. Integers
4. Points/Locations
5. Units
6. Unit Groups

Code: Select all

______________________________________________
\        GUI -- JASS Function Names          /
 \                                          /
  \                                        /
  /                                        \
  \                                        /
  /        Created By:   Darthfett         \
  \                                        /
  /                                        \
 /                                          \
/____________________________________________\


______________________________________________
\                Abilities                   /
/____________________________________________\

Ability being cast - GetSpellAbilityId()
______________________________________________
\              Attack Types                  /
/____________________________________________\

Spells - ATTACK_TYPE_NORMAL
       -
Normal - ATTACK_TYPE_MELEE
       -
Pierce - ATTACK_TYPE_PIERCE
       -
Siege  - ATTACK_TYPE_SIEGE
       -
Magic  - ATTACK_TYPE_MAGIC
       -
Chaos  - ATTACK_TYPE_CHAOS
       -
Hero   - ATTACK_TYPE_HERO

______________________________________________
\                 Integers                   /
/____________________________________________\

Integer functions are extremely easy in Jass.  Many do not even call a function, and use symbols.

Arithmetic (Addition)                     - *Integer* + *Integer*
                                          -
Arithmetic (Subtraction)                  - *Integer* - *Integer*
                                          -
Arithmetic (Multiplication)               - *Integer* * *Integer*
                                          -
Arithmetic (Division)                     - *Integer* / *Integer*
                                          -
Integer A                                 - bj_forLoopAIndex
                                          -
Integer B                                 - bj_forLoopBIndex
                                          -
String Length                             - StringLength(*String*)
                                          -
Conversion - Convert Real to Integer      - R2I(*Real*)
                                          -
Conversion - Convert String to Integer    - S2I(*String*)
                                          -
Destructible - Elevator Height            - GetElevatorHeight(*Destructible {Has to be an elevator}*)
                                          -
Environment - Terrain Cliff Level         - GetTerrainCliffLevelBJ(*Location*)
                                          -
Environment - Terrain Variance            - GetTerrainVarianceBJ(*Location*)
                                          -
Learned SKill Level                       - GetLearnedSkillLevel()
                                          -
Game - Number of Players                  - GetPlayers()
                                          -
Game - Number of Teams                    - GetTeams()
                                          -
Ally Color Filter Setting                 - GetAllyColorFilterState()
                                          -
Tournament Finish Rule                    - GetTournamentFinishNowRule()
                                          -
Tournament Melee Score for (Player)       - GetTournamentScore(*Player*)
                                          -
Game Cache - Load Integer Value           - GetStoredIntegerBJ(*String*,*String {Category}*, *Game Cache*)
                                          -
Hero Level                                - GetHeroLevel(*Unit {Hero}*)
                                          -
Hero Experience                           - GetHeroXP(*unit {Hero}*)
                                          -
Hero Attribute                            - GetHeroStatBJ(*Integer {The Stat type (Agi = 1, Str = 0,Int = 2)},*Unit {Hero}*,*Boolean {true if you want to exclude bonuses}*)
                                          -
                                          -
                                          - GetHeroStr(*Unit {whichHero}*,*Boolean {includeBonuses}*)
                                          -
                                          - GetHeroAgi(*Unit {whichHero}*,*Boolean {includeBonuses}*)
                                          -
                                          - GetHeroInt(*Unit {whichHero}*,*Boolean {includeBonuses}*)
                                          - 
                                          -
                                          -
Unspent Skill Points                      - GetHeroSkillPoints(*Unit{Hero}*)
                                          -
Item Level                                - GetItemLevel(*Item*)
                                          -
Item Charges Remaining                    - GetItemCharges(*Item*)
                                          -
Custom Value of Item                      - GetItemUserData(*Item*)
                                          -
Leaderboard - Leaderboard Position        - LeaderboardGetPlayerIndexBJ(*Player*,*Leaderboard*)
                                          -
Math - Random Integer                     - GetRandomInt(*Integer {Start #}*,*Integer {End #}*)
                                          -
Math - Min                                - IMinBJ(*Integer*,*Integer*)
                                          -
Math - Max                                - IMaxBJ(*Integer*,*Integer*)
                                          -
Math - Abs(olute Value)                   - IAbsBJ(*Integer*)
                                          -
Math - Sign                               - ISignBJ(*Integer*)
                                          -
Math - Modulo                             - ModuloInteger(*Integer*,*Integer*)
                                          -
Multiboard - Row Count                    - MultiboardGetRowCount(*Multiboard*)
                                          -
Multiboard - Column Count                 - MultiboardGetColumnCount(*Multiboard*)
                                          -
Neutral Building - Gold Remaining         - GetResourceAmount(*Unit{Gold Mines only}*)
                                          -
Player - Current Property                 - GetPlayerState(*Player*,*Player State*)
                                          -
Player - Tax Rate                         - GetPlayerTaxRateBJ(*Player State*,*Player{Player giving gold}*, *Player{Player receiving gold})
                                          -
Player - Score                            - GetPlayerScore(*Player*,*Player Score {The Type of Score}*)
                                          -
Player - Player Number                    - GetConvertedPlayerId(*Player*)
                                          -
Player - Count Structures                 - GetPlayerStructureCount(*Player*,*Boolean {Exclude Incomplete Structures?}*)
                                          -
Player - Count Non-Structures             - GetPlayerUnitCount(*Player*, *Boolean {Exclude Incomplete Units?}*)
                                          -
Player - Current Research Level           - GetPlayerTechCountSimple(*Research/Tech*,*Player*)
                                          -
Player - Max Research Level               - GetPlayerTechMaxAllowedSwap(*Research/Tech*,*Player*)
                                          -
Player - Player Team                      - GetPlayerTeam(*Player*) //Will return the Team NUMBER the player is in.
                                          -
Player - Count Players in Player Group    - CountPlayersInForceBJ(*Force*)
                                          -
Unit - Count Units in Unit Group          - CountUnitsInGroup
                                          -
Unit - Count Living Units Owned by Player - CountLivingPlayerUnitsOfTypeId(*Unit Type Id*,*Player*)
                                          -
Unit - Supply Used by Unit                - GetUnitFoodUsed(*Unit*)
                                          -
Unit - Supply Provided                    - GetUnitFoodMade(*Unit*)
                                          -
Unit - Supply Used by Unit-Type           - GetFoodUsed(*Unit Type Id*)
                                          -
Unit - Supply Provided by Unit-Type       - GetFoodMade(*Unit Type Id*)
                                          -
Unit - Point Value of Unit                - GetUnitPointValue(*Unit*)
                                          -
Unit - Point Value of Unit-Type           - GetUnitPointValueByType(*Unit Type Id*)
                                          -
Unit - Custom Value of Unit               - GetUnitUserData(*Unit*)
                                          -
Unit - Level of Unit                      - GetUnitLevel(*Unit*)
                                          -
Unit - Level of Ability for Unit          - GetUnitAbilityLevelSwapped(*Ability Id*,*Unit*)
                                          -
Unit - Count Items Carried                - UnitInventoryCount(*Unit*)
                                          -
Unit - Size of Inventory                  - UnitInventorySizeBJ(*Unit*)
                                          -
Unit - Count Buffs of Type                - UnitCountBuffsExBJ(*Buff Type {Magic and/or Physical}*,*Buff Type*,*Unit*,*Boolean {Include Expiration Timers}*,*Boolean {Include Auras}*)
                                          -
Trigger - Evaluation Count                - GetTriggerEvalCount(*Trigger*)
                                          -
Trigger - Execution Count                 - GetTriggerExecCount(*Trigger*)
                                          -
Trigger - Count Triggers in Trigger Queue - QueuedTriggerCountBJ()


______________________________________________
\             Points/Locations               /
/____________________________________________\

Center of (Region)                                                - GetRectCenter(*Region*)
                                                                  -
Random point in (Region)                                          - GetRandomLocInRect(*Region*)
                                                                  -
Center of (Region) offset by (X, Y)                               - OffsetLocation(*Region*, *Real {X}*, *Real {Y}*)
                                                                  -
Center of (Region) offset by (Distance) towards (Degrees) degrees - PolarProjectionBJ(*Region*, *Distance*, *Angle*)
                                                                  -
Target of (Camera)                 *1 player games only*          - CameraSetupGetDestPositionLoc(*Camera*)
                                                                  -
Target of current camera view      *1 player games only*          - GetCameraTargetPositionLoc()
                                                                  -
Source of current camera view      *1 player games only*          - GetCameraEyePositionLoc()
                                                                  -
Point(*X*, *Y*)                    *Coordinates*                  - Location(*Real {X}*, *Real {Y}*)
                                                                  -
Position of (Destructible)                                        - GetDestructableLoc(*Destructible*)
                                                                  -
Target point of issued order       *Event Response*               - GetOrderPointLoc()
                                                                  -
Target point of ability being cast *Event Response*               - GetSpellTargetLoc()
                                                                  -
Position of (Item)                                                - GetItemLoc(*Item*)
                                                                  -
Destination of (Waygate)                                          - WaygateGetDestinationLocBJ(*Unit*)
                                                                  -
(Player) start location                                           - GetPlayerStartLocationLoc(*Player*)
                                                                  -
Position of (Unit)                                                - GetUnitLoc(*Unit*)
                                                                  -
Rally point of (Unit) as a point                                  - GetUnitRallyPoint(*Unit*)

______________________________________________
\                  Units                     /
/____________________________________________\

GUI Usage                           JASS Usage

Last Created Unit                 - bj_lastCreatedUnit
                                  -
Last Restored Unit                - bj_lastLoadedUnit
                                  -
Last Replaced Unit                - bj_lastReplacedUnit
                                  -
Last Haunted Gold Mine            - bj_lastHauntedGoldMine
                                  -
Picked Unit                       - GetEnumUnit()
                                  -
Matching Unit                     - GetFilterUnit()
                                  -
Random Unit from Unit Group       - GroupPickRandomUnit(*UnitGroup*)
                                  -
Attacked Unit                     - GetTriggerUnit()
                                  -
Attacking Unit                    - GetAttacker()
                                  -
Buying Unit                       - GetBuyingUnit()
                                  -
Cancelled Structure               - GetCancelledStructure()
                                  -
Casting Unit                      - GetSpellAbilityUnit()
                                  -
Constructing Structure            - GetConstructingStructure()
                                  -
Constructed Structure             - GetConstructedStructure()
                                  -
Damage Source                     - GetEventDamageSource()
                                  -
Decaying Unit                     - GetDecayingUnit()
                                  -
Dying Unit                        - GetTriggerUnit()
                                  -
Entering Unit                     - GetEnteringUnit()
                                  -
Hero Manipulating Item            - GetManipulatingUnit()
                                  -
Killing Unit                      - GetKillingUnit()
                                  -
Learning Hero                     - GetLearningUnit()
                                  -
Leaving Unit                      - GetLeavingUnit()
                                  -
Leveling Hero                     - GetLevelingUnit()
                                  -
Loading Unit                      - GetLoadedUnit()
                                  -
Ordered Unit                      - GetOrderedUnit()
                                  -
Ownership-changed unit            - GetChangingUnit()
                                  -
Researching Unit                  - GetResearchingUnit()
                                  -
Revivable Hero                    - GetRevivableUnit()
                                  -
Reviving Hero                     - GetRevivingUnit()
                                  -
Selling Unit                      - GetSellingUnit()
                                  -
Sold Unit                         - GetSoldUnit()
                                  -
Summoned Unit                     - GetSummonedUnit()
                                  -
Summoning Unit                    - GetSummoningUnit()
                                  -
Target unit of issued order       - GetOrderTargetUnit()
                                  -
Target unit of ability being cast - GetSpellTargetUnit()
                                  -
Targeted unit                     - GetEventTargetUnit()
                                  -
Trained unit                      - GetTrainedUnit()
                                  -
Transporting unit                 - GetTransportUnit()
                                  -
Triggering unit                   - GetTriggerUnit()
                                  -
Rally-Point of (Unit) as a Unit   - GetUnitRallyUnit(*Unit*)

______________________________________________
\                Unit Groups                 /
/____________________________________________\

Last Created Unit Group                  - GetLastCreatedGroup()
                                         -
Random N Units from Unit Group           - GetRandomSubGroup(*N*, *Unit Group*)          
                                         -
Units in Region                          - GetUnitsInRectAll(*Region*)
                                         -
Units in Region owned by Player          - GetUnitsInRectOfPlayer(*Region*, *Player*)
                                         -
Units in Region matching condition       - GetUnitsInRectMatching(*Region*, *Condition*)
                                         -
Units in Range                           - GetUnitsInRangeOfLocAll(*Real {Range Amount}*, *Region*)
                                         -
Units in Range matching condition        - GetUnitsInRangeOfLocMatching(*Real {Range Amount}*, *Region*, *Condition*)
                                         -
Units owned by Player                    - GetUnitsOfPlayerAll(*Player*)
                                         -
Units owned by Player of type            - GetUnitsOfPlayerAndTypeId(*Player*, *UnitTypeID*)
                                         -
Units owned by Player matching condition - GetUnitsOfPlayerMatching(*Player*, *Condition*)
                                         -
Units of Type                            - GetUnitsOfTypeIdAll(*UnitTypeID*)
                                         -
Units Selected by Player                 - GetUnitsSelectedAll(*Player*)

Simple GUI Triggers
Spoiler:
Part 1
Spoiler:
The fallowing was taken off another website, The pictures could not come...

Mapping for Beginners
Learning to make maps in Warcraft is not that difficult. Playing around with the editor is the best way to learn, but some people may feel more comfortable with guidance. This thread serves as a jump-start for your mapping journey. It is just an overview, but it should push you in the right direction. Good luck!

Note: If you have any questions, post them in a separate thread. This thread is reserved for suggestions and tips.

How do I make a map!?
If you are completely new to Warcraft map-making, you will find that messing around with the editor will teach you a lot. The rule of thumb is that you should start small - a beginner is not going to make the next DotA without practice. World Editor Tutorials gives some excellent advice on how to start mapping:
Our best advice for the new mapmaker is to open an existing melee map from Warcraft III. Add a few special events that can occur. Add a quest or two, and create some custom units. Change the terrain a little to learn about the terrain editor. When you know your way around the editor a little, create a few custom abilities, and maybe even a custom hero.
If you're not willing to invest the time and effort to learn how to make maps, then don't expect to succeed. Learning how to make maps is hard work, and it doesn't come overnight. That said, don't expect to get much help if you post a thread saying "help me! I want to make a map!"

How do I make a campaign?
All campaigns start off with the Campaign Editor. Assuming that you can make maps, the Campaign Editor is self-explanatory. After filling in the various text boxes with the corresponding information, click on the "Add Map" icon in the toolbar, and add the maps that you have created, with their corresponding buttons. If you have experience with the Object Editor, then the Campaign Editor's analogous features should be straightforward, the only difference being the color of the edited objects' texts. In addition, you can import files much like in regular maps, except that the path to the file is wc3campimported\file, not wc3mapimported\file.

If you want to save your character between maps, you will have to use the Game Cache triggers in the Trigger Editor.

How do I make a TD (Tower Defense) Map?
TDs are very difficult maps to create. Tossing aside the technical aspects for a moment, making an original, fun-to-play map requires a huge commitment. Because of the high standards in the mapping community on TDs, your map needs to be both well-polished and entertaining.

First, you will need to terrain your map. This includes doodads and other static aspects, such as the paths for the creeps to walk.

Second, you will need to create the towers. This is self-explanatory - if you've played a TD, you probably have tons of ideas bouncing around in your head. See some unprotected TDs for more details on making the towers.

Third, you will need to make the creeps, who walk through the paths. Again, as with the towers, you probably have many ideas.

There are many excellent tutorials on the internet about making TDs, so if you're stuck you can search for more detailed information.
Part 2
Spoiler:
>> Using Local Variables for Easy Triggering <<
A Tutorial by Sid

Many of the times when we make Trigger Enhanced Systems or Spells, We make a System or Spell, But while testing it we realize that We've lost
the MUI. How to fix it?
Example : Consider this spell...
Pulse Of Darkness : Marks target for Pulse of Darkness, Target will take damage equal to 5% of it's base hp per second for next 3 seconds.
Making such a spell in GUI is tough challange. Specially if you don't know anything of JASS.
Now, I hope you can make this spell, Let's create a basic trigger that will explain basic ideaa of the spell's function.

Code:

Trigger Pulse Of Darkness

Event :
- A unit starts effect of an ability
Conditions
- Ability being cast is equal to Pulse of Darkness
Actions
- Cause (Casting Unit) to Damage (Target Unit of Ability being Cast) for (((Max HP of (Target unit of Ability being Cast) / (100)) * (5)) using
Attack Type Magic and Damage type Spells.
- Wait 1.00 seconds
- Cause (Casting Unit) to Damage (Target Unit of Ability being Cast) for (((Max HP of (Target unit of Ability being Cast) / (100)) * (5)) using
Attack Type Magic and Damage type Spells.
- Wait 1.00 seconds
- Cause (Casting Unit) to Damage (Target Unit of Ability being Cast) for (((Max HP of (Target unit of Ability being Cast) / (100)) * (5)) using
Attack Type Magic and Damage type Spells.
Ok, So now you have an idea. But test it out in a map, It won't work!
Why?
Because the fnction - Target unit of Ability being cast - becomes "Reset" after the - Wait X.xx Seconds - action!
So, Only the first Action is executed. Now, How to tackle that? Well, We can use Variables.
So, here's a trigger that takes one step ahed.

Code:

Variables
CastingUnit - unit
TargetUnit - unit
Here's Trigger...

Code:

Trigger Pulse Of Darkness
Event :
- A unit starts effect of an ability
Conditions
- Ability being cast is equal to Pulse of Darkness
Actions
- Set CastingUnit = (Casting Unit)
- Set TargetUnit = (Target Unit of Ability being Cast)
- Cause (CastingUnit) to Damage (TargetUnit) for (((Max HP of (TargetUnit) / (100)) * (5)) using Attack Type Magic and Damage type Spells.
- Wait 1.00 seconds
- Cause (CastingUnit) to Damage (TargetUnit) for (((Max HP of (TargetUnit) / (100)) * (5)) using Attack Type Magic and Damage type Spells.
- Wait 1.00 seconds
- Cause (CastingUnit) to Damage (TargetUnit) for (((Max HP of (TargetUnit) / (100)) * (5)) using Attack Type Magic and Damage type Spells.
Now you have a trigger that is "Working", But what will happen if One unit casts this spell and second one also casts it before first is in
effect? Well, Don't bet that everything will go on normally. I can say that you'll lose the Bet. Since we are using two "Global Vars", It will
OverWrite the second target on the first one and before the effecton First one completes, it will aply damage to second one. It's a Major
Problem with the spell, Called loss of MUI.

Now how to fix it?
Answer is the title of the Tutorial, Usage of Local Variables.
Now comes the Trick.


If you define a Variable globally called "VariableName", it is called "udg_VariableName" in JASS.
Just Remember this.
Now, I presume you've still retained the CasterUnit and TargetUnit variables we created earlier.


Here, If you are smart enough, Tell me what these variables will be called in JASS?

Right, "udg_CasterUnit" and "udg_TargetUnit"


Now, I want you to make a little modification to the Last Step We've taken, Our Second Trigger.
Just Add these two Actions above all the Actions in the Trigger.

Code:

Actions :
- Custom Script : local unit udg_CasterUnit
- Custom Script : local unit udg_TargetUnit
So, here's the Final Trigger...

Code:

Trigger Pulse Of Darkness
Event :
- A unit starts effect of an ability
Conditions
- Ability being cast is equal to Pulse of Darkness
Actions
- Custom Script : local unit udg_CasterUnit
- Custom Script : local unit udg_TargetUnit
- Set CastingUnit = (Casting Unit)
- Set TargetUnit = (Target Unit of Ability being Cast)
- Cause (CastingUnit) to Damage (TargetUnit) for (((Max HP of (TargetUnit) / (100)) * (5)) using Attack Type Magic and Damage type Spells.
- Wait 1.00 seconds
- Cause (CastingUnit) to Damage (TargetUnit) for (((Max HP of (TargetUnit) / (100)) * (5)) using Attack Type Magic and Damage type Spells.
- Wait 1.00 seconds
- Cause (CastingUnit) to Damage (TargetUnit) for (((Max HP of (TargetUnit) / (100)) * (5)) using Attack Type Magic and Damage type Spells.
Now, Try it out... This is the one that works smoothly and without any Glitch!
Why?

Remember what we wrote above all? We've declared two Local Variables, For the Simplicity in GUI, We set the names of out Locals to the same
names that of the Globals. Thus we can access the Variables from the Drop Down Menu of "Set Variable" action. There we select the Global
Variable's name, But when the Script compiles, it actually refers to Local Variables.Thus We "Override" the Globals by Locals.

How to implement it further?
Simple, For every Spell Trigger you create. Always use the Variables instead of GUI Functions while writing the Actions part. Then simply
define the locals of Same name and Same trype to that of the Globals you used in the Trigger Actions.
Hope this will help a map maker while making Trigger Enhanced Triggers.

Quote:Note:
Also, It's 100% safe to use Loops and Wait functions inside Loops, if you're using Locals. Remember Not to access Global accidently if you're
using Wait inside Loop.

Thanks for Reading through the post and Tolerating this Long Post.
And Don't forget my Reward... A Reputation point will do!
Part 3
Spoiler:
=> What is this?
Demonstrates how to track effects, Create, record and destroy them periodically without any problem.

=> Requirements
This requires the Frozen Throne Expansion, At least ver.1.07. This will not work with RoC as it involves Custom Scripts functions.
=> Main
To start off, You'll need a variable,
Fx (Special Effect Variable)
Now, Create a trigger as follows..

...
Trigger HandleFx
Events :
- None
Conditions :
- None
Actions :
- Custom Script : Local Effect Eff
- Custom Script : set Eff = udg_Fx
- Wait 5.00 seconds.
- Custom Script : set udg_Fx = Eff
- Special Effect : Destroy Special Effect Fx
...

Now How to Implement that?
Now you have your Effect Handle, You can implement it!
Use it this way...

...
- Special Effect : Create Special Effect : <Whatever Path of Effect>
- Set Fx = Last Created Special Effect
- Trigger : Run HandleFx (Ignoring Conditions)
...

Hooray! You've made your own Special Effect Tracker!
=> Customization
You can customize this further, Like setting up Delay to 10.00 seconds rather than 5.00 seconds.. It won't hurt, You can safely create whatever effects you want...


=> Advanced Customization
I've found how to enhance it further according to your needs, Cause normaly, making a Triggered spell, you need to always adjust the values for how much time you'll need to display the effects.

=> How to start?
Let's again look at the old effect tracker we made...
here it is...

...
Trigger HandleFx
Events :
- None
Conditions :
- None
Actions :
- Custom Script : Local Effect Eff
- Custom Script : set Eff = udg_Fx
- Wait 5.00 seconds.
- Custom Script : set udg_Fx = Eff
- Special Effect : Destroy Special Effect : Fx
...

You found that you've plainly used the 5.00 seconds constant delay... Now the question comes, how to customize it for each effect?
You'll need another variable,
FxDur ...Real Variable.
Now, convert the HandleFx into Custom script and modify it's Action functions like this..

...
function Trig_HandleFx_Actions takes nothing returns nothing
local effect Eff
local real EffDur
set Eff = udg_Fx
set EffDur = udg_FxDur
call TriggerSleepAction( EffDur )
set udg_Fx = Eff
call DestroyEffectBJ( udg_Fx )
endfunction
...

Now, your entire trigger looks like this...

...
function Trig_HandleFx_Actions takes nothing returns nothing
local effect Eff
local real EffDur
set Eff = udg_Fx
set EffDur = udg_FxDur
call TriggerSleepAction( EffDur )
set udg_Fx = Eff
call DestroyEffectBJ( udg_Fx )
endfunction

function InitTrig_HandleFx takes nothing returns nothing
set gg_trg_HandleFx = CreateTrigger( )
call TriggerAddAction( gg_trg_HandleFx, function Trig_HandleFx_Actions )
endfunction
...

=> How to Implement this now?
Same way we did before, but now one more variable to set before running this trigger!
like this..

...
- Special Effect : Create Special Effect : <Whatever Path of Effect>
- Set Fx = Last Created Special Effect
- Set FxDur = 6.00
- Trigger : Run HandleFx (Ignoring Conditions) => What is this?
Demonstrates how to track effects, Create, record and destroy them periodically without any problem.

=> Requirements
This requires the Frozen Throne Expansion, At least ver.1.07. This will not work with RoC as it involves Custom Scripts functions.
=> Main
To start off, You'll need a variable,
Fx (Special Effect Variable)
Now, Create a trigger as follows..

...
Trigger HandleFx
Events :
- None
Conditions :
- None
Actions :
- Custom Script : Local Effect Eff
- Custom Script : set Eff = udg_Fx
- Wait 5.00 seconds.
- Custom Script : set udg_Fx = Eff
- Special Effect : Destroy Special Effect Fx
...

Now How to Implement that?
Now you have your Effect Handle, You can implement it!
Use it this way...

...
- Special Effect : Create Special Effect : <Whatever Path of Effect>
- Set Fx = Last Created Special Effect
- Trigger : Run HandleFx (Ignoring Conditions)
...

Hooray! You've made your own Special Effect Tracker!
=> Customization
You can customize this further, Like setting up Delay to 10.00 seconds rather than 5.00 seconds.. It won't hurt, You can safely create whatever effects you want...


=> Advanced Customization
I've found how to enhance it further according to your needs, Cause normaly, making a Triggered spell, you need to always adjust the values for how much time you'll need to display the effects.

=> How to start?
Let's again look at the old effect tracker we made...
here it is...

...
Trigger HandleFx
Events :
- None
Conditions :
- None
Actions :
- Custom Script : Local Effect Eff
- Custom Script : set Eff = udg_Fx
- Wait 5.00 seconds.
- Custom Script : set udg_Fx = Eff
- Special Effect : Destroy Special Effect : Fx
...

You found that you've plainly used the 5.00 seconds constant delay... Now the question comes, how to customize it for each effect?
You'll need another variable,
FxDur ...Real Variable.
Now, convert the HandleFx into Custom script and modify it's Action functions like this..

...
function Trig_HandleFx_Actions takes nothing returns nothing
local effect Eff
local real EffDur
set Eff = udg_Fx
set EffDur = udg_FxDur
call TriggerSleepAction( EffDur )
set udg_Fx = Eff
call DestroyEffectBJ( udg_Fx )
endfunction
...

Now, your entire trigger looks like this...

...
function Trig_HandleFx_Actions takes nothing returns nothing
local effect Eff
local real EffDur
set Eff = udg_Fx
set EffDur = udg_FxDur
call TriggerSleepAction( EffDur )
set udg_Fx = Eff
call DestroyEffectBJ( udg_Fx )
endfunction

function InitTrig_HandleFx takes nothing returns nothing
set gg_trg_HandleFx = CreateTrigger( )
call TriggerAddAction( gg_trg_HandleFx, function Trig_HandleFx_Actions )
endfunction
...

=> How to Implement this now?
Same way we did before, but now one more variable to set before running this trigger!
like this..

...
- Special Effect : Create Special Effect : <Whatever Path of Effect>
- Set Fx = Last Created Special Effect
- Set FxDur = 6.00
- Trigger : Run HandleFx (Ignoring Conditions)
Part 4
Spoiler:
Note: I did not discover this code, the original author is "Tennis" from http://www.wc3jass.com. All credits go to him, this is only a guide on how you implement it.

Description
Many maps uses the "player1 (red) = guy who decides everything", that is annoying because the host might not want to play as red but still wants to control the stuff which the host sometimes can do (as an example, difficulty settings, player 1 (red) is in a large number of maps able to set the difficulty of the game through a dialog or something similar).
But what most people probably didn't knew is that with just a very small amount of custom scripts (Jass) and 1 variable you can detect who is the host.

So here it goes, the 3 easy steps on how to create the variable and make the custom scripts.

Step 1: The Variable
Create a new variable, name it "Host", set the variable type to "Player (player)", do not check out the Aray box and leave the initial value at none like I have done in the picture below.


Step 2: Custom Script Header
Right, you have your variable now it is time to get the hardest part done. In the Trigger Editor you click at the top at the maps name like if it was any other trigger, in there you paste these lines of code (Make sure you paste it at the top):
[jass]function GetHost takes nothing returns nothing
local gamecache g = InitGameCache("Map.w3v")
call StoreInteger ( g, "Map", "Host", GetPlayerId(GetLocalPlayer ())+1)
call TriggerSyncStart ()
call SyncStoredInteger ( g, "Map", "Host" )
call TriggerSyncReady ()
set udg_Host = Player( GetStoredInteger ( g, "Map", "Host" )-1)
call FlushGameCache( g )
set g = null
endfunction[/jass]

Step 3 Getting The Host
Now that you have the most of the work done you just need to make a last simple trigger where you set the event to Map initialization, conditions you leave untouched and in the actions you make a custom script like this: "Custom script: call GetHost()". Now it has checked who is the host and stored it in the variable, for further use you just need to address everything to the "Host" variable like you would usually do to Player 1 (red), it is as simple as that.
Part 5
Spoiler:
Note: In this tutorial we will show you how you create a simple multiply choice dialog for 1 player. Keep in mind that this is directed towards the beginners within the Trigger Editor and is in no way meant to teach the experienced modders anything that they probably didn't knew already.

1) What is a dialog?
A "Dialog" is a litle window that pops up which contains some buttons that you can click. An example of what a Dialog can be used for is a simple thing like if you would like to have a 100 gold. Instead of having the choice based on chat commands where you write -yes or -no it is (and looks) better to have a Dialog window apearing asking you if you would like to have a 100 gold and then having 2 buttons which says "Yes" or "No".
We will now show you how you make a Dialog like I just told you about in the simpliest way (that we know of).

2) Getting Started.
To get started you should (ofcourse) open up the World Editor and enter the Trigger Editor (Hotkey for it is F4), the icon for it is located inbetween the Terrain Editor & the Sound Editor.


3) Creating The Variables.
Once you entered the Trigger Editor the first thing to do is finding the Variable Editor (Hotkey for it is Ctrl+B), the icon for it is located to the left of the New Category icon.

When you are inside the Variable Editor you click on the green x with a + infront of it to create a new variable, then you make the two variables needed for the Dialog as shown below.


4) Creating The Dialog Window.
Once you made your two variables you can start with the actual triggers for getting the Dialog Window to apear.
First you create a new trigger and do as shown below.

The Dialog Window
Code:

Events
Time - Elapsed game time is 1.00 seconds
Conditions
None
Actions
Dialog - Clear MyDialog
Dialog - Change the title of MyDialog to Do you want a 100 gold?
Dialog - Create a dialog button for MyDialog labelled Yes
Set DialogButton[1] = (Last created dialog Button)
Dialog - Create a dialog button for MyDialog labelled No
Set DialogButton[2] = (Last created dialog Button)
Dialog - Show MyDialog for Player 1 (Red)
Once this is done the Dialog will apear perfectly but there will be no effect when clicking the buttons.

5) Creating The Buttons.
To make the buttons actually do something you create two triggers as shown below.

Yes Button
Code:
Events
Dialog - A dialog button is clicked for MyDialog
Conditions
(Clicked dialog button) Equal to DialogButton[1]
Actions
Player - Add 100 to Player 1 (Red) Current gold
Game - Display to Player Group - Player 1 (Red) the text: You have recieved 100 gold
No Button
Code:
Events
Dialog - A dialog button is clicked for MyDialog
Conditions
(Clicked dialog button) Equal to DialogButton[2]
Actions
Game - Display to Player Group - Player 1 (Red) the text: You didn't want any gold
part 6
Spoiler:
Basics of a TD
by ragingspeedhorn

Note: This tutorial will explain you the very basics of making a TD. This is in no way geared towards experienced modders but is made for the beginners within Warcraft III modding.


What is a TD?

TD stands for Tower Defense and is a genre of maps developed for the Warcraft III engine. In a TD your goal is to build towers to prevent creeps of reaching a certain destination.


So.. How do I create one?

A good way of starting on a TD is to firstly make the terrain you find fitting for your map and then determine the lanes and setting up the pathing system (the creeps movement).


Uhh right, so how do I do that?

To get the creeps to move from 1 place to another you will need to make regions at the desired locations and then trigger the movement like this (the Trigger Editor is located inbetween the Terrain Editor and the Sound Editor):

Movement Region 1
Code:
Events
Unit - A unit enters Spawn Region
Conditions
None
Actions
Unit - Order (Entering unit) to Move To (Center of Region1)
Movement Region 2
Code:
Events
Unit - A unit enters Region1
Conditions
None
Actions
Unit - Order (Entering unit) to Move To (Center of Region2)
Movement Region 3
Code:
Events
Unit - A unit enters Region2
Conditions
None
Actions
Unit - Order (Entering unit) to Move To (Center of Region3)
Movement Region 4
Code:
Events
Unit - A unit enters Region3
Conditions
None
Actions
Unit - Order (Entering unit) to Move To (Center of Region4)
Movement Region 5
Code:
Events
Unit - A unit enters Region4
Conditions
None
Actions
Unit - Order (Entering unit) to Move To (Center of End Region)



Ok done, now what?

Next is the actual trigger that spawns the "waves" as the levels of units is often called. It can be done like this:

Wave 1
Code:
Events
Time - Elapsed game time is 30.00 seconds
Conditions
None
Actions
Unit - Create 40 Footman for Player 12 (Brown) at (Center of Spawn Region) facing 0.00 degrees


Right, so the regions and spawning is made, now what's next?

Next on the list should be finding out what to make of builders, towers and making the creeps, this is done within the Object Editor which is located inbetwen the Sound Editor and the Campaign Editor. You can also make triggered abilities for the towers but if you need help from this tutorial I suggest you wait with that untill a later time.


Right-o, I have made some towers, a builder and all the creeps, now what?

Adding the "lives" function is something that almost every td has, atleast it is only a few which doesent, so that is also included in here. Now I will show how you create the basic Leaderboard and putting in the lives function. Before you make the actual Leaderboard you have to make a variable like this one shown below to set the lives initial value.




Now when that is done you can move on to creating the Leaderboard and setting up everything that has to with lives and updating the Leaderboard.


Setup Leaderboard
Code:
Events
Time - Elapsed game time is 0.10 seconds
Conditions
None
Actions
Leaderboard - Create a leaderboard for (All players) titled Lives
Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label Lives and value Lives
Leaderboard - Change the color of all labels for (Last created leaderboard) to (0.00%, 100.00%, 0.00%) with 0.00% transparency
Leaderboard - Show (Last created leaderboard)
Life Lost
Code:
Events
Unit - A unit enters End Region
Conditions
(Owner of (Entering unit)) Equal to Player 12 (Brown)
Actions
Set Lives = (Lives - 1)
Unit - Remove (Entering unit) from the game Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to Lives
Game - Display to Lives the text: (( + ((Name of (Entering unit)) + has reached the end! )) + ((String(Lives)) + chances left))
Trigger - Run Defeat (checking conditions)
Defeat Trigger
Code:
Events
None (it is a trigger that is run by the 'Life Lost' trigger)
Conditions
None
Lives Less than or equal to 0
Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Remove (Picked unit) from the game)
Game - Defeat Player 1 (Red) with the message: Defeat!

Leaderboard made, is there anything more?

Most td maps (atleast the decent ones) has it so you are able to sell your towers so here I will show a way it can be done.


Tower Selling
Code:
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Sell Tower
Actions
Player - Add ((Point-value of (Casting unit)) / xxx) to (Owner of (Casting unit)) Current gold
Unit - Remove (Casting unit) from the game

Ability done, what's next?

Once you have succesfully made the Tower Selling ability I think you are covered in with the basic triggers, now you only need to make it so you win once the last wave of units have been defeated. Good luck with your td map!
Last edited by Black-Hole on May 1st, 2009, 2:06 am, edited 2 times in total.
Black-Hole
Forum Fanatic
Posts: 315
Joined: October 16th, 2007, 7:32 pm

Re: Tratorials

Post by Black-Hole »

Basic GUI Tutorials (Part 2 of 2)

Part 7
Spoiler:
Basics of Regions
by ragingspeedhorn, with some edits by Archian.


Index Of Content:

- What Is A Region?
- Where Do I Find The Place To Add Regions?
- What Do I Use These Regions For?
- You Also Mentioned Custom Weather, What Is That?
- Also Ambient Sound, What Is That? ...And Why Is It Turned Off?!
- Conclusion.


Note: In this tutorial we will explain to you the basics of working with regions, what a region is and some other usefull tips. This tutorial is in no way geared towards experienced modders but is meant as a helpfull hand to the newbeginners within Wc3 modding.

What Is A Region?

A region is a invisible field (ingame that is, in the editor your region is visible when you are using the region palette (but only when using the region palette, though you can change it so it's viewable while you're working in any of the other palettes)) used for triggered events, custom weather for certain areas (the area the region stretches over) and for ambient sound.
The last two being choosable in the individual regions properties and the first in the trigger editor.

The regions that this tutorial is about are called rects in JASS, that is because they are rectangular.
Besides rects JASS does also have the type region which is composed of many tiny sqares, so that you can have regions with any shape you want (for example a circle).
Contributed by: PitzerMike.

Now for the 'Unit enters Rect'-event: When this event is registered with a trigger, WC creates a temporary rectangular JASS-region with the same dimension as the GUI-region that will be specified in the trigger editor. And the event will be registered for that temporary JASS-region, not for the rect (because rects technically don't even have Enter/Leave-Events).
Contributed by: PitzerMike.


Where Do I Find The Place To Add Regions?

Go up in "Layer" and select "Regions", then the "Region Palette" pops up and from that you are able to manage and add new regions. You add the new regions through the grey button.

This is what the Region Palette looks like.


This is how the regions looks like.


As you can see the regions on the picture has different colors, you can change the color of the region inside the region properties (acces the properties by double clicking the region which you wish to change).


What Do I Use These Regions For?

As said before regions are mostly used for triggered events.
Here is some basic examples of a simple trigger involving the "Unit enters region" event:

Code:
Test Trigger
Events
Unit - A unit enters Region 000 <gen>
Conditions
Unit type of (Entering unit) Equal to (Footman)
Actions
Unit - Kill (Entering unit)
This trigger will kill any units that enters region "000" if they are of the type Footman.
It is a pretty basic example, a commonly used trigger which involves a region.

Code:
Region Trigger
Events
Unit - A unit enters Region 000 <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 1 (Red)
Actions
Unit - Order (Entering unit) to Move To (Center of Region 001 <gen>)
This trigger makes the unit entering "Region 000" move to Region 001 if the entering unit is owned by Player 1.

Code:
Region Spawn Trigger
Events
Unit - A unit enters Region 000 <gen>
Conditions
Actions
Unit - Create 1 Footman for Player 1 (Red) at (Center of Region 001 <gen>) facing Default building facing degrees
This trigger creates a Footman unit at the center (middle) of Region 001 when a unit owned by any player enters Region 000.

You Also Mentioned Custom Weather, What Is That?

The custom weather is the Weather Effect box. If you wish to have let's say an area where it is raining you create a region over the desired area like shown below.


Once that is done you open up the Region Properties and check out the Weather Effect box.


Once that is done you can choose your desired effect, as an example I have used "Ashenvale Rain (Heavy)".


The Weather Effects which you have to choose from are all the different effects premade by Blizzard which they used in the RoC & TFT campaigns, there are 21 in total. Also you are able to import your own custom Weather Effects, check out THIS tutorial made by CryoniC.

Also Ambient Sound, What Is That? ...And Why Is It Turned Off?!

The reason why you are not able to choose a Ambient Sound right away is because you can only use sounds once you have added them to your map as sounds through the Sound Editor (if you add them as music you will not be able to use them as Ambient Sounds, it needs to be as a sound). As shown below I have added the Credits theme as a sound file and then it becomes selectable in the Region Properties.





Conclusion.
Hopefully with this tutorial you have learned abit more about regions and their basic use, if you got any suggestions for improvements or such please leave a comment
part 8
Spoiler:
How to make heroes get past level 10.


Since a lot of new members doesn't know how to make heroes get past lvl 10, I figured out that the best way is to post a tutorial here.
So this is what you do:
...go to the top menus and go to the one called 'Advanced', and then within that menu, click on 'Gameplay Constants' and then within there, click off the check box labeled 'Use Custom Gameplay Constants' and then within the list, scroll down and find the field called 'Hero Maximum Level'.Change it to whatever the value you want and your done.

Now I realy hope that this will decrease the number of new threads about that.
part 9
Spoiler:
First,i'd like to say thanks to uberfoop[/u] and edwinfong25 for helping me to solve problems about this ability.

Actualy,this is my first spell made in triggers,so i decide to place it as tutorial for mapping beginners and for those who haven't made, or don't know how to make, something like this.

What is Massivenes:
"Slams the ground five times in line slowing enemy units and deals massive damage in an area of effect."

Ability is based on thunder clap (human mountain king's ability).My ability contains two levels (Side NOTE:i disabled attack speed decreasing).This is you who shall decide how much levels it has or what damage does it deal etc...

Now after you made ability give it to wanted hero and make doomy ability.
How to make Doomy ability:
All you should do is to copy original "Massiveness".After you paste your ability,you will find button "Stats - Hero Ability".Set it to false and set "Stats - Mana Cost" for ALL levels to 0.That's all!

Now create dummy unit!
What is doomy unit and how to create it:
Doomy unit is invisible and untouchable unit.In the most maps they serve for triggering spell (the most) and some mappers use them as for visibility actions.Doomy unit can do such a things (75% spells without doomies are impossible).

Okay,go to Object Editor and create new unit based on (example) Footman (you can choose any unit you want,but just create it).Then,there are the most important things you must do.In the other hand,ability won't work,so keep eye on next:

Abilities - Normal = Invulnerable (Neutral) , Locust , ""Massiveness (Doomy)""
(Invurnerable ability isn't necesary,but it makes doomy 100% safe (i did set it).Why Locust?Locust can not be selected in game,so no one can choose it while it's working,ok?And ofcourse add Doomy ability you made the last);
Art - Animation - Cast Backswing = At least 0.100
Art - Animation - Cast Point = At least 0.100
(When these two actions are disabled,simply cannot shoot ability more then once (i realy don't know why it happens));
Art - Model File = Thunder Clap <Caster>
Art - Scaling Value = 1.00
(Because thunder clap needs caster animation,we have to set actions above.If we leave it as example Zone Indicator model file,ability WILL do effect,but thunder clap will not be shown because actualy doomy is INVISIBLE,understand???);
Combat - Attacks Enabled = NONE
(you don't want your doomy to run around map and attack anyone he can,right?);
Movement - Type = Fly
(Logicaly,because doomy can block some land units in combat);
Stats - Hide Minimap Display = TRUE
(The most important thing.If you leave as false,then everytime you cast ability,minimap will show your invisible unit (doomy) lol);
Stats - Sight Radius (Day and Night) = 0 , 0 (both)


Ok,you completed creating doomy unit.Now,it is time to make ability with triggers.

First,you must start with event:
Code:
Unit - A unit Starts the effect of an ability
Second,the most important.You must ORDER which ability to match...condition:
Code:
(Ability being cast) Equal to Massiveness (Dwarf Master)

Okay,now we need actions...

First off,you don't want Massiveness to clap 5 times at once.So i did this:First of all actions:

Code:
Wait 0.50 seconds
After hero casts ability,trigger will wait 0.5 seconds.
Second is something what i "MAYBE" understand.We have to call Point variable.If i'm introduced well,this saves the game of bugs,laggs and stucks.Like,if two heroes cast it in once,trigger may confuse its' self if everything is in one action,right?So,this action works perfectly and now do this! (Create one variable named (or however you want) Point_Array with 'Array' Size 1.Next lets call it:

Code:
Set Point_Array[1] = (Position of (Casting unit))
(DON'T FORGET [1])

We done it.Now here's the action.Now match how much times you want Massiveness to slam the ground with this action (i set it to 4,that means first hero casts it once and after that,4 more times):

Code:
For each (Integer A) from 1 to 4, do (Actions)
Loop - Actions

That's done too.Now,we need to set Point variable 'WHERE' to create doomies.In my map,Massivness (Doomy) ability slams in random point around casting hero (there is limited range ofcourse).And,it's spawned on random angle as well,so you cannot except where actualy ability will be cast.How to do that:

Code:
Set Point_Array[2] = (Point_Array[1] offset by (Random real number between 100.00 and 250.00) towards (Random angle) degrees)
(DON'T FORGET [2] and [1] in Point variable)

Next we need create doomy for owner of casting unit in point_array 2,right,so:

Code:
Unit - Create 1 Doomy (Massiveness) for (Owner of (Casting unit)) at Point_Array[2] facing Default building facing degrees
Now,after we created doomy unit,we don't need second point_array variable as well.We MUST remove it if we don't want your game get crashed with such a points.Custom Script works for us!Go to New Action - Custom Script and TYPE next:

Code:
Custom script: call RemoveLocation(udg_Point_Array[2])
We removed it now we're safe...We need to make sure that doomy contains ability we want.Also,because of next actions,we need to add ability also if it's added in Object Editor (more safely):

Code:
Unit - Add Massiveness (Doomy) to (Last created unit)
Now you may ask 'how to set level of doomy ability,but to match with hero's original ability'?Do this:

Code:
Unit - Set level of Massiveness (Doomy) for (Last created unit) to (Level of (Ability being cast) for (Casting unit))
Now,we must order doomies to cast Massivenes where they are.Don't forget,this is ability is based on thunder clap ability.Go to New Action - Unit - Issued Order With No Target and do next:

Code:
Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
And spell is done...After this actions,ability will take effect 3 more times and will be turned off until next time hero cast it.There are 2 more things:First,we have to remove dommies from the game.And do next:

Code:
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
They are removed and job is finished regarding doomies.All we left is Point_Array[1],we called it before main action,and now we have to remove it OUT of main action:So TYPE next:

Code:
Custom script: call RemoveLocation(udg_Point_Array[1])
That's all.Your spell is donr and now you can test and try it.
Maybe one day you will use this ability for your own map (joke).

If in some actions or in some description i was wrong,please correct me.
I except some comments on this topic.Feel free to say and ask anything you want.Sorry if i was wrong in some words or action and very sorry for VERY BAD English language...Thank you all

(Here's full ability: )
Code:
Massiveness
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Massiveness (Dwarf Master)
Actions
Wait 0.50 seconds
Set Point_Array[1] = (Position of (Casting unit))
For each (Integer A) from 1 to 4, do (Actions)
Loop - Actions
Set Point_Array[2] = (Point_Array[1] offset by (Random real number between 100.00 and 250.00) towards (Random angle) degrees)
Unit - Create 1 Doomy (Massiveness) for (Owner of (Casting unit)) at Point_Array[2] facing Default building facing degrees
Custom script: call RemoveLocation(udg_Point_Array[2])
Unit - Add Massiveness (Doomy) to (Last created unit)
Unit - Set level of Massiveness (Doomy) for (Last created unit) to (Level of (Ability being cast) for (Casting unit))
Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_Point_Array[1])


Part 10
Spoiler:
Some parts of it is missing, please post your reply and I will add it to the list. Thanks.

Trigger Index

Contents:
PART I

1.General
2.AI
3.Animation
4.Camera
5.Cinematic
6.Countdown Timer
7.Destructible
8.Dialog
9.Environment
10.Floating Text
11.Game
12.Game Cache
13.Hero
14.Items
15.Image
16.Leaderboard
17.Lightning
18.Melee Game
19.Multiboard
20.Neutral Building
]21.Player
22.Player Group
23.Quest
24.Region
25.Seletion
26.Sound
27.Special Effect
28.Trigger
29.Unit
30.Unit Group
31.Ubersplat
32.Visibility

---------------------------------
PART II

33.Preset Unit Functions
34.Preset String Functions
35.Preset Integer Functions
36.Preset Real Functions
37.Preset Unit-Type Functions
38.Preset Item Functions
39.Preset Unit Group Functions
40.Preset Player-Group Functions
41.Preset Item-Type Functions
42.Preset Item-Class Functions
42.Preset Point Functions



-------------------------------------------------------------------------------------------------



PART I


1.General
Do Nothing - Does nothing.

Wait - Waits a time (seconds)

Wait (Gametime) - Waits a time (Gametime)

Wait For Condition - Waits until a certain preset condition comes true

Wait for Sounds - Waits until a certain sound plays

Set Variable - Sets a variable of your choice to a value of your choice

Skip Remaining Actions - Skips all remaining actions in the current trigger

If/Then/Else, Multiple Functions - If conditions = Values, then do Actions, else do Actions

If/Then/Else - If a condition = Value, then do Action, else do Action

For each integer A, do Multiple Actions - Runs a loop for # - # times, and remembers how many times it has looped as Integer A

For each integer B, do Multiple Actions - Runs a loop for # - # times, and remembers how many times it has looped as Integer B

For each integer Variable, do Multiple Actions - Runs a loop for # - # times, and remembers how many times it has looped as Variable

For each integer A, do Action - Runs a loop for # - # times, and remembers how many times it has looped as Integer A

For each integer B, do Action - Runs a loop for # - # times, and remembers how many times it has looped as Integer B

For each integer Variable, do Action - Runs a loop for # - # times, and remembers how many times it has looped as Variable

2.AI
Start Melee AI Script - Starts an AI script for a designated player (Should be computer).

Start Campaign AI script - Starts a campaign AI script for a designated player (Should be computer).

Send AI Command - Sends a custom AI command for a designated player (Should be computer).

Ignore Units Guard Position - Ignores a specific unit, and all AI commands to that player will not effect that specific unit.

Ignore All Units Guard Position - Ignores ALL units of a specific player, as if they aren't there for the AI.

Recycle Unit Guard Position - Resets the unit, so it can get commands from the AI again.

Lock AI Guard Position - Makes it unable to change weather it will take commands or not.

3.Animation
Play Unit Animation - Plays a units animation. Common animations are: stand - walk - stand work - death - +more, to find the extra ones, click the unit in the unit pallet, and at the left side of the screen, change the animation.

Play Unit Animation (Specific Rarity) - Plays a units animation based on the rarity, if the command givin is common, put common, if rare, put rare.

Queue Unit Animation - Queues a units animation so it will do it as soon as it is finished the previous one.

Reset Unit Animation - Resets the units animation, so it will be standing again.

Add/Remove animation Tag - Adds a tag to a unit, for example a unit without the stand work animation, you could add it to them.

Lock Body-Part Facing - Makes a certain body part face another unit, for example, you could make a peasents head face another peasents head.

Reset Body-Part Facing - Makes the unit face normally.

Change Unit Size - Changes the size of a unit

Change Unit Vertex Coloring - Changes the units coloring based on RGB(Red, Green, Blue) and Transparency.

Change Unit Animation Speed - The higher the animation speed, the faster the unit seems to do something. If I set it to 500 for example, he would seem to run really fast, but he would still move the same speed as set.

Change Unit Turn Speed - Changes the turning speed of a unit.

Change Unit Blend Time - Changes how fast the units body-parts will face another unit

Change Unit Flying Height - Changes the flying height of a unit, but only if it already flys.

Change Unit Prop Window Angle - ????

Play Destructible Animation - Plays a destructibles animation.

Queue Destructibles Animation - Makes the destructible do the animation once it is finished current animations

Change Destructible Animation Speed - Same as the unit animation speed, except to a destructible

Play Animation for Doodads in a Region - Plays an animation for all doodads in a preset region

Play Animation for Doodads in a Circle - Plays an animation for all doodads in a circle

4.Cameras
Apply Camera Object(Timed) - Will apply a preplaced camera from the editor.

Pan Camera(Timed) - Will pan the camera to a preset region over time.

Pan Camera with Interpolated Height - Pans the camera to a place with a preset height.

Pan Camera as Nessecary - Pans the camera to a place ONLY IF NECESSARY, if you are already at the place, it will not try to pan there.

Set Camera Field(Timed) - Sets a camera field over time.

Rotate Camera around point - Will rotate the camera around a point for (Number)°.

Lock Camera to Unit - Locks the camera to a unit.

Lock Camera Orientation to unit - Locks the camera to a unit offset by something.

Play cinematic sequence - Will play a premade cinimatic sequence (Unnessicary)

Stop Camera - Stops the camera for a player no matter where it is going.

Reset Game Camera - Resets the camera entirely for a player.

Change Camera Smoothing Factor - Will make the camera very smooth and nice if set to a high number.

Reset camera smoothing factor - Sets the cameras smoothing factor to normal.

Sway camera source - Sways the camera source for a player with a velocity and magnitude.

Sway camera target - Sways the camera target for a player with a velocity and magnitude.

Shake Camera - Will shake the camera up and down for a player with magnitude.

Stop Shaking/swaying camera - Pretty clear itself...

Extend/shrink camera bounds - Will allow your camera to go farther around the map or less far around the map then before.

Set Camera Bounds - Locks the camera to a specific region, rendering you unable to move out of that region

Set Camera-Spacebar point - Sets the point where if you press spacebar it will take you there.

5.Cinimatics
Transmission from Unit - Sends a transmission to a player from a unit with text and sound and time.

Transmission From Unit Type - Sends a transmission to a player from a unit-type with text and sound and time.

Subtitle Override - Will show the text even if the user has Subtitles turned Off.

Cinimatic Mode - Turns cinimatic mode on or off for a player group

Cinimatic Mode (Timed) - Turns cinimatic mode on or off for a player group for a time.

Fade Filter - Fades in/out/in and out over a time, with an image

Advanced Filter - A more advanced way to use a fade filter, with the extra options of blending, and start/end color.

Show/Hide filter - Shows/Hides a fade filter for all players

Ping Minimap - Pings the minimap at a region for a time

Ping Minimap with Color - Pings the minimap at a region for a time with color.

Flash a Speech indicater for a unit - Puts a little circle of your color underneath a unit for a split second.

Flash a Speech Indicater for a Destructible - Puts a little circle of your color underneath a destructible for a split second.

Flash a Speech Indicater for an Item - Puts a little circle of your color underneath an item for a split second.

Clear Text Messages - Clears all messages on the screen.

Letterbox Mode On - Turns letterbox mode on

Letterbox Mode Off - Turns letterbox mode off

Disable User Control - Disables user control for a player group.

Enable User Control - Enables user control for a player group.

Enable/Disable Occlusion - This will clear all trees/objects in the way of the camera, by making them transparent.

Enable/Disable Boundary Tinting - This will tint the boundary if enabled

6.Countdown Timers
Start Timer - Starts a timer as a one-shot/repeating timer.

Pause Timer - Pauses/unpauses a timer.

Create Timer Window - Creates a window for a timer, for the players in game to see.

Destroy Timer Window - Destroys the window for a timer.

Hide Timer Window for player - Hides/Shows a timer window for a player.

Hide Timer Window - Hides/Shows a timer window.

Change Timer Window Title - Changes the title of a timer window

Change Timer Window Title Color - Changes the color of a title for a timer window

Change Timer Window Time Color - Changes the Color of the Time for a Timer Window

7.Destructible
Create - Creates a destructible at a point with a scale, facing, and variation.

Create(dead) - Creates a dead destructible at a point with a scale, facing, and variation.

Kill - Kills a destructible

Remove - Removes a destructible

Ressurect - Ressurects a destructible

Show/Hide - Shows/Hides a destructible

Set Life to Percentage - Sets the life of a destructible to a preset percent

Set Life to Value - Sets the life of a destructible to a preset value

Set Max Life - Sets the max life of a destructible to a value

Open/Close/Destroy Gate - Opens/Closes/Destroys a gate.

Open/Close Elevator Walls - Opens/Closes an elevator wall for entrance

Set Elevator Height - Sets the hieght of an elevator.

Make Invulnerable/Vulnerable - Makes a destructible Invulnerable or Vulnerable

Set Occlusion Height - Sets the height of a destructible that would become invisible if the camera cannot see through it.

Pick Every Destructible In Region and do Actions - Self Explanitory.

Pick Every Destructible In Circle and do Actions - Self Explanitory.

Pick Every Destructible In Circle and do Action - Self Explanitory.

Pick Every Destructible In Region and do Action - Self Explanitory.

8.Dialog
Show/Hide - Shows/hides a dialog box for a specific player

Change Title - Changes the Title of a Dialog Box

Create Dialog Button - Creates a button for a dialog box

Clear - Removes all buttons and labels on a dialog box
[anchor]Environment[/anchor]
9.Environment
Create Weather Effect - Creates a weather effect on a region

Enable/Disable Weather Effect - Enables or Disables a weather effect

Remove Weather Effect - Removes the Weather Effect Specified

Create Terrain Deformation: Crater - Creates a crater like hole in the ground at a point, with a preset depth and width.

Create Terrain Deformation: Ripple - Creates a ripple at a point for a time, with a preset depth and width

Create Terrain Deformation: Wave - Creates a wave in the terrain at a point for a time, with a preset depth and width

Create Terrain Deformation: Random - Will create a random terrain deformation at a point, with a preset depth between 2 numbers and a width.

Stop Terrain Deformation - Stops a specified terrain deformation.

Stop All Terrain Deformations - Stops ALL terrain deformations.

Turn Water Deformation On/off - Enables the terrain deformations to effect the surface of the water, or just the terrain underneath.

Change Terrain Type - Changes the type of terrain at a point with size and variation

Turn Terrain Pathing On/Off - VERY useful trigger, enables the walkability/flyability/etc on a certain terrain type.

Set Water Tinting Color - Sets the water color based on RGB, and transparency.

Set Sky - Changes the sky visable in game.

Set Fog - Sets fog style and amount, and color.

Reset Fog - Sets the fog to the initial.

Create/Remove Blight Region - Creates or Removes a region of blight for a player.

Create/Remove Blight Circle - Creates or Removes a circle of blight for a player.

10.Floating Text
Create Floating Text at Point - Creates Floating Text at a point with a Message, Color, size, and Z Offset.

Create Floating Text Above Unit - Creates Floating Text Above a Unit with a Message, Color, Size and Z Offset.

Destroy - Destroys the specified floating text.

Show/Hide - Shows/Hides the specified floating text for a player group.

Set Velocity - Sets the velocity of a floating text to an integer and an angle.

Change Color - Changes the color of Floating Text based on RGB, and transparency.

Change Position to Point - Moves the Text to another Point

Change Position to Unit - Moves the Text to a Unit

Change Text - Changes the Message of a Floating Text.

Suspend/Resume - ????

Perminant/Expires - Decides weather a Floating Text will expire, or if it is there for the entire game.

Change Lifespan - Changes the time the floating text will show.

Change Fading Age - Changes how long it will take for the text to fade away.

Change Age - Sets how long the Text has been Showing.

11.Game
Text Message(Auto-Timed) - Displays a Message to a Player Group, for a time based on how long the message is.

Text Message(Explicitly Timed) - Displays a Message to a Player Group for the time Specified.

Pause Game - Pauses the Game, as if a player had pressed Pause from the start menu.

Unpause Game - Unpauses the game, as if a player had press Resume form the start menu.

Set Game Speed - Sets the game speed(Not sure what effect it has)

Lock Game Speed - Prevents the speed from being changed

Unlock Game Speed - Allows the speed to be changed

Set Map Flag - Sets a certain flag on/off. This can be very useful:

Use Handicaps - Enables use of handicaps

Allow Observers - Allows observers

Observers on Defeat - Decides weather observers are allowed to watch after the game is over

Lock Resource Trading - Disables the Trading of Resourses

Restrict Resource Trading to Allies - Duh.

Lock Alliance Settings - Makes the players unable to change whom they are allies with.

Hide Alliance Changes - Makes the Players unable to See whom they are allies with.

Map Transitioned - No clue.

Use Random Heros - No clue.

Use Random Races - Picks a random race, no matter which race you have chosen.

Visibility: Hide Terrain - Makes the map hidden

Visibility: Explored - Makes the map Visible, but not seeable.

Visibility: Always Visible - Makes the map entirely visible.



Set Time of Day - Sets the time of day to a Real Number.

Set Time of Day Speed - Changes the speed that the clock ticks, based on Percentage.

Turn Night/Day Cycle On/Off - The clock will still tick, but the night/day cycle will stop. It will always be day/night, depending on what it is when this is run.

Share Vision and Full Unit Control with Team - Shares Vision and Full Unit Control with the specified players entire team.

Give Units to Neutral Victim - Gives all of the specified players units to Neutral Victim.

Set Next Level - Sets the Next Level for a Campaign map.

Victory - Gives victory to a player.

Defeat - Gives defeat to a player, with a message.

Load Game - Loads a map.

Save and Load Game - Saves current game, and loads a new one.

Save Game and Change Level - Saves Current Game, and Goes to a new level.

Rename Saved-Game folder - Renames the folder which saved files get saved into(Unnessicary)

Delete Saved-Game Folder - Deletes the specified folder with saved games in it.

Copy Saved-Game - Copys a Saved Game file with a new name.

Set Campaign Screen - Sets the image for the campaign screen.

Enable/Disable Mission - Enables or Disables a mission.

Enable/Disable Campaign - Enables or Disables a campaign.

Enable/Disable Cinimatic - Enables or Disables a Cinimatic.

Show/Hide a Custom Campaign button - Shows or Hides a Campaign Button Number on the Campaign Screen.

Set Ally Color Filtering - Sets weather the Ally Colors show up on the minimap/real map or not.

Show/Hide Creep Camp Icons for the Minimap - Simple.

Enable/Disable Minimap Buttons - Enables or Disables the use of the buttons beside the minimap in game.

Enable/Disable Selection - Enables or Disables selection of Units and/or the Selection Circles

Enable/Disable Drag-Selection - Enables or Disables the drag-selection and/or the drag-selection box.

Enable/Disable Pre-Selection - Not sure.

Force UI key - Forces a Player to Press a key.(Should work if that key is a hotkey)

Force UI Cancel - Forces a player to press the escape key.

Preload File - Preloads a model/skin file to reduce lag when a unit with that skin/model is created.

Begin Preloading - Starts the preloading

Preload Batch - Opens a JASS based file which has a series of lines, of all the files to preload. This will prevent a lot of Preload File triggers.

12.Game-Cache(Note: This is used mostly for single player maps.)
Create Game Cache - Creates a Game Cache with a Filename.

Save Game Cache - Saves the Game Cache

Store Unit - Stores a unit into the Game Cache, with a label.

Store Real - Stores a Real into the Game Cache, with a label.

Store Integer - Stores a Integer into the Game Cache, with a label.

Store Boolean - Stores a Boolean into the Game Cache, with a label.

Store String - Stores a String into the Game Cache, with a label.

Restore Unit Facing Angle - Restores a Labeled unit from a game cache in a region with a facing angle.

Restore Unit Facing Point - Restores a Labeled unit from a game cache in a region with a facing point.

Reload All - Loads all game cache data on the harddrive.

Clear Game Cache - Clears a game cache of all memory.

Clear Category - Clears all data inside a category of the cache.

13.Hero
Learn Skill - Learns a skill for a hero

Set Level - Sets the level of a hero to an Integer.

Set Experience - Sets the Experience of a Hero to an Integer.

Add Experience - Adds Experience to a Hero

Enable/Disable Experience Gain - Enables or Disables the gaining of experience for a unit.

Set Experience Rate - Sets the Rate of EXP gain for a player, based on a percent.

Revive(Instantly) - Revives a Unit Instantly at a point.

Modify Hero Attribute - Adds/Sets/Subtracts the Str/Agi/Int of a hero to an Integer.

Modify Hero Skill Points - Adds/Sets/Subtracts Skill Points to a Hero.

Reserve Hero Buttons - ????

Give Item to Hero - Instantly moves an item into the specified heros inventory. If it is full, it will be at his feet.

Create Item for Hero - Creates an item directly into the specified heros inventory. If it is full it will be at his feet.

Drop Item from Hero - Drops an item from a hero to put it at his feet.

Drop Item from Hero Inventory Slot - Drops an item from a specific inventory slot in a hero.

Use Item on a Unit - Uses an item on a Unit. If the item does nothing, nothing will happen.

Use Item on a Point - Uses an Item on a Point. If the item does nothing, nothing will happen.

Use Item on a Destructible - Uses an Item on a Destructible. If the item does nothing, nothing will happen.

Use Item - Uses an item, if the item requires a target, nothing will happen.

14.Item
Create - Creates an item at a point

Remove - Removes an item

Show/Hide Item - Shows or Hides an item in the game.

Move(Instantly) - Moves an Item Instantly to a Point

Set Life - Sets the life of an item

Set Charges Remaining - Sets the amount of uses left in an item.

Make Invulnerable/Vulnerable - Obvious.

Make Pawnable - Makes an item sellable or not sellable to a store.

Make Undropable - Makes an Item unable to be Dropped or Moved.

Make Items Drop from Heros Upon Death - Makes items drop from heros when they die. You can set this so it Doesn't and it will be useful.

Change Owner - Changes the owner of an item.

Set Custom Value - Sets the custom value of an item to an Integer. Can be very useful.

Pick every Item in Region and do Actions - Self Explanitory.

Pick every Item in Region and do Action - Self Explanitory.

15.Image
Create - Creates an image with a path at a point and with a type.

Destroy - Destroys an image.

Show/Hide - Shows or Hides an Image in game.

Change Constant Height - Changes the height of an image.

Change Position - Changes the position of an image.

Change Color - Changes the color of an image based on RBG, with transparency.

Change Rendering State - Enables or Disables rendering state for an image(????)

Change Render Always State - Enables or Disables render always state for an image(????)

Change above water State - Enables or Disables above water state for an image(????)

Change Type - Changes the type of image.

16.Leaderboard
Create - Creates a leaderboard with a title

Destroy - Destroys a leaderboard.

Sort - Sorts a leaderboard by Value/Player/Label in Acending/Decending order.

Show/Hide - Shows or Hides a leaderboard.

Change Title - Changes the title of a leaderboard.

Change Label Colors - Changes the color of a label, based on RBG, with transparency.

Change Value Colors - Changes the color of a value, based on RBG, with transparency.

Change Style - Changes the Style of a Leaderboard to: Show/Hide title, Show/Hide Labels, Show/Hide Values, and Show/Hide Icons.

Add Player - Adds a player to the leaderboard.

Remove Player - Removes a plaer from the leaderboard.

Change Player Label - Changes what the player is called on the leaderboard.

Change Player Label Color - Changes what color the label is, based on RBG, with transparency.

Change Player Value - Changes the value for a player to an Integer.

Change Player Value Color - Changes the color of a players value, based on RBG, with transparency.

Change Player Style- Changes the style of a player to: Show/Hide Label, Show/Hide Value, and Show/Hide Icon.

17.Lightning
Create - Creates a lightning effect with a path, from a source, to a target.

Destroy - Destroys a lightning effect.

Move Lightning Effect - Moves a lightning effect to a source and a target.

Set Lightning Effect Color - Changes the Color of the Lightning Effect.

18.Melee Game
*These are self explanitory*

Use Melee Time of Day

Hero Limits

Hero Starting Items

Set Starting Resources

Remove Excess Units

Create Starting Units

Run AI

Victory/Defeat Conditions

Create Starting Units for Player

19.Multiboard
Create - Creates a Multiboard with an amount of Rows and Columns, and a title.

Destroy - Destroys a Multiboard.

Show/Hide - Shows or Hides a Multiboard

Show/Hide all Multiboards - Shows or Hides ALL Multiboards.

Minimize/Maximize - Minimizes or maximizes a multiboard

Clear - Clears a multiboard of all values and labels.

Change Title - Changes the title of a multiboard.

Change Title Color - Changes the Color of the Title, based on RBG, with transparency.

Change Number of Rows - Changes the number of rows

Change Number of Columns - Changes the number of columns.

Set Item Display Style - Sets the display style for an item in a Row x Column, to Show/Hide text and Show/Hide icons.

Set Item Text - Changes the Text of an Item in Row x Column.

Set Item Color - Changes the color of an item in Row x Column, based on RBG, with transparency.

Set Item Width - Changes the width of an item

Set Item Icon - Sets the Icon shown for an item

20.Neutral Building
Add Gold to Gold mine - Adds an Integer amount of gold to a gold mine

Set Resources of Gold Mine - Sets the amount of gold in a gold mine.

Haunt Gold mine - Haunts a gold mine instantly for a player.

Enable/Disable Waygate - Enables or DIsables the use of a waygate.

Set Waygate Destination - Sets the point the waygate takes you.

Change Special Minimap Icon - Changes the Minimap Icon for a specific building.

Turn Special Minimap Icon On/Off - Turns the minimap icon On or Off for a building.

Add Item-Type to Marketplace - Adds an item of a type to a marketplace.

Add Item-Type to all Marketplaces - Adds an item of a type to all marketplaces.

Add Unit-Type to Marketplace - Adds an unit of a type to a marketplace.

Add Unit-Type to all Marketplaces - Adds an unit of a type to all marketplaces.

Remove Item-Type to Marketplace - Removes an item of a type to a marketplace.

Remove Item-Type to all Marketplaces - Removes an item of a type to all marketplaces.

Remove Unit-Type to Marketplace - Removes an unit of a type to a marketplace.

Remove Unit-Type to all Marketplaces - Removes an unit of a type to all marketplaces.

Limit Item Slots - Limits the amount of items in a shop.

Limit Item Slots(All Shops) - Limits the amount of items in all shops.

Limit Unit Slots - Limits the amount of units in a shop.

Limit Unit Slots(All Shops) - Limits the amount of units in all shops.

21.Player
Set Property - Sets the gold/lumber/availabler free heros/gold upkeep rate/lumber upkeep rate/total gold gathered/total lumber gathered/food used/food cap/food max/game result to an Integer for a player.

Add Property - adds gold/lumber/availabler free heros/gold upkeep rate/lumber upkeep rate/total gold gathered/total lumber gathered/food used/food cap/food max/game result with an Integer for a player.

Turn Player Flag On/off - Turns a player flag on or off for a player. Unfollowable/Gives Bounty/Allied Victory.

Invert Incom(Tax) - Gives a Percent of the players income to another player.

Enable/Disable sleeping for all creeps - Enables or Disables sleeping for all creeps.

Set Alliance - Sets an alliance from a player to a player.

Set Aspect of Alliance - Changes an aspect of an alliance from one player to another.

Enable/Disable Ability - Enables or Disables an ability for a Player. A disabled ability will not show up.

Set Training/Construction availability of a unit - Sets the availability of a unit for a player.

Limit Training of Unit-Type - Limits the Amount of Units available to train for a player. -1 will be infinite.

Limit Training Of Heros - Limits the Amount of Heros available to train for a player. -1 is infinite.

Set Current Tech Reaserch Level - Sets the level of a reaserch tech for a player.

Set Max Reaserch level - Sets the maximum levels of a reaserch tech for a player.

Change Color - Changes the player color of a player.

Set Handicap - Sets a handicap for a player.

Show/Hide in Score Screen - Shows or Hides a player in the score screen.

Set Name - Sets the Name of a Player.

22.Player Group
Pick Every Player in Player Group and Do Actions - Does Actions for each Player in a Player group.

Pick Every Player in Player Group and Do Action - Does an Action for each Player in a Player group.

Add Player - Adds a player to a player group.

Remove - Removes a player from a player group.

Clear - Clears a player group of all players.

Set Alliance - Sets the alliance of all players in a player group.

23.Quest
Quest Message - Displays a quest message to a player group. (Plays a sound based on type of message)

Create Quest - Creates a quest with a title, description, and icon.

Destroy Quest - Removes a quest from the game.

Enable/Disable Quest - Enables or Disables a quest. A disabled quest will not show in the list.

Mark Quest as completed - Marks a quest as completed.

Mark Quest as Failed - Marks a quest as failed.

Mark Quest as Discovered - Marks a quest as discovered.

Change Quest Title - Changes the title for a quest.

Change Title Description - Changes the description for a quest.

Create Quest Requirement - Changes the requirements for a quest.

Mark Quest Requirement as Completed - Marks a quest requirement as completed.

Change Quest Requirement Description - Changes the description of a Qest Requirement.

Create Quest Defeat Condition - Creates a defeat condition

Destroy Quest Defeat Condition - Destroys a quest defeat condition

Change Quest Defeat Condition Description - Changes the description for a quest.

Flash Quest Dialog Button - Makes the quests(F9) button flash.

24.Region
Move - Moves a region to a point.

25.Selection
Clear Selection for Player - Clears the Selection for a Player.

Select Unit Group for Player - Selects a unit group for a player.

Select Unit for Player - Selects a unit for a player.

Add Unit to Selection for Player - OmgDUH!!!!

Remove Unit from Selection for Player - Don't even ask.

Clear - Diselects EVERY unit from EVERY player in the ENTIRE map.

Select Unit Group - Selects a unit group for EVERY PLAYER.

Select Unit - Selects a unit for EVERY PLAYER

Add Unit - Adds a unit to ALL PLAYERS selection.

Remove Unit - Removes a unit from ALL PLAYERS selection.

26.Sound
Play Sound - Plays a sound.

Play sound at Point - Plays a 3d sound at a point.

Play sound on Unit - Plays a 3d sound on a unit.

Play sound from Offset - Plays a sound from offset.

Stop Sound - Stops a sound.

Destroy Sound - Destroys a sound.

Set Sound Volume - Sets the volume of a sound.

Skip to Sound Offset - Skips to a point in the sound and plays from there.

Set sound cutoff distance - Skips to a point in the sound and knows to stop there.

Set Sound Pitch - Changes the pitch of a sound.

Attach 3D sound to unit - Duh.

Set 3D sound Position - Changes the position of a 3D sound.

Set 3D sound Distances - Changes the distance of a 3D sound.

Add/Remove a 3D sound accross a region - Duh.

Use Daytime Ambient sound - Uses a sound based on an environment for an area.

Use Night time Ambient sound - Uses a sound based on an environment for an area.

Enable/Disable Dawn/Dusk sounds - Duh.

Set Music List - Sets the music list with a starting song.

Set Music List - Sets the music list with a random starting song.

Clear Music List - Clears the music list of all music.

Play Music - Plays a music.

Play Music from Offset - Plays a unit from a point.

Play Music Theme - Plays a music theme.

Play Music Theme from Offset - Skips to a point in the Music and starts from there.

Stop Music Theme - Stops Music Theme.

Stop Music - Stops the music.

Resume Music - Resumes the music.

Set Music Volume - Sets the volume to a percentage.

Skip to Music Offset - Skips to a point in the music.

Skip to Music Theme Offset - Skips to a point in the music theme.

Set Volume Channel - Changes the volume of a Music.

Change all Volume Channels for Cinimatic - Changes the Volume Level of Cinimatic Speech.

Set All Volume Channels for Speech - Changes the volume Level of Unit Speech

Reset All Volume Channels - Resets the volume channels

27.Special Effect
Create Special effect at Point - Creates a special effect at a point from a path.

Create Special effect on unit - Creates a special effect on a unit from a path.

Destroy Special Effect - Destroys a special effect.

28.Trigger
Turn Off - Turns off the specified trigger

Turn On - Turns on the specified trigger.

Run(Checking Conditions) - Runs a trigger only if the conditions are true.

Run(Ignoring Conditions) - Runs a trigger ignoring conditions.

Add To Trigger Queue - Adds a trigger to the queue, so it will run after the current triggers are finished.

Remove From Trigger Queue - Removes from the queue.

Clear Trigger Queue - Clears all triggers in the queue.

Clear Trigger Queue of Pending Triggers - Clears all Pending Triggers in the queue.

Add New Event - Adds a new event to the specified trigger.

29.Unit
Create Units Facing Angle - Creates an Integer Amount of a Unit-Type of units at a Point for a player, facing an angle.

Create Units Facing Point - Creates an Integer Amount of a Unit-Type of units at a Point for a player, facing a point.

Create Corpse - Creates a corpse of a Unit-Type for a player at a Region.

Create Permenant Corpse - Creates a corpse which will never expire of a Unit-Type for a player at a region.

Kill - Kills a unit.

Remove - Removes a unit.

Explode - Explodes a unit.

Replace - Replaces a unit with another one.

Hide - Hides/Shows a unit on the map.

Change Color - Changes the color of a unit to a preset color.

Change Owner - Changes the owner of a unit.

Share Vision - Shares the vision of a specific unit to another player.

Move Unit Instantly - Moves a unit instantly.

Move unit and Face Angle Instantly - Moves a unit with a new facing angle to a point instantly.

Move unit and Face Point Instantly - Moves a unit with a new facing point to a point instantly.

Set Rally Point to Point - Sets a units rally point to a point.

Set Rally Point to Unit - Sets the rally point to a unit.

Set Rally Point to Destructible - Sets the rally point to a destructible.

Set Life - Sets a units life to a percent

Set Mana - Sets a units mana to a percent.

Set Life - Sets a units life to a value

Set Mana - Sets a units mana to a value.

Make Invulnerable/Vulnerable - Duh.

Pause/Unpase - Gets rid of all abilities on the unit, including move, and build.

Pause/Unpase all units - Gets rid of all abilities on every unit, including move, and build.

Pause/Unpase Expiration timer for a unit - Summoned units have expiration timers. This will pause or unpause one.

Add Expiration Timer - Adds an expiration timer for a unit.

Make Unit Explode on Death - Makes the unit explode when it dies.

Suspend Corpse Decay - Stops the corpse decay.

Reset Ability Cooldowns - Resets all ability cooldowns.

Set Building Construction Progress - Sets the progress of a building construction to a percent.

Set Building Upgrade Progress - Sets the progress of a building upgrading to a percent.

Make Unit Sleep - Makes a unit sleep.

Make Unit Sleep At Night - Makes a Unit Sleep at Night.

Wake Up - Makes a unit Wake up.

Turn Alarm Generation on/off - Turns off or on the sound alerts like, "Our allies forces are under attack!"

Rescue Unit - Rescues a unit for a player, transfering ownership to them.

Make Unit Rescuable - Makes a unit rescuable by a player group.

Set Rescue Range - Sets the range of a unit being rescued.

Set Rescue Behavior for Units - Sets the color of the rescuable units.

Set Rescue Behavior for Buildings - Sets the color of the rescuable buildings.

Enable/Disable Supply Range for Unit - ????

Make Unit Face Unit - Makes a unit face another unit over a time.

Make Unit Face Point - Makes a unit face a point over a time.

Make Unit Face Angle - Makes a unit face an angle over a time.

Set Movement Speed - Changes the speed of a unit.

Turn Collision on/off - Makes units uncolliding with other units.

Set Acusition Range - Sets the range that units see other units to attack.

Set Custom Value - Sets the custom value of a unit.

Remove Buffs - Removes all buffs from a unit.

Remove Buffs By Type - Removes all buffs of a type from a unit.

Remove Specific Buff - Removes a buff of a type from a unit.

Add Ability - Adds an ability to a unit

Remove Ability - Removesan ability from a unit.

Add Classification - Adds a classification from a unit.

Remove Classification - Removes a classification from a unit.

Issue Order Targeting a Unit - Issues an order targeting a unit.

Issue Order Targeting a Point - Issues an order targeting a point.

Issue Order Targeting a Destructible - Issues an order targeting a destructible.

Issue Order Targeting an item - Issues an order targeting an item.

Issue Order with no target - Issues an order with no target.

Issue Train/Upgrade Order- Issues a train/upgrade order to a unit.

Issue Reaserch Order- Issues a reaserch order to a unit.

Issue Build Order- Issues a build order to a unit.

Issue Drop Item Order- Issues a drop item order to a unit.

Issue Move item Order- Issues a move item order to a unit.

Issue Give Item Order- Issues a give item order to a unit.

Damage Area - A unit deals damage to a circle centered on a point with a Real number damage.

Damage Target - A unit deals damage to a unit with a Real number damage.

Decrease Level of Ability for Unit - Duh.

Increase Level of Ability for Unit - Duh.

Set Level of Ability for Unit - Duh.

30.Unit Group
Pick Every Unit in Unit Group and Do Actions - Self Explanitory.

Pick Every Unit in Unit Group and Do Action - Self Explanitory.

Add Unit - Adds a unit to a unit group

Add Unit Group - Adds all units in a unit group into another unit group.

Remove Unit - Removes a unit from a unit group.

Remove unit Group - Removes all units of another unit group from another Unit Group.

Clear - Removes all units from a unit group.

Issue Order Targeting a Unit - Issues an order targeting a unit.

Issue Order Targeting a Point - Issues an order targeting a point.

Issue Order Targeting a Destructible - Issues an order targeting a destructible.

Issue Order Targeting an item - Issues an order targeting an item.

Issue Order with no target - Issues an order with no target.

Issue Train- Issues a train order to a unit.

31.Ubersplat
Create - Creates an ubersplat at a point.

Destroy - Destroys an ubersplat.

Reset - Resets an ubersplat.

Finish - Finishes an ubersplat.

Show/Hide - Shows or Hides an ubersplat.

Change Rendering State - Enables or Disables rendering state for an image

Change Render Always State - Enables or Disables render always state for an image

32.Visibility
Self Explanitory:
Enable Fog of War

Disable Fog of War

Enable Black Mask

Disable Black Mask

Create Visibility Modifier Region - Creates a type of visibility across a region for a player.

Create Visibility Modifier Circle - Creates a type of visibility across a circle for a player.

Enable Visibility Modifier - Enable a visibility modifier.

Disable Visibility Modifier - Disable a visibility modifier.

Destroy Visibility Modifier - Destroy a visibility modifier



Part 11
Spoiler:
PART II

33.Preset Unit Functions
Last Created Unit - Self Explanible.

Last Restored Unit - The last unit to be restored via Game Cache.

Last Replaced Unit - The last unit to be replaced via the Replace Unit trigger.

Last Haunted Gold mine - The last gold mine to be haunted by a trigger.

Picked unit - The unit(s) picked with a Pick Every Unit in Unit Group trigger.

Matching Unit - Use this when picking a unit group matching a condition.

Random Unit from Unit Group - Duh.

Event Responses: (Self Explanitory)
Attacked Unit
Attacking Unit
Buying Unit
Cancelled Structure
Casting Unit
Constructing Structure
Constructed Structure
Damage Source
Decaying Unit
Dying Unit
Entering Unit
Hero Manipulating Item
Killing Unit
Learning Hero
Leaving Unit
Leveling Hero
Loading Unit
Ordered Unit
Ownership-Changed Unit
Reaserching Unit
Revivable Hero
Reviving Hero
Selling Unit
Sold Unit
Summoned Unit
Summoning Unit
Target Unit of Order being Issued
Target unit Of Ability Being Cast
Targeted Unit
Trained Unit
Transporting Unit
Triggering Unit

Rally-Point as Unit - Will count the rally pointed unit as a unit, if the unit has a rally point ON a unit.

34.Preset String Functions
Concentate Strings - Merges two strings together.

Substring - Uses the 2 points specified and picks the text in between.

Convert Integer to String - Converts an integer into a string.

Convert Real to String - Converts a real into a string.

Convert Real to Formatted String - Converts a real into a string, but only the substring of it specified.

Convert Order to String - Converts an order into a string.

Convert Unit-Type to String - Converts a unit type into a string.

Convert Externalized String - ????

Convert String Case - Converts a string into Lowercase or Uppercase.

Destructible Name - The name of a destructible.

Entered Chat String - The chat string entered.

Matched Chat String - Used with conditions.

Saved-Game Filename - The name of the save game file.

Ability Name - The name of an ability.

Ability Effect Art - The art shown when an ability is cast.

Ability Effect Sound Name - The name of the sound played when an ability is cast.

Load String Value - The value of a load string in a game cache.

Hero Proper Name - The proper name of a hero.

Item Name - The name of an Item

Multiboard Title - The title of a multiboard.

Player Name - The name of a player.

Trigger Name - The name of a Trigger.

Unit Name - The name of a unit.

35.Preset Integer Functions
Arithmitic - A function with a +/- or /,*.

For Loop Integer A - Remembers the number of times an Integer A Loop as run as a number.

For Loop Integer B - Remembers the number of times an Integer B Loop as run as a number.

String Length - The length of a string.

Convert Real to Integer - Duh.

Convert String to Integer - Duh.

Elevator Height - The height of an elevator.

Terrain Cliff Level - The height of a cliff at a region.

Terrain Variance - The terrain variance at a point

Learned Skill Level - The level of a Learned Skill

Number of Players - The number of players in the current game.

Number of Teams - The number of teams in the current game.

Ally Color Filter Setting - The setting of how the color of the allies are displayed, for example if it's at the original settings, you're white, the others are any color, if its at 2, then you're teal, and enemies are red.

Tournement Finish Rule - The rule about when a tourny will finish

Tournement Melee Score - The score of a player.

Load Integer Value - The value of an integer stored in a Game Cache.

Hero Level - The level of the specified hero.

Hero Exp - The exp on the hero.

Hero Attribute - The number of attribute points on str/agi/int and includes/excludes item/ability bonuses.

Unspent Skillpoints - The number of unspent skill points on a hero.

Item Level - The level of an item

Item Charges Remaining - The charges left on an item

Custom Value of Item - The custom value of an item

Leaderbard Position - The position of a player on a leaderboard.

Random Number - A random number between 2 numbers.

Min - The smallest number of the two specified.

Max - The largest number of the two specified.

Abs - The absolute of the number, (5 is 5, -5 is 5).

Sign - Returns the sign of the number, -1 for negative and 1 for positive.

For extra math help - Visit this tutorial: http://www.thehelper.net/forums/showthread.php?t=39620

Modulo - Calculates 2 numbers and finds out the remainder if devided.

Row Count - The number of rows in a multiboard

Column Count - The number of Columns in a multiboard.

Gold Remaining - The gold left in a gold mine.

Player Property - The number of *Player Property* from a player.

Player Tax Rate - The rate of tax that you may have set earlier.

Player Score - The score of a player.

Player Number - The number of a player.

Count Structures - The amount of structures owned by a player.

Count Non-Structures - The amount of non-structures(units) owned by a player.

Current Research Level - The level of a tech for a player.

Max Research Level - The max level of a tech for a player.

Player Team - The number of a players team.

Count Players In Player Group - Duh.

Count Units in Unit Group - Duh.

Count Living Units Owned by Player - Counts the amount of living units of a type owned by a player.

Supply Used - The amount of space a unit takes up in a boat.

Supply Provided - The amount of space a unit has to pick up other units.

Supply Used by Unit-Type - The amount of space a unit-type takes up in a boat.

Supply Provided by Unit-Type - The amount of space a unit-type has to pick up other units.

Point Value of Unit - The custom point value of a unit.

Point Value of Unit-Type - The custom point value of a unit-type.

Custom Value of Unit - The custom value of a unit.

Level of Unit - The level of a unit.

Level of Ability for Unit - Duh.

Count Items Carried - The amount of items carried by a unit.

Size of Inventory - The size of an inventory of a unit.

Count Buffs of Type - The amount of buffs of a type on a unit.

Trigger Evaluation Count - The amount of times an event has occurred on a trigger.

Trigger Execution Count - The amount of times a tigger has fully run.

Count Triggers in Trigger Queue - The amount of triggers in the queue.

36.Preset Real Functions
Arithmitic - A Plus, Minus, Division, or Multiplication Equasion with Real Numbers(With Decimals)

X of Point - the X value of a point

Y of Point - The Y Value of a Point.

Camera Field of Camera Object - A field of a Camera Object.

Camera Field of Current Camera - A field of the Current Camera.

Target X of Camera View - The X point of the Camera Veiw

Target Y of Camera View - The Y point of the Camera Veiw

Target Z of Camera View - The Z point of the Camera Veiw

Source X of Camera View - The Source of where X comes from in the Camera Veiw

Source Y of Camera View - The Source of where Y comes from in the Camera Veiw

Source Z of Camera View - The Source of where Z comes from in the Camera Veiw

Last Transmission Length - The length of the last played transmission on a Cinematic.

Convert Integer to Real - Converts an Integer to a Real Value.

Convert String to Real - Converts an String to a Real Value.

Convert Integer to Real - Converts an Integer to a Real Value.

Convert Degrees to Radians - Converts Degrees to Radians...

Convert Radians to Degrees - Converts Radians to Degrees

Elapsed Time - The elapsed time on a timer..

Remaining Time - The remaining time on a timer...

Initial Time - The starting time for a timer...

Life of a Destructible - The life of a destructible....

Max Life - The max life of a destructible.

Occlusion Height - The height of the occlusion for a destructible.

Damage Taken - The amount of damage taken.

Tournement Time Remaining - Time left in a tournement.

Time of Day - The time of day in game.

Time of Day Speed - The speed that the time of day ticks.

Load Real Value - The value of a Real Stored in a Game Cache.

Item Life - The life of an Item

Red Color of Lightning - 1 or 0, red or not.

Green Color of Lightning - 1 or 0, green or not.

Blue Color of Lightning - 1 or 0, blue or not.

Alpha Value of Lightning - Alpha Value of a Lightning

Random Number - A random Real between 2 numbers.

Random Angle - A random Real between 0.00 and 360.00

Random Percentage - A random percent from 0.00 to 100.00

Distance Between Points - The distance Between 2 Points.

Angle Between Points - The angle between 2 points.

Min - The smallest number of the two specified.

Max - The largest number of the two specified.

Abs - The absolute of the number, (5 is 5, -5 is 5).

Sign - Returns the sign of the number, -1 for negative and 1 for positive.

For extra math help - Visit this tutorial: http://www.thehelper.net/forums/showthread.php?t=39620

Modulo - Same as an integer Mod.

Power - A number powered by another number.

Square Root - The square root of a number.

Sine - For extra math help - Visit this tutorial: http://www.thehelper.net/forums/showthread.php?t=39620

Cosine - Visit this tutorial: http://www.thehelper.net/forums/showthread.php?t=39620

Tangent - Visit this tutorial: http://www.thehelper.net/forums/showthread.php?t=39620

Arcsine - Visit this tutorial: http://www.thehelper.net/forums/showthread.php?t=39620

Arcosine - Visit this tutorial: http://www.thehelper.net/forums/showthread.php?t=39620

Arcangent - Visit this tutorial: http://www.thehelper.net/forums/showthread.php?t=39620

Experience Rate - The rate of experience of a player.

Handicap - A players handicap.

Center X of Region - The X point of the position of a Region.

Center Y of Region - The Y point of the position of a Region.

Min X of Region - The min X point of the position of a Region.

Min Y of Region - The min Y point of the position of a Region.

Max X of Region - The max X point of the position of a Region.

Max Y of Region - The max Y point of the position of a Region.

Width of Region - The width of a region

Height of Region - The Height of a Region.

Sound Length - The length of a sound.

Music Length - THe length of music.

Property - A property of a unit, ex, Life.

Percentage Life - The life of a unit in percent.

Percentage Mana - The mana of a unit in percent.

Facing Angle - The facing angle of a unit.

Movement Speed - The moving speed of a unit.

Movement Speed - The default moving speed of a unit.

Aquisition Range - The aquisition range of a unit.

Aquisition Range - The default aquisition range of a unit.

Turn Speed - The turning Speed of a unit.

Turn Speed - The default turning Speed of a unit.

Prop Window Angle - ????

Prop Window Angle - ????

Flying Height - The flying height of a unit.

37.Preset Unit-Type Functions
Unit-Type of Unit - The unit TYPE of a UNIT.

Random Creep Unit Type - A random creep type of a level.

Random Neutral Building Type - Duh.

Convert String to Unit-Type - Converts a string into a unit type.

Trained Unit Type - The unit type of a trained unit.

38.Preset Item Functions
Last Created Item - The last item created via triggers.

Last Dropped Item - The last item dropped via triggers OR players.

Random Item in Region - A random item picked from a region.

Random Item in Region Matching Condition - A random item from a region matching a condition.

Picked Item - The item(s) picked via a Pick every Item trigger.

Matching Item - The function used to Match a Condition.

Item Carried By Hero - An item carried by a hero in a slot.

Item Carried By Hero Of Type - An item carried by a hero of a type.

Item Being Manipulated - The item being uses/dropped/aquired.

Sold Item - The item being sold.

Target Item of Ordered Being Issued - The targeted item of an order.

Target Item of Ability Being Cast - The targeted item of an ability being cast.

38.Preset Unit Group Functions
Last Created Unit Group - The last unit group created.

Random N Units From Unit Group - A random number of units from a unit group.

Units in Region - All units in a region

Units in Region Owned by Player - All units in a region owned by a player.

Units in Region Matching Condition - All units in a region matching a condition.

Units in Range - All units in a range

Units in Range Matching Condition - All units in a range matching a condition

Units Owned By Player - All units owned by a player

Units Owned By Player Of Type - All units owned by a player of a Unit-Type

Units Owned By Player Matching Condition - All units owned by a player matching a condition

Units of Type - All units of a Unit-Type

Units Selected - All units selected by a player.

40.Preset Player-Group Functions
All Players - Every single player.

All Players Of Control - All players controlled by a computer/user/etc.

All Players Matching Condition - All players matching the specified condition.

Allies of Player - All players whom are allies to the specified player.

Enemies Of Player - All players whom are enemies to the specified player.

Convert Player to Player Group - Converts a single player into a player group.

41.Preset Item-Type Functions
Item-Type of Item - The item type of an item

Random Item Type - A random item type of a level.. -1 is any level.

Random Item Type Of Class - A random item type of a level and class.. -1 is any level.

41.Preset Item-Class Functions
Item-Class of Item - The item class of an item.

42.Preset Point Functions
Center of Region - The center of a region.

Random Point In Region - A randomly arranged point which could be anywhere inside the defined region

Point With Offset - A point with an offset based on co-ordinates

Point With Polar Offset - A point with an offset based on a space and an angle.

Target of Camera Object - The position a camera object is looking at.

Target of Current Camera - The position that the current camera is looking at.

Source Of Current Camera - The position of the current camera.

Convert Co-ordinates to Point - Converts the specified set of co-ordinates into a point

Point of Destructible - The position of a destructible.

Target Point of Issued Order - The point of an issued order, like patrol

Target Point of Ability Being Cast - The point of target when an ability is cast.

Position of Item - The point of an item on the map

Way Gate Destination - The point a waygate would take you to if you went in it.

Player Start Location - The point a player starts at.

Position of Unit - The point of a unit on the map.

Rally Point As Unit - The point of a rally pointed unit.


Part 12
Spoiler:
How do I make Computer to play in my Hero Arena / AoS / <Your Map> ?

Okay, that's a good question.
Making computer play or, making an AI requires great deal of Triggering, it depends mostly on how your map is. Hero Areans and AoS's are most common maps where you want computer to play, so let's take a few basic steps.

Here, we'll start by a step by step tutorials, starting from the base.

We are going to make a small Hero arena for upto 4 players and allow Computer to play.
I haven'y got any images now, I'll add those soon.
Or if anyoe who has followed the tutorial and made his small map, please upload the images...

Now,

Open up the World Editor, if it's open, create a new map. 64x64 should be a good size. Now, make the map playable for 4 players and divide them in two teams. let player 1 and 2 be in the Tea One, and let player 3,4 be in team two.

We are going to have only four heroes as a start, and we'll keep the ones from Warcraft built-in Heroes itself. How about Tauren Chieftain, Blademaster, Demon Hunter and Crypt Lord?

Now, I hope you have played Warchasers, so you are familier with the Selection system used in there.

Ok, we have a plot, four guys have just gathered around and they have nothing to do, so they decided to kill each other.

" I don't care who or what my enemy is - it's fleash can bleed and it's bones can be broken, that's enough! "

First step of the map is terrain. so, at the corner of the map, make the small Hero Selection area, Also, make the Central arena, and two teams home bases. You know, how the typical Hero Arena is.

Now, make the Teleportation area, at team one and team two, we are making it such like as when you enter the arena, you cannot go back. Also, when you enter the teleport you are warped at the center of the arena. Since this is one way trip, you can safely use Waygates. And since there is no hero that can teleport or Blink past the cliffs, there is no need for extra teleport abuse protection.

make the arena look beautiful, add trees and stuff, decide your theme while making the arena, either make it spooky, or childish or a Royal Battle ring etc. You can give it a " Cell Games or Budokai Tenkaichi (DBZ)" look.

Ok, you have the Heroes and the Terrain, now the thing remains is the other object editing. I think you can manage that. Just one thing to mention, remember not to make the hostile creeps way too strong. Upto Level 4 creeps should be enough. If you add level 7-10 creeps, be sure that they do not wander off the central ring. You can choose creeps suitable to your theme. Fortunately, there is a heap of creeps available in Warcraft 3. Right now, we'll keep Centaurs. Max level guy is Centaur Khan with level 8.

Making creeps Wander around could be a trouble if you are not that adept with triggers, so, modify the Tornado Wander ability, set the AoE to a bit larger, and give it to the creeps you have selected "eligible" to fight.

Now, for the Items, yes, DO NOT KEEP TOMES. it makes your map cheap.
Keep some good items, but never keep items of Ob Effects. They should be heavily balanced if you intend to keep them. Right now, stat bonus items upto +6 is okay.

Make a shop, place it in each of the team's bases. Grab the Foutain of Health and Mana, place them to the strategic locations i the main arena. Place the Fountain of Power (Located in Night Elves) i the either of teams bases.

Ok, you're set. now for the Triggers...
Now, I'm not going to explain how to make the selection system with a unit like Wisp., Just you should have a system like in WARCHASERS.

Just make the leaderboards and tother stuff. In other words, your arena should be fuly functional with players, now you are ready to add up the AI.

Well,

First, the groups, you already have two Teams (Player Groups) One and Two, including players 1,2 and 3,4.

Now, just go make the follwing triggers

E
- Map Init
A
- If (player 1 controller is Computer) then add player one to AIOneGroup
- If (player 2 controller is Computer) then add player one to AIOneGroup
- If (player 3 controller is Computer) then add player one to AITwoGroup
- If (player 4 controller is Computer) then add player one to AITwoGroup

The AIOneGroup and AITwoGroup are PlayerGroupVars.

Now, another trigger that causes AI to choose Hero. The selection system must be ready. if it isn't, make it now.

Trick is, after 5 secs since the game, check of the the play is in AI Groups we created, if he is, meaning, that we have to order it. Now, how many heroes we have? Four. make a integer var called 't'. Set t to a random number out of 1 to 4. And order the wisp to move to the corresponding choose hero region. Do it for every player.

Test the map with Computer Players, if you did it right, you'll notice that AI now cooses random hero each time. in WE, make it reintialize the seed from map settings, thus your AI will choose really random hero instead of getting repeatitive.

Hey, but what after that? AI choses hero but doen't seem to move around.

Now, place the regions all around the map, to the most strategic places you think, don't forget the shops, Fountains, etc. remember to make the regions a bit bigger, or of moderate size basically, a region of size that nearly 6 grunts can easily stand.

Don't forget the name the regions, like North Fountains, Base 1/2 Shops, Center, South Corridor etc. this is for your own reference.

Now, think what you do when you play,
1. You order your hero to move around.
2. Locate enemy. and Fight him.
3. Learn abilty with nukes and ultimates being high priority,
4. Use an ability or two,
5. Go to respective fountains.
6. don't click me items if having enough Gold.

We'll consider the AI to do 1. and 2.

As your hero enters the base region, by selection or revival, order him to move to the random point in arena. If you are using waygates, then hero will properly find the way around, using the waygate. Then you have to set up the repeating trigger. once in the arena, for each few seconds, 5 to 10, pick the each player in AIGroups and th units that are in the Arena Region, order them to patrol the random point in randomly chosen strategic locations (regions) you already placed. This takes a bit work, so add it in For loop to make it for each AI player.

Save, and test.

Yes, your AI now moves around and fights! Dies on honour like a hero, revives and fights again! The quality and skill of the AI depends on where you set the locations. example, have him to move around the high ground, make him go around the fountains, etc.

If you have creeps, then he'll also engage them. But since you have not specified it, he has little regard for his life.

Now, using the spells. Basically, there is an event specified. "Gains a Level"
so, is it not an easy job to check of the levelling guy is AI and have him the learn the ability?

There is a trick though, For Tauren chieftain, the trigger will look like this one,

E
- A unit gains a leve
C
- Owner of Levelling Hero 's Controller is Computer
- Leveling hero is Tauren Chieftain.
A
- Learn ability - Reincarnation
- Learn ability - War Stomp
- Learn ability - Endurance
- Learn ability - Shockwave

Now, look at this, this has priorised the best abilities for Tauren Chieftain. Of course, as he levels up, he'll try to learn first skill - reincarnation. if it unavailable (below lvl6) or already learnt, he'll grab the next one. So, typically, he'll go like this
WS, End, WS, End, WS, Reincar, End. SW, SW, SW.

Simple, isn't it.

Remember that if your ability follows the basic ability logic of Blizz, thn it will be caster automaticaly, if it's a custom ability, you have to order that. That's makes Nmber 4.

Good, upto 4 is done. Your AI will now begin to give a trouble to Noobs. (This includes yourself too, ofc if you are a noob)

Still, he is not attempting to save himself. That's number 5.

First, modify the Attack Move trigger we set up earlier to have AI move around. Add a condition to check if picked unit's health is above 25%.

Save and Test, you'll notice that AI will not move around if health is below 25%. instead he'll stand ground and wait for is hp to recover.

Good, now, make one more trigger.

E
- A unit is attacked
C
- Or
- Owner of Attacked unit is in AIGROUPONE
- Owner of Attacked unit is in AIGROUPTWO
- Attacked unit's percentage life is smallr than or equal to 25.00%.
A
<figure it out, order it to move to a (random, if more exist) health fountain>

Good, you can do a bit scripting to hav AI move to the closest fountain as well.

Now, you'll see AI's behaviour changes by a great deal. You can do the same for Mana too.

Number 6 is a bit complecated. I recommend that you check out the BftC AI unprotected.

Though BftC is AoS and the above tutorial is for Arena, item buying logic remains the same.

If you want a good skilled AI to pitch yourself agaist, go for BftC Latest version.



part 13
Spoiler:
--[ Power of the Spellbook ]--

Blizzard has made an ability called Spellbook which is a heaven for all the spellmakers around. Spellbook can be found under Special - Items

Advantages
Can be filled with 11 spells. With one Cancel button.
Single unit can have multiple Spellbooks as They can have differerent Base Order IDs.
Adding and Removing Spells from the Spellbook is easy.
Spellbooks can be made Hero Abilities with Each level can have different spells.

How to use a Spellbook
First, make your copy of a spellbook, Let it have complete 11 spells. For that set the Values Min Spells and Max Spells to 11.

Now, add up your spells. Even though you didn't fill up all the 11 spells, it's okay. Now give that ability to any unit of your choice, Be sure that unit has enough mana to cast them all.

Now you can work with Spellbook.

Note: If you set the values diferent, here's what will happen.
Say, you set Max Spells to 8 and Min Spells to 4. And add 8 Abilities.
Then, it will randomly choose 4 Spells out of 8 specified. The first 8 abilities shall be considered valid for this Random Selection.

Inside the Spellbook
When inside the Spellbook the spell behaves completely normal. Cooldowns and mana cost is applied to the entire spellbook rather than a single ability. And unit's mana is taken for Casting the spell. There is an option to put extra Mana Toll, but it appears that Blizzard did not implement is to the Fullest.

Spellbook and Channel
It is also possible to have Triggered abilities and Channel Spells inside the Spellbook. I have not Tried Spellbook inside a Spellbook but I am sure it works.

Adding and Removing Abilities
Adding and Removing Abilities from Spellbook is possible. Just Add the Spellbook containing the Ability you want to Add,
Example, Unit has a Spellbook with Order ID 'X' has one spell of ID 'A'.
You want to add Spell 'B' to the Book. So, You have to add another Spellbook of ID 'X' that contains spell 'B' to the unit.
The result will be a Single Spellbook of ID 'X' containing both A and B.

Disabled Spellbook
Disabled Spellbook is another Boon to the Triggered Ability Makers. Remember that Some Passives show an Icon on the Unit's command Card. And no matter what you do you cannot remove that. So, you can put it inside a Spellbook. Give that spellbook to a unit and Disable the Spellbook ability for that player. Remember that Spellbooks may have different Order IDs, so can use the Spellbook with different ID. Now, in game, The Passive will have the effect but will not show any Icon on the Command Card! I don't know if it's meant to be like this or this is an engine Glitch. But it works great.

You can add and remove the Disabled Spellbooks from a unit.
Example - A unit gains 30% Critical Strike x2 for next 15 seconds.

That's a little about Spellbooks.