| 11-20-2004, 01:13 AM | #1 |
Ok, ur prob saying leaderboards r ez, well, not this 1... I first gotta explain what its being used for. I have a "squad system" for my map. Basically, u can create squads and invite players into them. THen it should display all the players and there exp within a leader for that squad. So if tehere r 10 squads, that means 10 leaderboards. So, i used a diminsional boolean array to define positions, so for instance: squad number x 100 + player nuymber = true so if player 1 joins squad 7 then array slot 701 would be true so, 605 = true would be player 5 is in squad 6. Ok, now each squad has a name and all thats at the top of the leaderboard. The leaderboard is acting really wierd, it displays all the players in the squad, however, some players can c everys names on the leader while others in the same squad may see only 1 or no names. So, heres my trigger, gl with it, i really need this 2 work! Code:
Squads Leaderboard
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
For each (Integer B) from 1 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Squads[(((Integer A) x 100) + (Integer B))] Equal to True
Then - Actions
Leaderboard - Create a leaderboard for (Player group((Player((Integer B))))) titled PlayerSquadNames[(Player number of (Player((Integer B))))]
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Squads[((PlayerSquadNumbers[(Integer B)] x 100) + (Integer A))] Equal to True
Then - Actions
Set PlayerLeaderboards[(Integer A)] = (Last created leaderboard)
Leaderboard - Add (Player((Integer A))) to (Last created leaderboard) with label (Substring((Name of (Player((Integer A)))), 30, ((Length of (Name of (Player((Integer A))))) - 2))) and value 0
Leaderboard - Change the value for (Player((Integer A))) in (Last created leaderboard) to (Integer(PlayersExperience[(Integer A)]))
Else - Actions
Leaderboard - Sort (Last created leaderboard) by Value in Descending order
Else - Actions
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
Set TempCounter4[(Integer A)] = 0
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
For each (Integer B) from 1 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Squads[(((Integer A) x 100) + (Integer B))] Equal to False
Then - Actions
Set TempCounter4[(Integer B)] = (TempCounter4[(Integer B)] + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempCounter4[(Integer B)] Greater than or equal to 10
Then - Actions
Set TempCounter4[(Integer B)] = 0
Leaderboard - Destroy PlayerLeaderboards[(Integer B)]
Else - Actions
Else - Actions |
| 11-20-2004, 11:01 AM | #2 |
Wouldn't it be better to use an array of 100, where it is (squad number - 1) * 10 + player number - 1 = true That would mean squad 1 player 1: 0 squad 2 player 1: 10 squad 2 player 7: 16 squad 10 player 10: 99 ... BTW you're using a loop with integer A in another loop with integer A, I think that's messing it up. |
| 11-20-2004, 08:26 PM | #3 |
In the past I had arrays fuck up my map cause they were simply to large and had empty spots. so always try to make them line up as good as possible, like afb-diehard said. |
| 11-20-2004, 08:34 PM | #4 |
I dont really understand what you mean but this is a major error: You use integer A inside another integer A loop. You have to use integer variable if more loops in each other than to B. |
| 11-20-2004, 09:56 PM | #5 | |
Quote:
well, wouldnt it just use the newer integer a for it, so integer a integer a display integer a so it would display the second integer as value, but i will try using a variable. |
| 11-20-2004, 10:32 PM | #6 | |
Quote:
No! Loops work like this (you will see if you convert to JASS): there is a global variable called for_loopAIndex. And the loop runs while the value is lower than for_loopAIndexEnd. Loop B uses for_loopBIndex instead...and if you specify with a custom variable it will use that variable for the loop instead. Why would blizzard make both loop A and loop B if you could use loop A in all of them? Like I said before: Try converting a loop to jass and u see better how it works. |
| 11-20-2004, 11:25 PM | #7 | |
Quote:
|
