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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  4. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  5. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Do you have good ideas for new contests? If so, please open new threads in the Contest Submission sub-forum to discuss them.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Little help with my trigger

Discussion in 'Triggers & Scripts' started by yuganeigii, Nov 10, 2012.

  1. yuganeigii

    yuganeigii

    Joined:
    Feb 9, 2008
    Messages:
    63
    Resources:
    0
    Resources:
    0
    I'm trying to make a GUI spell based on dark portal that's supposed to follow these descriptions:

    1.summon 1 random type of monster for the caster

    Additional info:
    Call is based on Dark Portal
    Summon Type 1,2 and 3 is based on Feral Spirit

    Encountered Problems:

    1.How do i make this trigger shorter? (i know it sucks)

    • Melee Initialization
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Call (Archimonde)
      • Actions
        • Set SummonChance[1] = Summon Type 1
        • Set SummonChance[2] = Summon Type 2
        • Set SummonChance[3] = Summon Type 3
        • Set SummonPoint[1] = (Target point of ability being cast)
        • Set SummonPoint[2] = (Position of (Triggering unit))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Random integer number between 1 and 3) Equal to 1
          • Then - Actions
            • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
            • Unit - Add SummonChance[1] to (Last created unit)
            • Unit - Set level of SummonChance[1] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
            • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
            • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Random integer number between 1 and 3) Equal to 2
              • Then - Actions
                • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
                • Unit - Add SummonChance[2] to (Last created unit)
                • Unit - Set level of SummonChance[2] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
                • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
                • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Random integer number between 1 and 3) Equal to 3
                  • Then - Actions
                    • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
                    • Unit - Add SummonChance[3] to (Last created unit)
                    • Unit - Set level of SummonChance[3] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
                    • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
                    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • Else - Actions
        • Custom script: call RemoveLocation (udg_SummonPoint[1])
        • Custom script: call RemoveLocation (udg_SummonPoint[2])


    2. for some reason there are times that the spell doesn't create a dummy thus not summoning anything, how do i solve this?

    3. how do i make it MUI?

    Thanks in advance
     
    Last edited: Nov 11, 2012
  2. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,846
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    The problem with this trigger is that sometimes you may hit the empty else because every another elseif you are compairing newly generated integer to the value(1,2,3)

    Also dont use location array just because of 2 locations, just use 2 locations like loc1 and loc2.

    Create another integer of type integer and name it someway.
    Then set that to Random number between 1 and 3 and then do(including your location array, laziness):
    • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
    • Unit - Add SummonChance[!integer!] to (Last created unit)
    • Unit - Set level of SummonChance[!integer!] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
    • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)


    change the !integer! to the integer you have created The rest is good enough
     
  3. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,979
    Resources:
    17
    Spells:
    17
    Resources:
    17
    That IS... his purpose.
    10% chance to summon each unit - else fails.
     
  4. yuganeigii

    yuganeigii

    Joined:
    Feb 9, 2008
    Messages:
    63
    Resources:
    0
    Resources:
    0
    I must apologize first for posting the wrong descriptions, the spell is supposed to summon a random monster it has no chance to fail again i apologize.

    i already fixed it in the first post



    here's what i did it works all the time now
    • Melee Initialization
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Call (Archimonde)
      • Actions
        • Set SummonChance[1] = Summon Type 1
        • Set SummonChance[2] = Summon Type 2
        • Set SummonChance[3] = Summon Type 3
        • Set SummonPoint[1] = (Target point of ability being cast)
        • Set SummonPoint[2] = (Position of (Triggering unit))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Random integer number between 1 and 3) Equal to 1
          • Then - Actions
            • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
            • Unit - Add SummonChance[1] to (Last created unit)
            • Unit - Set level of SummonChance[1] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
            • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
            • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Random integer number between 1 and 3) Equal to 2
              • Then - Actions
                • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
                • Unit - Add SummonChance[2] to (Last created unit)
                • Unit - Set level of SummonChance[2] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
                • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
                • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Else - Actions
                • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
                • Unit - Add SummonChance[3] to (Last created unit)
                • Unit - Set level of SummonChance[3] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
                • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
                • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        • Custom script: call RemoveLocation (udg_SummonPoint[1])
        • Custom script: call RemoveLocation (udg_SummonPoint[2])


    the problems is that is still very long and if the solution is...
    i simply dont get it...can you explain a little bit further?

    thanks for replying :D
     
  5. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,979
    Resources:
    17
    Spells:
    17
    Resources:
    17
    Here's a test map.
     

    Attached Files:

  6. yuganeigii

    yuganeigii

    Joined:
    Feb 9, 2008
    Messages:
    63
    Resources:
    0
    Resources:
    0
    Thanks i fully understand now Rep + to you :D