Hey Guys,
I'm working on a Map where you have 10 players and each player has a hero,
after a certain amount of time the ownership of heroes is swapped at random but at all times every players should always control only 1 hero. This is exactly where the problems start since often enough 1 player controls multiple heroes and another player controls no hero at all, which is not intended.
I have tried to disable all functions that are irrelevant for ownership change.
I'm glad about any suggestions and forms of help
here the trigger text:
ChangeGoldmasterOwner
Events
Time - OtherPlayerGainsControllTimer expires
Conditions
Actions
Countdown Timer - Start GoldmasterControllReturnTimer as a One-shot timer that will expire in 120.00 seconds
Countdown Timer - Create a timer window for (Last started timer) with title Clear Mind
Set ReturnTimerHer = (Last created timer window)
For each (Integer A) from 1 to NumberofPlayersPlaying, do (Actions)
Loop - Actions
Wait 1.00 seconds
Unit - Add Plunder to Goldmasters[(Integer A)]
Destructible - Close PrisonWalls[((Integer A) - 1)]
Player Group - Remove (Player((Integer A))) from RandomplayerGroup
Set PlayerBeeingRemovedFromGroup = (Random player from RandomplayerGroup)
Countdown Timer - Start TimeLimitToHackTimer[(Integer A)] as a One-shot timer that will expire in 0.50 seconds
Hashtable - Save (Player number of PlayerBeeingRemovedFromGroup) as 1 of (Key (Last started timer)) in Timers_Hashtable
Set PlayerinControlIsInRegion[(Player number of PlayerBeeingRemovedFromGroup)] = (Integer A)
Unit - Change ownership of Goldmasters[(Integer A)] to PlayerBeeingRemovedFromGroup and Change color
Set Goldmasternumbers[(Player number of PlayerBeeingRemovedFromGroup)] = Goldmaster[(Integer A)]
Player Group - Remove PlayerBeeingRemovedFromGroup from RandomplayerGroup
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PlayerinControlIsInRegion[(Integer A)] Greater than or equal to 0
(Goldmasternumbers[(Player number of (Player((Integer A))))] is empty) Equal to True
Then - Actions
Player Group - Add (Player((Integer A))) to RandomplayerGroup
Game - Display to (All players) the text: Debug2
Else - Actions
Animation - Change Goldmasters[(Integer A)]'s vertex coloring to (100.00%, 4.00%, 4.00%) with 0.00% transparency
Unit - Set mana of HQs[(Integer A)] to (10.00 x ManaOfHq[(Integer A)])
Game - Display to (All players) the text: Debug
Set OtherPlayersNowInControl = True
Wait 2.00 seconds
For each (Integer A) from 1 to NumberofPlayersPlaying, do (Actions)
Loop - Actions
Unit Group - Pick every unit in Goldmasternumbers[(Integer A)] and do (Actions)
Loop - Actions
Unit Group - Remove (Picked unit) from Goldmasternumbers[(Integer A)]
Game - Display to (All players) the text: Debug1
I'm working on a Map where you have 10 players and each player has a hero,
after a certain amount of time the ownership of heroes is swapped at random but at all times every players should always control only 1 hero. This is exactly where the problems start since often enough 1 player controls multiple heroes and another player controls no hero at all, which is not intended.
I have tried to disable all functions that are irrelevant for ownership change.
I'm glad about any suggestions and forms of help
here the trigger text:
ChangeGoldmasterOwner
Events
Time - OtherPlayerGainsControllTimer expires
Conditions
Actions
Countdown Timer - Start GoldmasterControllReturnTimer as a One-shot timer that will expire in 120.00 seconds
Countdown Timer - Create a timer window for (Last started timer) with title Clear Mind
Set ReturnTimerHer = (Last created timer window)
For each (Integer A) from 1 to NumberofPlayersPlaying, do (Actions)
Loop - Actions
Wait 1.00 seconds
Unit - Add Plunder to Goldmasters[(Integer A)]
Destructible - Close PrisonWalls[((Integer A) - 1)]
Player Group - Remove (Player((Integer A))) from RandomplayerGroup
Set PlayerBeeingRemovedFromGroup = (Random player from RandomplayerGroup)
Countdown Timer - Start TimeLimitToHackTimer[(Integer A)] as a One-shot timer that will expire in 0.50 seconds
Hashtable - Save (Player number of PlayerBeeingRemovedFromGroup) as 1 of (Key (Last started timer)) in Timers_Hashtable
Set PlayerinControlIsInRegion[(Player number of PlayerBeeingRemovedFromGroup)] = (Integer A)
Unit - Change ownership of Goldmasters[(Integer A)] to PlayerBeeingRemovedFromGroup and Change color
Set Goldmasternumbers[(Player number of PlayerBeeingRemovedFromGroup)] = Goldmaster[(Integer A)]
Player Group - Remove PlayerBeeingRemovedFromGroup from RandomplayerGroup
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PlayerinControlIsInRegion[(Integer A)] Greater than or equal to 0
(Goldmasternumbers[(Player number of (Player((Integer A))))] is empty) Equal to True
Then - Actions
Player Group - Add (Player((Integer A))) to RandomplayerGroup
Game - Display to (All players) the text: Debug2
Else - Actions
Animation - Change Goldmasters[(Integer A)]'s vertex coloring to (100.00%, 4.00%, 4.00%) with 0.00% transparency
Unit - Set mana of HQs[(Integer A)] to (10.00 x ManaOfHq[(Integer A)])
Game - Display to (All players) the text: Debug
Set OtherPlayersNowInControl = True
Wait 2.00 seconds
For each (Integer A) from 1 to NumberofPlayersPlaying, do (Actions)
Loop - Actions
Unit Group - Pick every unit in Goldmasternumbers[(Integer A)] and do (Actions)
Loop - Actions
Unit Group - Remove (Picked unit) from Goldmasternumbers[(Integer A)]
Game - Display to (All players) the text: Debug1
Attachments
Last edited: