- Joined
- Dec 5, 2017
- Messages
- 11
TOWN HALL REVEALING TRIGGER FOR ALTERED MELEE MAP
Tested on Frozen Throne Patch 1.27.0.52240
Tested on Frozen Throne Patch 1.27.0.52240
There is a TOWN HALL REVEALING problem when you make custom town hall, and some people suggest you to remove this script from default melee initialization:
-
Melee Game - Enforce victory/defeat conditions (for all players)
The basic idea that make this tutorial work are:
- Make a default town hall (first tier), as dummy town hall, for example Tree of Life without editing, in specific region (not in playable area and hidden from all players, you can place the region in border area),
- Change the ownership of default town hall (first tier) in that region to Neutral Passive when all of your custom town hall dies,
- And don't forget to change back the ownership to the Player when Player's unit begins custom town hall construction.
- Custom town hall with 2 (two) up to 9 (nine) tier. In this tutorial section I will give you sample for first tier until third tier and for the rest I hope you can try by yourself,
- Make default race (Human, Night Elf, Undead, Orc) coexist with custom race,
- Continue game after win or solo without enemy.
- Make default worker position,
- Make Entangle Gold Mine when map initialization (based on entangle order),
- Select custom race via handicap, so it doesn't need pause trigger in the beginning of the game (in case you create custom race selection via dialog) and able to set random select custom race (optional),
A. FIRST STEP
- Don't delete enforce victory/defeat conditions (essential for win condition),
- Delete create starting units, (optional, in this case I prefer not to replace default melee worker unit with custom worker unit, because it will increase score point to the Player who select the custom race),
- Delete run AI scripts (optional, if you want to customize the AI scripts),
- Don't forget to set free hero number and limit custom hero type to 1 (one),
- In this trigger, my custom heroes are: Furbolg Ursa Warrior and Salamander Lord.
-
Melee Initialization
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Melee Game - Use melee time of day (for all players)
-
Melee Game - Remove creeps and critters from used start locations (for all players)
-
Melee Game - Set starting resources (for all players)
-
Melee Game - Limit Heroes to 1 per Hero-type (for all players)
-
Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
-
Melee Game - Enforce victory/defeat conditions (for all players)
-
Player Group - Pick every player in (All players) and do (Actions)
-
Loop - Actions
-
Player - Set (Picked player) Available free Heroes to 1
-
Player - Limit training of Heroes to 3 for (Picked player)
-
Player - Limit training of Furbolg Ursa Warrior to 1 for (Picked player)
-
Player - Limit training of Salamander Lord to 1 for (Picked player)
-
-
-
-
Set variables for your map.
-
Set Variable
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- Player Slot --------
-
Set Slot[0] = Player 1 (Red)
-
Set Slot[1] = Player 2 (Blue)
-
-------- Gold Mine --------
-
Set Mine[0] = 1 Mine <gen>
-
Set Mine[1] = 2 Mine <gen>
-
-------- Felwood Base --------
-
Set Tree[0] = 1 Felwood <gen>
-
Set Tree[1] = 2 Felwood <gen>
-
-------- Wisp Spawn --------
-
Set Wisp[0] = 1 Wisp <gen>
-
Set Wisp[1] = 2 Wisp <gen>
-
-------- Reveal Region --------
-
Set Reveal[0] = 1 Red <gen>
-
Set Reveal[1] = 2 Blue <gen>
-
-
- Slot = Player Array (2), for store Player slot,
- Mine = Region Array (2), for store your first Gold Mine base location,
- Reveal = Region Array (2), for store default town hall (first tier) location, as dummy unit,
- Tree = Region Array (2), for store your first base (custom town hall),
- Wisp = Region Array (2), for store your custom worker location,
- Food = Integer Array (2), initial value = 0, for store food cap (input in variable section only),
- I choose 2 (two) for the array number, because I have 2 (two) player in my map,
- The script number begin from 0 (zero),
- You must create regions before apply this trigger,
- Don't forget to insert your custom town hall (all tiers) into gameplay constant section (important).
C. THIRD STEP
Set your custom race.
-
Set Felwood
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
For each (Integer A) from 0 to 1, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Slot[(Integer A)] slot status) Equal to Is playing
-
(Race of Slot[(Integer A)]) Equal to Night Elf
-
(Slot[(Integer A)] handicap) Equal to 80.00
-
-
Then - Actions
-
Unit - Create 1 Tree of Life for Slot[(Integer A)] at (Center of Reveal[(Integer A)]) facing Default building facing degrees
-
Unit Group - Pick every unit in (Units in Reveal[(Integer A)]) and do (Unit - Remove Return Lumber from (Picked unit))
-
Unit - Create 1 Corrupted Tree of Life for Slot[(Integer A)] at (Center of Tree[(Integer A)]) facing Default building facing degrees
-
Player - Set Slot[(Integer A)] Food cap to 10
-
Unit Group - Order (Units in Tree[(Integer A)] owned by Slot[(Integer A)]) to Night Elf Tree Of Life - Entangle Nearby Gold Mine (Instant)
-
For each (Integer B) from 0 to 4, do (Actions)
-
Loop - Actions
-
Unit - Create 1 Wisp (Custom) for Slot[(Integer A)] at ((Center of Wisp[(Integer A)]) offset by 72.00 towards (72.00 x (Real((Integer B)))) degrees) facing Default building facing degrees
-
-
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
- You must remove return lumber ability and return gold and lumber ability via trigger from default town hall (tier 1), because worker unit will recognize it as return resource point and will try to return resource to this building if the building location is near,
- Don't forget to order your custom town hall, in this case Corrupted Tree of Life, to entangle nearby gold mine (optional),
- Don't forget to set food cap,
- The offset 72,00 (seventy two) is the distance from central of the region,
- I choose 72,00 (seventy two) degrees because I have 5 (five) worker units (360 degrees/5).
- If your custom race don't need Entangled Gold Mine, you can remove Tree variable and replace the third line script with this script:
-
Unit - Create 1 (Your Custom Town Hall) for Slot[(Integer A)] at (Slot[(Integer A)] start location) facing Default building facing degrees
D. FOURTH STEP
Set up reveal condition.
-
Reveal Felwood
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of (Dying unit)) Equal to Corrupted Tree of Life
-
(Unit-type of (Dying unit)) Equal to Corrupted Tree of Ages
-
(Unit-type of (Dying unit)) Equal to Corrupted Tree of Eternity
-
-
-
-
Actions
-
For each (Integer A) from 0 to 1, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Race of Slot[(Integer A)]) Equal to Night Elf
-
(Slot[(Integer A)] handicap) Equal to 80.00
-
(Owner of (Dying unit)) Equal to Slot[(Integer A)]
-
(Number of living Corrupted Tree of Life units owned by Slot[(Integer A)]) Equal to 0
-
(Number of living Corrupted Tree of Ages units owned by Slot[(Integer A)]) Equal to 0
-
(Number of living Corrupted Tree of Eternity units owned by Slot[(Integer A)]) Equal to 0
-
(Number of living Corrupted Moon Well units owned by Slot[(Integer A)]) Greater than or equal to 0
-
-
Then - Actions
-
Unit Group - Pick every unit in (Units in Reveal[(Integer A)]) and do (Unit - Change ownership of (Picked unit) to Neutral Passive and Change color)
-
Set Food[(Integer A)] = ((Number of living Corrupted Moon Well units owned by Slot[(Integer A)]) x 10)
-
Player - Set Slot[(Integer A)] Food cap to Food[(Integer A)]
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
- The trigger above this text is essential for controlling Win, Defeat, and Reveal Condition,
- Don't forget to include handicap and Player's race in this trigger section (optional),
- Don't forget to set food cap again,
- In this trigger, my custom town halls are: Corrupted Tree of Life (first tier), Corrupted Tree of Ages (second tier), and Corrupted Tree of Eternity (third tier),
- I used Corrupted Moon Well as farm,
- I used Tree of Life (first tier) as dummy unit without editing,
- This trigger can be extended up to 9 (ninth) tier, by using Number of Units Function.
E. FIFTH STEP
Set up unrevealing condition.
-
Unrevealing Felwood
-
Events
-
Unit - A unit Begins construction
-
-
Conditions
-
(Unit-type of (Constructing structure)) Equal to Corrupted Tree of Life
-
-
Actions
-
For each (Integer A) from 0 to 1, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Race of Slot[(Integer A)]) Equal to Night Elf
-
(Slot[(Integer A)] handicap) Equal to 80.00
-
(Owner of (Constructing structure)) Equal to Slot[(Integer A)]
-
(Number of units in (Units in Reveal[(Integer A)] owned by Slot[(Integer A)])) Equal to 0
-
(Number of living Corrupted Moon Well units owned by Slot[(Integer A)]) Greater than or equal to 0
-
-
Then - Actions
-
Unit Group - Pick every unit in (Units in Reveal[(Integer A)]) and do (Unit - Change ownership of (Picked unit) to Slot[(Integer A)] and Change color)
-
Set Food[(Integer A)] = ((Number of living Corrupted Moon Well units owned by Slot[(Integer A)]) x 10)
-
Player - Set Slot[(Integer A)] Food cap to Food[(Integer A)]
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
- If Player's worker unit begins Corrupted Tree of Life construction, then Tree of Life will become Player's unit,
- Don't forget to reassign food cap value,
- Food cap will increase start from reassign food cap value automatically, after you have finished food producing buildings,
F. SIXTH STEP (Last Step)
-
Set Night Elf
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
For each (Integer A) from 0 to 1, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Slot[(Integer A)] slot status) Equal to Is playing
-
(Race of Slot[(Integer A)]) Equal to Night Elf
-
Or - Any (Conditions) are true
-
Conditions
-
(Slot[(Integer A)] handicap) Equal to 100.00
-
(Slot[(Integer A)] handicap) Equal to 90.00
-
(Slot[(Integer A)] handicap) Equal to 70.00
-
(Slot[(Integer A)] handicap) Equal to 60.00
-
(Slot[(Integer A)] handicap) Equal to 50.00
-
-
-
-
Then - Actions
-
Melee Game - Create (Race of Slot[(Integer A)]) starting units for Slot[(Integer A)] at (Slot[(Integer A)] start location) (Include Heroes)
-
AI - Start melee AI script for Slot[(Integer A)]: elf.ai
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
- You must enable this trigger for your default race or it will be empty (in case you remove create starting units script from map initialization trigger),
- Don't forget to edit the handicap (optional, if you create custom race selection via handicap),
- There are several basic melee AI script in Warcraft III, the path are human.ai, undead.ai, elf.ai, and orc.ai (you can edit this section and insert your custom AI).
This is the end of tutorial section. Please give me feedback to improve this tutorial page. Thank you for your attention and I hope this tutorial useful for you. Good luck for your altered melee map.
Attachments
Last edited: