HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Wierd Problem

02-13-2006, 07:01 PM#1
Immoralis
Trigger:
Rank Check Apply
Events
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 35
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 75
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 120
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 180
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 245
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 315
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 390
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 470
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 555
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 645
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 740
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 840
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 950
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 1070
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 1200
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 1330
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 1470
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 1620
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 1800
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 2000
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 2200
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 2500
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 3000
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 3500
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 4100
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 5000
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 6000
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 7500
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 10000
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Award_Points[(Player number of Ranking_Player)] Greater than or equal to 15000
Then - Actions
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 30
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 29
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 28
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 27
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 26
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 25
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 24
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 23
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 22
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 21
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 20
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 19
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 18
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 17
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 16
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 15
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 14
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 13
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 12
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 11
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 10
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 9
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 8
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 7
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 6
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 5
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 4
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 3
Collapse Else - Actions
Set Players_Rank[(Player number of Ranking_Player)] = 2
Else - Actions

This trigger causes 422 compile errors.
The first one says it expects returns and then the rest are like expected endif
02-13-2006, 07:35 PM#2
Jacek
It looks stupid. Probably GUI has if nesting limit. Try converting it into JASS.
02-14-2006, 06:23 AM#3
qwertyui
wow dude...
That gotta be the largest if i have ever seen.
And yeah, JASS all the way for stuff like that.
02-14-2006, 09:19 AM#4
Captain Griffen
Or you could have done it a lot easier by setting a variable array at the beginning and then doing it with a loop. Also, it doesn't do anything if it is >15,000. That correct?
02-14-2006, 09:35 AM#5
Whitehorn
Wow. What a waste of time.

Don't nest in GUI that deep.
02-14-2006, 12:31 PM#6
Vexorian
Actually if GUI has a nesting limit, most likelly JASS has also.

Well You can just not nest stuff

instead of
Code:
if (...)
     ....
else
     if (...)
          ...
     else
          if (...)
               ....
          else

you can use:


Code:
if  (...)
{
    ....
    skip remaining actions
}
if  (...)
{
    ....
    skip remaining actions
}

if  (...)
{
    ....
    skip remaining actions
}
if  (...)
{
    ....
    skip remaining actions
}
if  (...)
{
    ....
    skip remaining actions
}
02-14-2006, 08:34 PM#7
Chuckle_Brother
I agree with Griffen, use arrays, the setup may be ugly, but in the end it will be better since it doesn't need to go through all those stupid IF statements.
02-14-2006, 10:57 PM#8
Immoralis
Arrays FTW!
02-15-2006, 03:42 AM#9
Jacek
Quote:
Originally Posted by Immoralis
Arrays FTW!
Whoa...

I think Vexorian's would also work in this.
02-15-2006, 08:54 AM#10
Captain Griffen
It would work, but it would be lines and lines and lines and lines of code, wheras mine would be 4/5.
02-15-2006, 02:18 PM#11
Chuckle_Brother
Arrays = Part of the path of godliness. The only other stuff better than arrays is what blizzard didn't give us.
02-15-2006, 02:32 PM#12
Jacek
Quote:
Originally Posted by Chuckle_Brother
Arrays = Part of the path of godliness. The only other stuff better than arrays is what blizzard didn't give us.
I demand 2D arrays
02-15-2006, 03:15 PM#13
Daminon
Unless you really need to have these exact vaules you might be able to use some math with modulo and such and calculate the ranking from the points.
02-15-2006, 03:21 PM#14
qwertyui
2D arrays are so easy to implement it isn't even funny :/