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. Weave light to take you to your highest hopes - the 6th Special Effect Contest is here!
    Dismiss Notice
  4. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  5. 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.

trouble with trigger

Discussion in 'Triggers & Scripts' started by sredrummurders, Sep 5, 2010.

  1. sredrummurders

    sredrummurders

    Joined:
    Aug 19, 2010
    Messages:
    21
    Resources:
    0
    Resources:
    0
    can someone help me fix this trigger in the attachment
     

    Attached Files:

  2. watermelon_1234

    watermelon_1234

    Joined:
    Nov 18, 2007
    Messages:
    1,066
    Resources:
    10
    Spells:
    9
    JASS:
    1
    Resources:
    10
    The test-map is pretty pointless since you don't even give the hero the ability.

    You also could have posted your trigger:
    • Random
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to forky
      • Actions
        • Unit Group - Add (Target unit of ability being cast) to tempunitgroup
        • For each (Integer A) from 1 to 3, do (Actions)
          • Loop - Actions
            • Set temppoint = (Position of (Target unit of ability being cast))
            • Set tempunitgroup2 = (Units within 400.00 of temppoint matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Matching unit) is in tempunitgroup) Equal to False)))
            • Unit Group - Add (Random unit from tempunitgroup2) to tempunitgroup
            • Custom script: call DestroyGroup (udg_tempgroup2)
            • Custom script: call RemoveLocation (udg_temppoint)
            • Unit Group - Pick every unit in tempunitgroup and do (Actions)
              • Loop - Actions
                • Set temppoint = (Position of (Casting unit))
                • Set temppoint2 = (Position of (Picked unit))
                • Lightning - Create a Forked Lightning lightning effect from source (Position of (Casting unit)) to target temppoint2
                • Unit - Cause (Casting unit) to damage (Picked unit), dealing (2.00 x (Real(((Intelligence of (Casting unit) (Include bonuses)) x (Level of Unknown (A00M) for (Casting unit)))))) damage of attack type Spells and damage type Normal
                • Custom script: call DestroyGroup (udg_tempgroup)
                • Custom script: call RemoveLocation (udg_temppoint)
                • Custom script: call RemoveLocation (udg_temppoint2)
                • Wait 2.00 seconds
                • Set temppoint2 = (Target point of ability being cast)
    You should try to be more descriptive:
    What do you want your spell to do?
    What isn't going right?

    Edit:
    I'm assuming you're trying to do a custom Forked Lightning.
    I'll tell you some things that are wrong with your trigger:

    • No damage is dealt because you're checking the level of an unknown ability.
    • The lightnings never get destroyed.
    • Use Triggering unit over Casting unit.
     
  3. sredrummurders

    sredrummurders

    Joined:
    Aug 19, 2010
    Messages:
    21
    Resources:
    0
    Resources:
    0
    ok well

    one problem is

    temppoint2 does not reset so they attack the new temppoint2 and old temppoint2

    and also the lightning dosnt remove and ive tryed alot of triggers and i cant get it to remove without removing all of the lightning its self including after when it casts so theres no animation if i add a remove lightning spell
     
  4. watermelon_1234

    watermelon_1234

    Joined:
    Nov 18, 2007
    Messages:
    1,066
    Resources:
    10
    Spells:
    9
    JASS:
    1
    Resources:
    10
    Okay I just went ahead and retriggered your spell.
    • ForkedLightning
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to forky
      • Actions
        • Unit Group - Add (Target unit of ability being cast) to tempunitgroup
        • Set temppoint = (Position of (Target unit of ability being cast))
        • Set tempunitgroup2 = (Units within 400.00 of temppoint matching ((((Matching unit) belongs to an enemy of (Triggering player)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to (Target unit of ability being cast)))))
        • Custom script: call RemoveLocation (udg_temppoint)
        • For each (Integer A) from 0 to 1, do (Actions)
          • Loop - Actions
            • Set RandomUnit = (Random unit from tempunitgroup2)
            • Game - Display to (All players) the text: (Unit Name + (Name of RandomUnit))
            • Unit Group - Add RandomUnit to tempunitgroup
            • Unit Group - Remove RandomUnit from tempunitgroup2
        • Set temppoint = (Position of (Triggering unit))
        • Unit Group - Pick every unit in tempunitgroup and do (Actions)
          • Loop - Actions
            • Set temppoint2 = (Position of (Picked unit))
            • Lightning - Create a Forked Lightning lightning effect from source temppoint to target temppoint2
            • Trigger - Run DestroyLightning <gen> (ignoring conditions)
            • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (2.00 x (Real(((Intelligence of (Triggering unit) (Include bonuses)) x (Level of forky for (Triggering unit)))))) damage of attack type Spells and damage type Normal
            • Custom script: call RemoveLocation (udg_temppoint2)
        • Custom script: call RemoveLocation (udg_temppoint)
        • Unit Group - Remove all units from tempunitgroup
        • Unit Group - Remove all units from tempunitgroup2
    • DestroyLightning
      • Events
      • Conditions
      • Actions
        • Custom script: local lightning bolt = bj_lastCreatedLightning
        • Wait 2.00 game-time seconds
        • Custom script: call DestroyLightning(bolt)
     

    Attached Files:

  5. sredrummurders

    sredrummurders

    Joined:
    Aug 19, 2010
    Messages:
    21
    Resources:
    0
    Resources:
    0
    thankz <3:thumbs_up::grin: