1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  5. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  6. The 13th Music Contest Poll is up! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] Endif? Please Help my Trigger Doesn't Work.

Discussion in 'Triggers & Scripts' started by pandamanana, Dec 27, 2007.

  1. pandamanana

    pandamanana

    Joined:
    Dec 26, 2006
    Messages:
    328
    Resources:
    1
    Maps:
    1
    Resources:
    1
    • Untitled Trigger 001
      • Events
        • Unit - A unit Sells a unit
      • Conditions
        • (Unit-type of (Selling unit)) Equal to Celestial Portal
      • Actions
        • Unit - Remove (Sold unit) from the game
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (Triggering unit)) Equal to Veledrian Sentinel
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Owner of (Sold unit)) Equal to Player 1 (Red)
              • Then - Actions
                • Hero - Drop the item from slot 1 of (Selling unit)
                • Hero - Create archer and give it to (Selling unit)
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Owner of (Sold unit)) Equal to Player 2 (Blue)
                  • Then - Actions
                    • Hero - Drop the item from slot 2 of (Selling unit)
                    • Hero - Create archer and give it to (Selling unit)
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Owner of (Sold unit)) Equal to Player 3 (Teal)
                      • Then - Actions
                        • Hero - Drop the item from slot 3 of (Selling unit)
                        • Hero - Create archer and give it to (Selling unit)
                      • Else - Actions
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • (Owner of (Sold unit)) Equal to Player 4 (Purple)
                          • Then - Actions
                            • Hero - Drop the item from slot 4 of (Selling unit)
                            • Hero - Create archer and give it to (Selling unit)
                          • Else - Actions
                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              • If - Conditions
                                • (Owner of (Sold unit)) Equal to Player 5 (Yellow)
                              • Then - Actions
                                • Hero - Drop the item from slot 5 of (Selling unit)
                                • Hero - Create archer and give it to (Selling unit)
                              • Else - Actions
                                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                  • If - Conditions
                                    • (Unit-type of (Triggering unit)) Equal to Ardent Cavalier
                                  • Then - Actions
                                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      • If - Conditions
                                        • (Owner of (Sold unit)) Equal to Player 1 (Red)
                                      • Then - Actions
                                        • Hero - Drop the item from slot 1 of (Selling unit)
                                        • Hero - Create tank and give it to (Selling unit)
                                      • Else - Actions
                                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                          • If - Conditions
                                            • (Owner of (Sold unit)) Equal to Player 2 (Blue)
                                          • Then - Actions
                                            • Hero - Drop the item from slot 2 of (Selling unit)
                                            • Hero - Create tank and give it to (Selling unit)
                                          • Else - Actions
                                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                              • If - Conditions
                                                • (Owner of (Sold unit)) Equal to Player 3 (Teal)
                                              • Then - Actions
                                                • Hero - Drop the item from slot 3 of (Selling unit)
                                                • Hero - Create tank and give it to (Selling unit)
                                              • Else - Actions
                                                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                  • If - Conditions
                                                    • (Owner of (Sold unit)) Equal to Player 4 (Purple)
                                                  • Then - Actions
                                                    • Hero - Drop the item from slot 4 of (Selling unit)
                                                    • Hero - Create tank and give it to (Selling unit)
                                                  • Else - Actions
                                                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                      • If - Conditions
                                                        • (Owner of (Sold unit)) Equal to Player 5 (Yellow)
                                                      • Then - Actions
                                                        • Hero - Drop the item from slot 5 of (Selling unit)
                                                        • Hero - Create tank and give it to (Selling unit)
                                                      • Else - Actions
                                                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                          • If - Conditions
                                                            • (Unit-type of (Triggering unit)) Equal to Ardent Wrath
                                                          • Then - Actions
                                                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                              • If - Conditions
                                                                • (Owner of (Sold unit)) Equal to Player 1 (Red)
                                                              • Then - Actions
                                                                • Hero - Drop the item from slot 1 of (Selling unit)
                                                                • Hero - Create beserker and give it to (Selling unit)
                                                              • Else - Actions
                                                                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                  • If - Conditions
                                                                    • (Owner of (Sold unit)) Equal to Player 2 (Blue)
                                                                  • Then - Actions
                                                                    • Hero - Drop the item from slot 2 of (Selling unit)
                                                                    • Hero - Create beserker and give it to (Selling unit)
                                                                  • Else - Actions
                                                                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                      • If - Conditions
                                                                        • (Owner of (Sold unit)) Equal to Player 3 (Teal)
                                                                      • Then - Actions
                                                                        • Hero - Drop the item from slot 3 of (Selling unit)
                                                                        • Hero - Create beserker and give it to (Selling unit)
                                                                      • Else - Actions
                                                                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                          • If - Conditions
                                                                            • (Owner of (Sold unit)) Equal to Player 4 (Purple)
                                                                          • Then - Actions
                                                                            • Hero - Drop the item from slot 4 of (Selling unit)
                                                                            • Hero - Create beserker and give it to (Selling unit)
                                                                          • Else - Actions
                                                                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                              • If - Conditions
                                                                                • (Owner of (Sold unit)) Equal to Player 5 (Yellow)
                                                                              • Then - Actions
                                                                                • Hero - Drop the item from slot 5 of (Selling unit)
                                                                                • Hero - Create beserker and give it to (Selling unit)
                                                                              • Else - Actions
                                                                                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                  • If - Conditions
                                                                                    • (Unit-type of (Triggering unit)) Equal to Veledrian Ettin
                                                                                  • Then - Actions
                                                                                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                      • If - Conditions
                                                                                        • (Owner of (Sold unit)) Equal to Player 1 (Red)
                                                                                      • Then - Actions
                                                                                        • Hero - Drop the item from slot 1 of (Selling unit)
                                                                                        • Hero - Create siege and give it to (Selling unit)
                                                                                      • Else - Actions
                                                                                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                          • If - Conditions
                                                                                            • (Owner of (Sold unit)) Equal to Player 2 (Blue)
                                                                                          • Then - Actions
                                                                                            • Hero - Drop the item from slot 2 of (Selling unit)
                                                                                            • Hero - Create siege and give it to (Selling unit)
                                                                                          • Else - Actions
                                                                                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                              • If - Conditions
                                                                                                • (Owner of (Sold unit)) Equal to Player 3 (Teal)
                                                                                              • Then - Actions
                                                                                                • Hero - Drop the item from slot 3 of (Selling unit)
                                                                                                • Hero - Create siege and give it to (Selling unit)
                                                                                              • Else - Actions
                                                                                                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                  • If - Conditions
                                                                                                    • (Owner of (Sold unit)) Equal to Player 4 (Purple)
                                                                                                  • Then - Actions
                                                                                                    • Hero - Drop the item from slot 4 of (Selling unit)
                                                                                                    • Hero - Create siege and give it to (Selling unit)
                                                                                                  • Else - Actions
                                                                                                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                      • If - Conditions
                                                                                                        • (Owner of (Sold unit)) Equal to Player 5 (Yellow)
                                                                                                      • Then - Actions
                                                                                                        • Hero - Drop the item from slot 5 of (Selling unit)
                                                                                                        • Hero - Create siege and give it to (Selling unit)
                                                                                                      • Else - Actions
                                                                                                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                          • If - Conditions
                                                                                                            • (Unit-type of (Triggering unit)) Equal to Ardent Medic
                                                                                                          • Then - Actions
                                                                                                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                              • If - Conditions
                                                                                                                • (Owner of (Sold unit)) Equal to Player 1 (Red)
                                                                                                              • Then - Actions
                                                                                                                • Hero - Drop the item from slot 1 of (Selling unit)
                                                                                                                • Hero - Create healer and give it to (Selling unit)
                                                                                                              • Else - Actions
                                                                                                                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                  • If - Conditions
                                                                                                                    • (Owner of (Sold unit)) Equal to Player 2 (Blue)
                                                                                                                  • Then - Actions
                                                                                                                    • Hero - Drop the item from slot 2 of (Selling unit)
                                                                                                                    • Hero - Create healer and give it to (Selling unit)
                                                                                                                  • Else - Actions
                                                                                                                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                      • If - Conditions
                                                                                                                        • (Owner of (Sold unit)) Equal to Player 3 (Teal)
                                                                                                                      • Then - Actions
                                                                                                                        • Hero - Drop the item from slot 3 of (Selling unit)
                                                                                                                        • Hero - Create healer and give it to (Selling unit)
                                                                                                                      • Else - Actions
                                                                                                                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                          • If - Conditions
                                                                                                                            • (Owner of (Sold unit)) Equal to Player 4 (Purple)
                                                                                                                          • Then - Actions
                                                                                                                            • Hero - Drop the item from slot 4 of (Selling unit)
                                                                                                                            • Hero - Create healer and give it to (Selling unit)
                                                                                                                          • Else - Actions
                                                                                                                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                              • If - Conditions
                                                                                                                                • (Owner of (Sold unit)) Equal to Player 5 (Yellow)
                                                                                                                              • Then - Actions
                                                                                                                                • Hero - Drop the item from slot 5 of (Selling unit)
                                                                                                                                • Hero - Create healer and give it to (Selling unit)
                                                                                                                              • Else - Actions
                                                                                                                                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                                  • If - Conditions
                                                                                                                                    • (Unit-type of (Triggering unit)) Equal to Ardent Redeemer
                                                                                                                                  • Then - Actions
                                                                                                                                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                                      • If - Conditions
                                                                                                                                        • (Owner of (Sold unit)) Equal to Player 1 (Red)
                                                                                                                                      • Then - Actions
                                                                                                                                        • Hero - Drop the item from slot 1 of (Selling unit)
                                                                                                                                        • Hero - Create buffer and give it to (Selling unit)
                                                                                                                                      • Else - Actions
                                                                                                                                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                                          • If - Conditions
                                                                                                                                            • (Owner of (Sold unit)) Equal to Player 2 (Blue)
                                                                                                                                          • Then - Actions
                                                                                                                                            • Hero - Drop the item from slot 2 of (Selling unit)
                                                                                                                                            • Hero - Create buffer and give it to (Selling unit)
                                                                                                                                          • Else - Actions
                                                                                                                                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                                              • If - Conditions
                                                                                                                                                • (Owner of (Sold unit)) Equal to Player 3 (Teal)
                                                                                                                                              • Then - Actions
                                                                                                                                                • Hero - Drop the item from slot 3 of (Selling unit)
                                                                                                                                                • Hero - Create buffer and give it to (Selling unit)
                                                                                                                                              • Else - Actions
                                                                                                                                                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                                                  • If - Conditions
                                                                                                                                                    • (Owner of (Sold unit)) Equal to Player 4 (Purple)
                                                                                                                                                  • Then - Actions
                                                                                                                                                    • Hero - Drop the item from slot 4 of (Selling unit)
                                                                                                                                                    • Hero - Create buffer and give it to (Selling unit)
                                                                                                                                                  • Else - Actions
                                                                                                                                                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                                                      • If - Conditions
                                                                                                                                                        • (Owner of (Sold unit)) Equal to Player 5 (Yellow)
                                                                                                                                                      • Then - Actions
                                                                                                                                                        • Hero - Drop the item from slot 5 of (Selling unit)
                                                                                                                                                        • Hero - Create buffer and give it to (Selling unit)
                                                                                                                                                      • Else - Actions
                                                                                                                                                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                                                          • If - Conditions
                                                                                                                                                            • (Unit-type of (Triggering unit)) Equal to Veledrion Pheonix
                                                                                                                                                          • Then - Actions
                                                                                                                                                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                                                              • If - Conditions
                                                                                                                                                                • (Owner of (Sold unit)) Equal to Player 1 (Red)
                                                                                                                                                              • Then - Actions
                                                                                                                                                                • Hero - Drop the item from slot 1 of (Selling unit)
                                                                                                                                                                • Hero - Create nuker and give it to (Selling unit)
                                                                                                                                                              • Else - Actions
                                                                                                                                                                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                                                                  • If - Conditions
                                                                                                                                                                    • (Owner of (Sold unit)) Equal to Player 2 (Blue)
                                                                                                                                                                  • Then - Actions
                                                                                                                                                                    • Hero - Drop the item from slot 2 of (Selling unit)
                                                                                                                                                                    • Hero - Create nuker and give it to (Selling unit)
                                                                                                                                                                  • Else - Actions
                                                                                                                                                                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                                                                      • If - Conditions
                                                                                                                                                                        • (Owner of (Sold unit)) Equal to Player 3 (Teal)
                                                                                                                                                                      • Then - Actions
                                                                                                                                                                        • Hero - Drop the item from slot 3 of (Selling unit)
                                                                                                                                                                        • Hero - Create nuker and give it to (Selling unit)
                                                                                                                                                                      • Else - Actions
                                                                                                                                                                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                                                                          • If - Conditions
                                                                                                                                                                            • (Owner of (Sold unit)) Equal to Player 4 (Purple)
                                                                                                                                                                          • Then - Actions
                                                                                                                                                                            • Hero - Drop the item from slot 4 of (Selling unit)
                                                                                                                                                                            • Hero - Create nuker and give it to (Selling unit)
                                                                                                                                                                          • Else - Actions
                                                                                                                                                                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                                                                              • If - Conditions
                                                                                                                                                                                • (Owner of (Sold unit)) Equal to Player 5 (Yellow)
                                                                                                                                                                              • Then - Actions
                                                                                                                                                                                • Hero - Drop the item from slot 5 of (Selling unit)
                                                                                                                                                                                • Hero - Create nuker and give it to (Selling unit)
                                                                                                                                                                              • Else - Actions
                                                                                                                                                          • Else - Actions
                                                                                                                                  • Else - Actions
                                                                                                          • Else - Actions
                                                                                  • Else - Actions
                                                          • Else - Actions
                                  • Else - Actions
          • Else - Actions


    When I try to activate the trigger, it tells me that the error involves something called Endif... my father (a programmer) told me that thats a script used to show the end of an if function. How would I add the Endif into a trigger via GUI? or Custom Scripts?
     
  2. operator

    operator

    Joined:
    Feb 9, 2006
    Messages:
    1,670
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Please add triggertags

    • Yourtrigger [/trigger.]
    • Without the ''.'' in
     
  3. pandamanana

    pandamanana

    Joined:
    Dec 26, 2006
    Messages:
    328
    Resources:
    1
    Maps:
    1
    Resources:
    1
    okay I'm put it in Trigger format, sorry.

    EDIT : Fixed ^_^ just had to split apart the if then elses instead of stacking them on top of each other ^_^
     
    Last edited: Dec 27, 2007
  4. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,843
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    Wooha ... a long trigger lol.

    Do you know how to use loops and arrays ? it would probably make your trigger to be shortend by 95% or so ...
    You may read my "Loops and arrays tutorial" thread.
     
  5. Need_O2

    Need_O2

    Joined:
    Aug 24, 2007
    Messages:
    2,880
    Resources:
    0
    Resources:
    0
    Drop item in slot (Playernumber of Triggering Player) of Selling Unit
    >.<

    and nice avatar
     
  6. darkwulfv

    darkwulfv

    Joined:
    Dec 17, 2007
    Messages:
    164
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Jesus christ that's the longest GUI trigger I've seen in my entire life...

    You probably missed something somewhere... And chances are, with a massive trigger like that, the game might've just plain fried.

    Because GUI sucks like that, I tihnk you need to put something under all the blank "Else - Actions" you've got hanging around down there.

    Other than that, I can't tell you what's wrong. The trigger is too freaking big to offer any more help than that.
     
  7. GST_Nemisis

    GST_Nemisis

    Joined:
    Jan 5, 2005
    Messages:
    3,600
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    LOL dude you need to learn to loop.
     
  8. darkwulfv

    darkwulfv

    Joined:
    Dec 17, 2007
    Messages:
    164
    Resources:
    1
    Maps:
    1
    Resources:
    1
    He needs to learn to JASS, loop, and array. This trigger is messed up.
     
  9. raft_pl

    raft_pl

    Joined:
    May 27, 2006
    Messages:
    496
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Your trigger doesn`t work, cause you put this in the Trigger Conditions:
    • Events:
    • Conditions:
      • (Unit-type of (Selling unit)) Equal to Celestial Portal
    • Actions:


    After that you have put unit remove action, which runs if the condition above is true.
    Next, you placed If Then Else line - which runs if Triggering (SELLING) unit equal to Veledrian Sentinel.
    Note that the Trigger Conditions are not If Then Else, they check like this:
    Condition = true = run trigger
    Condition = false = dont run trigger


    So as long as the trigger runs only when the selling unit equal to Celestial Portal, your first If Then Else - If Conditions are not true, so Then Actions cannot be done, and they automaticially run Else Actions - which do completely nothing, that`s your problem.

    The solution is: Add one more If Then Else condition before all the others, that checks if Triggering (Selling) unit equal to Celestial Portal, in Then Actions put the rest of If Then Else`s, leave Else Actions empty.
     
  10. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,843
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2

    .......

    abcdef
     
  11. Jetherit

    Jetherit

    Joined:
    Aug 15, 2007
    Messages:
    210
    Resources:
    3
    Maps:
    3
    Resources:
    3
    I was too lazy to read the whole thing, but somewhere you said "If Unit type of triggering unit = Veledrian Sentinel...blahblahblah.

    The event is a unit selling a unit. Meaning the selling unit is the triggering unit, meaning it should be the "Celestial Portal" thing. Though I could be wrong, because I haven't seen your map. And that was one of the first conditions,so if its never true,then nothing ever happens. Might wanna look at that again.

    I just realized that I said exactly what raft_pl said. >_> Sorry.
     
    Last edited: Dec 30, 2007