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. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  4. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    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.

Minimal Range Question

Discussion in 'World Editor Help Zone' started by Impereal Gardian, May 31, 2014.

  1. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    Hello, was wondering if there was a way to work this trigger.
    I'm pretty bad at certain triggers, and was needing help.

    Okay, so a unit has 0-1000 range, but what I would was to know is if a unit comes within 400 range of the my unit (in this case, Sniper), Sniper gets a 50% miss chance on JUST that target, changing targets will give him his range back.
    (Planning on having a skill that increases his range if this changes anything)

    ^ I think I can already tell this sounds almost like its set up how it should be, but having a little difficulty with the setup.
    Thanks :)

    :ogre_datass:
     
  2. aple

    aple

    Joined:
    May 20, 2009
    Messages:
    811
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    I think you'd do something like:

    • Untitled Trigger 003
      • Events
        • Unit - A unit Is issued an order targeting an object
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to YOUR_UNIT
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • (Issued order) Equal to (Order(attack))
                • (Issued order) Equal to (Order(smart))
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Target unit of issued order) is in (Units within 400.00 of (Position of (Ordered unit)))) Equal to True
              • Then - Actions
                • Unit - Create 1 DUMMY_UNIT for (Owner of (Ordered unit)) at (Position of (Ordered unit)) facing (Position of (Ordered unit))
                • Unit - Order (Last created unit) to Undead Banshee - Curse (Ordered unit)
                • 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
                    • ((Target unit of issued order) is in (Units within 400.00 of (Position of (Ordered unit)))) Equal to False
                  • Then - Actions
                    • Unit - Remove Curse buff from (Ordered unit)
                  • Else - Actions
          • Else - Actions


    That should work.

    Now, to set up your DUMMY unit, you make sure:

    Art - Model File = BlankModel.Mdx
    Art - Shadow Image (Unit) = None
    Art - Animation - Cast Backswing = 0
    Art - Animation - Cast Point = 0
    Combat - Attacks Enabled = No attacks

    And You make sure it has the Locust (Aloc) ability.
     
  3. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    2 Questions

    How does the spell Undead Banshee - Curse know the % i want for miss chance?

    Q2 - I may be wrong, but does not removing Dummy units create leaks?
    ^ Edit : Or is this what this does
    Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
     
  4. Karzama

    Karzama

    Joined:
    Oct 16, 2010
    Messages:
    598
    Resources:
    0
    Resources:
    0
    Setting the % of Curse to 100% will cause it to miss on all attacks. The Dummy will leak a point but other than that it'll be fine.
     
  5. water_Knight

    water_Knight

    Joined:
    Mar 22, 2008
    Messages:
    421
    Resources:
    1
    Maps:
    1
    Resources:
    1
    To remove the leak just make a point varible and set that point to where the dummy with spawn then spawn the dummy there. After it spawns use a custom script

    call RemoveLocation (udg_Temp_Point)
     
  6. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    Karzama, how do I change that?

    And thanks water knight, will do.
     
  7. sethmachine

    sethmachine

    Joined:
    Aug 7, 2013
    Messages:
    1,318
    Resources:
    0
    Resources:
    0
    Just go into the Object Editor and look for the Undead unit ability - Curse, then look for the field where it is % miss chance and set it to 0.40 for 40% miss rate.
     
  8. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0