So I'm trying to setup a leaderboard that shows the hero that you've played the most throughout the times you've played my map. I got it setup, but have questions about the second part. Read below.
UntitledTrigger001EventsLocalVariablesP=0<Integer>ConditionsActionsGeneral-ForeachintegerPfrom1to12withincrement1,do(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfPlayerStats-Akeru[P] > Player Stats - Darosa[P]
Player Stats - Akeru[P] > Player Stats - Gregor[P]
Player Stats - Akeru[P] > Player Stats - Kantor[P]
Player Stats - Akeru[P] > Player Stats - Kerana[P]
Player Stats - Akeru[P] > Player Stats - Kristo[P]
Player Stats - Akeru[P] > Player Stats - Lilith[P]
Player Stats - Akeru[P] > Player Stats - Nerix[P]
Player Stats - Akeru[P] > Player Stats - Orion[P]
Player Stats - Akeru[P] > Player Stats - Reiyon[P]
Player Stats - Akeru[P] > Player Stats - Remi[P]
Player Stats - Akeru[P] > Player Stats - Renzo[P]
Player Stats - Akeru[P] > Player Stats - Rex[P]
Player Stats - Akeru[P] > Player Stats - Saru[P]
Player Stats - Akeru[P] > Player Stats - Shirax[P]
Player Stats - Akeru[P] > Player Stats - Taru[P]
Player Stats - Akeru[P] > Player Stats - Valac[P]
Player Stats - Akeru[P] > Player Stats - Vera[P]
Then
Else
Is there a better way of doing this second trigger? I need it to check to see what hero has been played the most out of all the games played. This way above would be a pain as I would have to check each hero vs each hero. Is there an easier way?
Save the time each player has played a hero into an array variable, then run through the variable, get the max index, and get the hero based on that index...
Something like
UntitledTrigger001EventsLocalVariablesP=0<Integer>ConditionsActionsGeneral-ForeachintegerPfrom1to12withincrement1,do(Actions)Actionsint[HeroCount] Arr:
Arr[0] = Akery[P];
Arr[1] = Darosa[P];
...
int biggestIndex = 0;
for (int i = 1; i < heroCount;i++)if(Arr[i]> Arr[biggestIndex])
biggestIndex = i;
switch (biggestIndex)
{
case 0:
//Do stuff for Akery..
break;
case 1:
//Do stuff for Darosa
break;
....
}
I apolagize for the galaxy++ code.. I can't be bothered to convert it to GUI atm. I hope you get what I mean anyway..
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I'm trying to setup a leaderboard that shows the hero that you've played the most throughout the times you've played my map. I got it setup, but have questions about the second part. Read below.
Is there a better way of doing this second trigger? I need it to check to see what hero has been played the most out of all the games played. This way above would be a pain as I would have to check each hero vs each hero. Is there an easier way?
Save the time each player has played a hero into an array variable, then run through the variable, get the max index, and get the hero based on that index...
Something like
I apolagize for the galaxy
++
code.. I can't be bothered to convert it to GUI atm. I hope you get what I mean anyway..