HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why wont this work?

07-09-2004, 12:22 AM#1
sweet5
ok this is supposed to sort thru some varibles then displays the places of who wins but it doesnt why?


Code:
End Pig Contest
    Events
        Time - PigTimer expires
    Conditions
    Actions
        Countdown Timer - Destroy PigTimerWindow
        Game - Display to (All players) the text: TIME IS UP!!! The j...
        Wait 8.00 seconds
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                For each (Integer B) from 1 to 5, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Integer A) Equal to (Integer B)
                            Then - Actions
                                Skip remaining actions
                            Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                PigSize[(Integer A)] Greater than PigSize[(Integer B)]
                            Then - Actions
                                Set Leader[(Integer A)] = (Leader[(Integer A)] + 1)
                            Else - Actions
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                If (Leader[(Integer A)] Equal to 4) then do (Game - Display to (All players) the text: ((Name of Player[(Integer A)]) +  wins!)) else do (Do nothing)
                If (Leader[(Integer A)] Equal to 3) then do (Game - Display to (All players) the text: ((Name of Player[(Integer A)]) +  takes 2nd!)) else do (Do nothing)
                If (Leader[(Integer A)] Equal to 2) then do (Game - Display to (All players) the text: ((Name of Player[(Integer A)]) +  takes 3rd!)) else do (Do nothing)
                If (Leader[(Integer A)] Equal to 1) then do (Game - Display to (All players) the text: ((Name of Player[(Integer A)]) +  takes 4th!)) else do (Do nothing)
                If (Leader[(Integer A)] Equal to 0) then do (Game - Display to (All players) the text: ((Name of Player[(Integer A)]) +  is in last place)) else do (Do nothing)
07-09-2004, 12:26 AM#2
ForgottenLight
That code looks kind of messy, what exactly are you trying to do?
07-09-2004, 12:31 AM#3
sweet5
well seeing how u didnt read it I'll explain


first, I have 1 array int that goes to 5, one for each player,

Code:
For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                For each (Integer B) from 1 to 5, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Integer A) Equal to (Integer B)
                            Then - Actions
                                Skip remaining actions
                            Else - Actions

picks int then checks to see if they are the same, if they are, skips remmaing actiosn

rest of it just compares the ints and if one is bigger than the other it adds + 1 to that players leader array then it checks leaders array if it = 4 = 1st place if it = 3 = 2nd place and so on
07-09-2004, 01:32 AM#4
Aelita Lyoko
I think the problem lies in the Integer values. You have the values set to 1-5. However, in the last actions, you use the integer values set to 0-4.

I am no trigger expert when it comes to integers and variables, but i am thinking that the last values that are set to 0-4 need to be changed to 1-5. Unless there is a leader board that you didn't mention, then i think that might fix the problem, but, then again, it might not. As i already said, i am no trigger expert.

It is just a thought though. If it helps, then that is great. If it doesn't, then i would keep asking until you find someone who is great with triggers and see what they say.

Hope it helps!
07-09-2004, 01:36 AM#5
sweet5
0-4 is a whole differnt vaule set than the 1 -5s so thats not probelm
07-09-2004, 01:44 AM#6
ChaosWolfs
I think its the Skip Remaining Actions. It sorta like stops the trigger. The integers go in order.

1
2
3
4
5

So the first time it runs. Both A and B will be the same and will trigger "Skip Remaining Actions" action resulting in a trigger that doesn't fully work.
You must of forgotten something...
07-09-2004, 01:55 AM#7
sweet5
hmm that could be it seeing how it only runs once... maybe a do nothing would be better there?
07-09-2004, 02:00 AM#8
ChaosWolfs
Quote:
Originally Posted by sweet5
hmm that could be it seeing how it only runs once... maybe a do nothing would be better there?

I guess, but your trigger doesn't have any actions figuring out a tie =)
07-09-2004, 02:35 AM#9
Browser_12
you test PigSize[] with indices 1, 2, 3, 4, and 5. The first index in an array is 0. so your indices for a 5-integer array are actually 0, 1, 2, 3, and 4. I might check the rest of your trigger if you fix that...

BTW, the other guy was right about your 'remaining actions' stuff. It skips the remaining actions in the
TRIGGER <-- keyword meaning all of those actions. gone. buh-bye. useless trigger.
07-09-2004, 02:42 AM#10
sweet5
fixed it with a simple do nothing and moving the rest of trigger under the else actions, duh :o