- Joined
- Oct 7, 2017
- Messages
- 11
I'm trying to make a map that displays the total value of each player, this tally's up all the units, buildings, and hero's the player owns along with their gold. Here's my trigger:
Player1Red
Events
Time - Every 0.10 seconds of game time
Conditions
(Player 1 (Red) slot status) Equal to Is playing
Actions
Player Group - Pick every player in Player Group - Player 1 (Red) and do (Set Player1RedHuman = (((Number of living Peasant units owned by (Picked player)) x 75) + (((Number of living Footman units owned by (Picked player)) x 135) + (((Number of living Knight units owned by (Picked player)) x 245) + (((Number of living Rifleman un
Player Group - Pick every player in Player Group - Player 1 (Red) and do (Set Player1RedOrc = (((Number of living Peon units owned by (Picked player)) x 75) + (((Number of living Grunt units owned by (Picked player)) x 200) + (((Number of living Raider units owned by (Picked player)) x 180) + (((Number of living Tauren units owned
Player Group - Pick every player in Player Group - Player 1 (Red) and do (Set Player1RedUndead = (((Number of living Acolyte units owned by (Picked player)) x 75) + (((Number of living Shade units owned by (Picked player)) x 75) + (((Number of living Ghoul units owned by (Picked player)) x 120) + (((Number of living Abomination un
Player Group - Pick every player in Player Group - Player 1 (Red) and do (Set Player1RedNightElf = (((Number of living Wisp units owned by (Picked player)) x 60) + (((Number of living Archer units owned by (Picked player)) x 130) + (((Number of living Huntress units owned by (Picked player)) x 195) + (((Number of living Dryad unit
Set Player1RedTotal = ((Player1RedHeros + Player1RedHuman) + ((Player1RedNightElf + Player1RedOrc) + (Player1RedUndead + (Player 1 (Red) Current gold))))
Multiboard - Set the text for (Last created multiboard) item in column 2, row Multiboard[(Player number of Player 1 (Red))] to (String(Player1RedTotal))
The problem is this creates massive memory leaks and lags after the first 2 minutes of gameplay. I don't know how to fix it without making it hella long with a million variables. Is there an easier way to do what I'm doing?
Player1Red
Events
Time - Every 0.10 seconds of game time
Conditions
(Player 1 (Red) slot status) Equal to Is playing
Actions
Player Group - Pick every player in Player Group - Player 1 (Red) and do (Set Player1RedHuman = (((Number of living Peasant units owned by (Picked player)) x 75) + (((Number of living Footman units owned by (Picked player)) x 135) + (((Number of living Knight units owned by (Picked player)) x 245) + (((Number of living Rifleman un
Player Group - Pick every player in Player Group - Player 1 (Red) and do (Set Player1RedOrc = (((Number of living Peon units owned by (Picked player)) x 75) + (((Number of living Grunt units owned by (Picked player)) x 200) + (((Number of living Raider units owned by (Picked player)) x 180) + (((Number of living Tauren units owned
Player Group - Pick every player in Player Group - Player 1 (Red) and do (Set Player1RedUndead = (((Number of living Acolyte units owned by (Picked player)) x 75) + (((Number of living Shade units owned by (Picked player)) x 75) + (((Number of living Ghoul units owned by (Picked player)) x 120) + (((Number of living Abomination un
Player Group - Pick every player in Player Group - Player 1 (Red) and do (Set Player1RedNightElf = (((Number of living Wisp units owned by (Picked player)) x 60) + (((Number of living Archer units owned by (Picked player)) x 130) + (((Number of living Huntress units owned by (Picked player)) x 195) + (((Number of living Dryad unit
Set Player1RedTotal = ((Player1RedHeros + Player1RedHuman) + ((Player1RedNightElf + Player1RedOrc) + (Player1RedUndead + (Player 1 (Red) Current gold))))
Multiboard - Set the text for (Last created multiboard) item in column 2, row Multiboard[(Player number of Player 1 (Red))] to (String(Player1RedTotal))
The problem is this creates massive memory leaks and lags after the first 2 minutes of gameplay. I don't know how to fix it without making it hella long with a million variables. Is there an easier way to do what I'm doing?