I am in the middle of building my triggers for a KotH variant. I figured out how to make the point system work with activating and pausing a timer when a player unit has entered a region but I am having quite a difficult time wrapping my head around the idea of "Hill Contention" where more than 1 team are in the hill at a time.
How would you script a trigger to understand to give no points while multiple players populate the region that is the hill? How do you tell the game to notice when all but one player has left the hill, therefore allowing that player to regain point allocation?
I havent faound talks of this method of KotH specifically, rather alot of multiple territory maps using structures as points instead of regions.
I will post what I have so far shortly so you all can see how bad I am at triggers ;)
I use a variable called "Unit Bank" for every player. This variable counts how many active units of that players are in the "hill". When the first unit passes into the hill, it starts counting the timer and at timer expiry, you get a point. After your first unit has entered the "hill", the remainder of the players units only add to the "Unit Bank" but do not activate additional timers to eliminate exponential point gathering.
I am attempting to use these "Unit Banks" as the identifier in a trigger to tell SC2 that there are multiple players with units in the hill to pause time but I am having trouble figuring it out.
HERE IS HOW I TRIGER PLAYER 1 HILL SCORING:
-----------------------------------------------------------------------------
Hill Timer Start 1
Events
Unit - Any Unit Enters Region 001
Local Variables
Conditions
(Owner of (Triggering unit)) == 1
((Triggering unit) is Excluded: Air, Structure, Worker, Resource (Raw), Missile, Under Construction, Dead, Hidden, Radar for player 1) == true
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Hill Unit Bank 1 == 0.0
Then
Unit - Set (Triggering unit) Life (Percent) to 110.0
Variable - Modify Hill Unit Bank 1: + 1.0
Timer - Create a timer window for timer 1, with the title "P1 Timer", using Remaining time (initially Hidden)
Timer - Show (Last created timer window) for (Allies of player 1)
Timer - Start timer 1 as a Repeating timer that will expire in 5.0 Game Time seconds
UI - Display "P1 entered Hill" for (All players) to Subtitle area
Else
Unit - Set (Triggering unit) Life (Percent) to 110.0
Variable - Modify Hill Unit Bank 1: + 1.0
UI - Display (Text(Hill Unit Bank 1) with Any Precision decimal places) for (All players) to Subtitle area
HERE IS HOW I DEACTIVATE PLAYER 1 HILL SCORING:
-----------------------------------------------------------------------------
Hill Timer Stop 1
Events
Unit - Any Unit Leaves Region 001
Unit - Any Unit dies
Local Variables
Conditions
(Owner of (Triggering unit)) == 1
((Triggering unit) is Excluded: Air, Structure, Worker, Resource (Raw), Missile, Under Construction, Dead, Hidden, Radar for player 1) == true
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Hill Unit Bank 1 == 1.0
Then
Unit - Set (Triggering unit) Life (Percent) to 100.0
Variable - Modify Hill Unit Bank 1: - 1.0
Timer - Restart timer 1
Timer - Pause timer 1
UI - Display "P1 left Hill" for (All players) to Subtitle area
Else
Unit - Set (Triggering unit) Life (Percent) to 100.0
Variable - Modify Hill Unit Bank 1: - 1.0
UI - Display (Text(Hill Unit Bank 1) with Any Precision decimal places) for (All players) to Subtitle area
I am in the middle of building my triggers for a KotH variant. I figured out how to make the point system work with activating and pausing a timer when a player unit has entered a region but I am having quite a difficult time wrapping my head around the idea of "Hill Contention" where more than 1 team are in the hill at a time.
How would you script a trigger to understand to give no points while multiple players populate the region that is the hill? How do you tell the game to notice when all but one player has left the hill, therefore allowing that player to regain point allocation?
I havent faound talks of this method of KotH specifically, rather alot of multiple territory maps using structures as points instead of regions. I will post what I have so far shortly so you all can see how bad I am at triggers ;)
@Toztman
I use a variable called "Unit Bank" for every player. This variable counts how many active units of that players are in the "hill". When the first unit passes into the hill, it starts counting the timer and at timer expiry, you get a point. After your first unit has entered the "hill", the remainder of the players units only add to the "Unit Bank" but do not activate additional timers to eliminate exponential point gathering.
I am attempting to use these "Unit Banks" as the identifier in a trigger to tell SC2 that there are multiple players with units in the hill to pause time but I am having trouble figuring it out.
HERE IS HOW I TRIGER PLAYER 1 HILL SCORING:
-----------------------------------------------------------------------------
Hill Timer Start 1
Events
Unit - Any Unit Enters Region 001
Local Variables
Conditions
(Owner of (Triggering unit)) == 1
((Triggering unit) is Excluded: Air, Structure, Worker, Resource (Raw), Missile, Under Construction, Dead, Hidden, Radar for player 1) == true
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Hill Unit Bank 1 == 0.0
Then
Unit - Set (Triggering unit) Life (Percent) to 110.0
Variable - Modify Hill Unit Bank 1: + 1.0
Timer - Create a timer window for timer 1, with the title "P1 Timer", using Remaining time (initially Hidden)
Timer - Show (Last created timer window) for (Allies of player 1)
Timer - Start timer 1 as a Repeating timer that will expire in 5.0 Game Time seconds
UI - Display "P1 entered Hill" for (All players) to Subtitle area
Else
Unit - Set (Triggering unit) Life (Percent) to 110.0
Variable - Modify Hill Unit Bank 1: + 1.0
UI - Display (Text(Hill Unit Bank 1) with Any Precision decimal places) for (All players) to Subtitle area
HERE IS HOW I DEACTIVATE PLAYER 1 HILL SCORING:
-----------------------------------------------------------------------------
Hill Timer Stop 1
Events
Unit - Any Unit Leaves Region 001
Unit - Any Unit dies
Local Variables
Conditions
(Owner of (Triggering unit)) == 1
((Triggering unit) is Excluded: Air, Structure, Worker, Resource (Raw), Missile, Under Construction, Dead, Hidden, Radar for player 1) == true
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Hill Unit Bank 1 == 1.0
Then
Unit - Set (Triggering unit) Life (Percent) to 100.0
Variable - Modify Hill Unit Bank 1: - 1.0
Timer - Restart timer 1
Timer - Pause timer 1
UI - Display "P1 left Hill" for (All players) to Subtitle area
Else
Unit - Set (Triggering unit) Life (Percent) to 100.0
Variable - Modify Hill Unit Bank 1: - 1.0
UI - Display (Text(Hill Unit Bank 1) with Any Precision decimal places) for (All players) to Subtitle area