Hi, I posted this in the Data section too, phrasing this question a little bit more differently, but sorry for double posting/spamming.
I created an upgrade mechanism (only for 1 race), which involves an Integer, from which 1 is being extracted every second, also 5 after player kills enemy unit. After Integer value =[or less]0, give player [1!] upgrade. I couldn't do it with regular upgrades, cause it was impossible to show it on screen (on a Dialog). So I created a dialog, showing the icons for the upgrades, there are 5 levels for both melee, ranged, and armor, they display in order, displaying the value of the Integer every second (+destroying it, so basically updating it). Now, the problem is, that it only works with 1 player, Player 1. is it possible to render an Integer to player, so it would give upgrade to the player whos Integer reaches 0? Cause creating 8 Integers for 5 levels, for 3 upgrades...a lot of Integers. The created trigger amount is pretty high too (which need to update every second = much lag) + it's not very elegant. I'll post a picture of the so far created triggers.
You should only need 1 trigger firing every 1 second, not multiple. You use it to run all code for all players at once. Declare counter an array of size 16 where the index is the player you are currently iterating for. Remember that running some actions for all players is as simple as iterating through a player group or for loop.
EDIT: Sorry for bothering you with more questions, but can you briefly explain to me why this doesn't work? I never used the Pick stuff & do stuff action, so I don't quite get whats wrong.
As a rough guess it is because all 3 timers need to be 0 (did you not mean to test each separately?) and that you never increment/decrement the timer so the condition is never met.
Hi, I posted this in the Data section too, phrasing this question a little bit more differently, but sorry for double posting/spamming. I created an upgrade mechanism (only for 1 race), which involves an Integer, from which 1 is being extracted every second, also 5 after player kills enemy unit. After Integer value =[or less]0, give player [1!] upgrade. I couldn't do it with regular upgrades, cause it was impossible to show it on screen (on a Dialog). So I created a dialog, showing the icons for the upgrades, there are 5 levels for both melee, ranged, and armor, they display in order, displaying the value of the Integer every second (+destroying it, so basically updating it). Now, the problem is, that it only works with 1 player, Player 1. is it possible to render an Integer to player, so it would give upgrade to the player whos Integer reaches 0? Cause creating 8 Integers for 5 levels, for 3 upgrades...a lot of Integers. The created trigger amount is pretty high too (which need to update every second = much lag) + it's not very elegant. I'll post a picture of the so far created triggers.
Please help!
You should only need 1 trigger firing every 1 second, not multiple. You use it to run all code for all players at once. Declare counter an array of size 16 where the index is the player you are currently iterating for. Remember that running some actions for all players is as simple as iterating through a player group or for loop.
@ImperialGood: Go
Thank you. Life became so much easier ^^
EDIT: Sorry for bothering you with more questions, but can you briefly explain to me why this doesn't work? I never used the Pick stuff & do stuff action, so I don't quite get whats wrong.
As a rough guess it is because all 3 timers need to be 0 (did you not mean to test each separately?) and that you never increment/decrement the timer so the condition is never met.