HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

<><>Trigger Help<><>

07-28-2004, 09:17 AM#1
kagashin
can anyone see anything wrong with this?

its suppose to pick a random # and then turn on a trigger and ping a spot


Code:
Actions
    Set rnd = (Random integer number between 1 and 7)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            rnd Equal to 1
            r1 Equal to False
        Then - Actions
            Trigger - Turn on Get Gem <gen>
            Cinematic - Ping minimap for (All players) at (Center of Region 017 <gen>) for 15.00 seconds, using a Flashy ping of color (100.00%, 100.00%, 100.00%)
            Set r1 = True
            Skip remaining actions
        Else - Actions
            Trigger - Run (This trigger) (checking conditions)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            rnd Equal to 2
            r1_Copy Equal to False
        Then - Actions
            Trigger - Turn on Get Gem Copy <gen>
            Cinematic - Ping minimap for (All players) at (Center of Region 019 <gen>) for 15.00 seconds, using a Flashy ping of color (100.00%, 100.00%, 100.00%)
            Set r1_Copy = True
            Skip remaining actions
        Else - Actions
            Trigger - Run (This trigger) (checking conditions)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            rnd Equal to 3
            r1_Copy_2 Equal to False
        Then - Actions
            Trigger - Turn on Get Gem Copy 2 <gen>
            Cinematic - Ping minimap for (All players) at (Center of Region 0172 <gen>) for 15.00 seconds, using a Flashy ping of color (100.00%, 100.00%, 100.00%)
            Set r1_Copy_2 = True
            Skip remaining actions
        Else - Actions
            Trigger - Run (This trigger) (checking conditions)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            rnd Equal to 4
            r1_Copy_3 Equal to False
        Then - Actions
            Trigger - Turn on Get Gem Copy 3 <gen>
            Cinematic - Ping minimap for (All players) at (Center of Region 011 <gen>) for 15.00 seconds, using a Flashy ping of color (100.00%, 100.00%, 100.00%)
            Set r1_Copy_3 = True
            Skip remaining actions
        Else - Actions
            Trigger - Run (This trigger) (checking conditions)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            rnd Equal to 5
            r1_Copy_4 Equal to False
        Then - Actions
            Trigger - Turn on Get Gem Copy 4 <gen>
            Cinematic - Ping minimap for (All players) at (Center of Region 015 <gen>) for 15.00 seconds, using a Flashy ping of color (100.00%, 100.00%, 100.00%)
            Set r1_Copy_4 = True
            Skip remaining actions
        Else - Actions
            Trigger - Run (This trigger) (checking conditions)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            rnd Equal to 6
            r1_Copy_5 Equal to False
        Then - Actions
            Trigger - Turn on Get Gem Copy 5 <gen>
            Cinematic - Ping minimap for (All players) at (Center of Region 016 <gen>) for 15.00 seconds, using a Flashy ping of color (100.00%, 100.00%, 100.00%)
            Set r1_Copy_5 = True
            Skip remaining actions
        Else - Actions
            Trigger - Run (This trigger) (checking conditions)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            rnd Equal to 7
            r1_Copy_6 Equal to False
        Then - Actions
            Trigger - Turn on Get Gem Copy 6 <gen>
            Cinematic - Ping minimap for (All players) at (Center of Region 027 <gen>) for 15.00 seconds, using a Flashy ping of color (100.00%, 100.00%, 100.00%)
            Set r1_Copy_6 = True
            Skip remaining actions
        Else - Actions
            Trigger - Run (This trigger) (checking conditions)

if you have any questions about it please post them
07-28-2004, 09:37 AM#2
Anitarf
I don't see exactly why do you have this in the trigger: Trigger - Run (This trigger) (checking conditions)
Wouldn't this kind of make the trigger run itself over and over and over again if, for example, r1 was false?

Otherwise, you could do this with a lot less copy&pasting if you used arrays&loops.
07-28-2004, 09:58 AM#3
kagashin
Quote:
Originally Posted by Anitarf
I don't see exactly why do you have this in the trigger: Trigger - Run (This trigger) (checking conditions)
Wouldn't this kind of make the trigger run itself over and over and over again if, for example, r1 was false?

Otherwise, you could do this with a lot less copy&pasting if you used arrays&loops.


i added that so it wouldent do the same number twice
07-28-2004, 10:03 AM#4
Anitarf
Yeah, but, see, what happens when, for example, r1 is flase, is that, when the trigger runs, it sees that it is false, and does the "else - actions". Well, "else - actions" require the trigger to run itself again, and we have the same situation, again. This can go up to infinity, crashing the game, stuff like that.
07-28-2004, 03:04 PM#5
DarkFanatic
youääl have to move every consecutive if/then/else into the else fork of the last if, and remove the run trigger.
but you should really consider using loops and arrays, as anitarf suggested. just check the forums how to use them.
07-29-2004, 04:58 AM#6
kagashin
r1 is set to false.....

but get this

Code:
    ** If (All Conditions are True) then do (Then Actions) ** else do (Else Actions)

         If - Conditions
            rnd Equal to 1               <-is true
            r1 Equal to False           <-is true
        Then - Actions                   <-then it will run these
            Trigger - Turn on Get Gem <gen>
            Cinematic - Ping minimap for (All players) at (Center of Region 017 <gen>) for 15.00 seconds, using a Flashy ping of color (100.00%, 100.00%, 100.00%)
            Set r1 = True                 <-sets r1 to True makeing this condition false thus in turn doing the Else actions
            Skip remaining actions

see what i meen?
07-29-2004, 06:01 AM#7
Anitarf
Ok, I made a mistake, read the trigger too fast. But, what if r1 is true, not false? Then the things happen that I was explaining earlier:
Code:
   Else - Action
            Trigger - Run (This trigger) (checking conditions)
This runs the trigger, but r1 is still true... That means that the trigger runs again... and again... and again...
07-29-2004, 06:07 AM#8
kagashin
thats if the randome # generated is = to the number of the coresponding actions
Code:
    Set rnd = (Random integer number between 1 and 7)  <<Sets the random #
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            rnd Equal to 1  <<<the random # has to be = to this # for it to do these actions
            r1 Equal to False
        Then - Actions
            BLAH BLAH BLAH
        Else - Actions
            Trigger - Run (This trigger) (checking conditions)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            rnd Equal to 2  <<<but if the random # =2 then it will do these actions am i right or wrong becuse this is where i think my problem is
            r1_Copy Equal to False
        Then - Actions
             BLAH BLAH BLAH
        Else - Actions
            Trigger - Run (This trigger) (checking conditions)



 


YOU ARE A GOLDEN GOD!!!! YOU HELPED ME FIND MY PROBLEM... i think one min and let me test it
07-29-2004, 06:11 AM#9
Anitarf
That doesn't matter, if r1 is true, the trigger will rerun itself no matter what random number is selected (because the else actions run the moment one of the conditions isn't true); so the trigger will just keep reruning itself...

Gah, enough of this, just tell us what and when you want the trigger to do exactly, and post the rest of the trigger (conditions&actions).
07-29-2004, 06:14 AM#10
kagashin
Yes i fixed my problem thnk you for helping me tho