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. Ride into the sunset with the 32nd Modeling Contest.
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. 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] check (or condition) "does unit have valid pathable route to target"

Discussion in 'Triggers & Scripts' started by Greenwhy, Mar 21, 2014.

  1. Greenwhy

    Greenwhy

    Joined:
    Sep 9, 2007
    Messages:
    249
    Resources:
    0
    Resources:
    0
    I was hoping to find a check, or a condition, which is able to determine weather or not a unit has a valid path to another unit?

    My reasoning is in the context of mazing.
    Something like:

    If there is a valid path that a unit has to it's current target
    then order unit to attack Target
    else order unit to attack move toward position of target.

    would be ideal. (I understand SC2 has a native oncdition along the lines of "can unit move from point A to point B" but I don't want to use sc2.

    Thanks.
     
  2. Zwiebelchen

    Zwiebelchen

    Joined:
    Sep 17, 2009
    Messages:
    6,826
    Resources:
    12
    Models:
    5
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    JASS:
    4
    Resources:
    12
    Something like this is impossible without a complex pathing algorithm.

    Tower defences usually use hidden units that get constantly sent through your maze and if they haven't moved for a certain amount of time, the player is punished (as when the unit can not reach the target, it will try to get close to the target and then stop moving).
     
  3. Greenwhy

    Greenwhy

    Joined:
    Sep 9, 2007
    Messages:
    249
    Resources:
    0
    Resources:
    0
    Ah OK. Yes I understand these triggers use the "get unit order = none" then explode.

    So I guess my next question is... How does This map (http://www.hiveworkshop.com/forums/...a-79998/?prev=search=kodo%20treme&d=list&r=20) control the orders of the Kodos. They seem to fairly intelligently track down the player units or, if there is no path, begin to attack structures.


    I've tried to reverse engineer the code but as the map was deprotected I find it very confusing.
     
  4. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,930
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    This is not directly possible in Warcraft III. StarCraft II lets you do this very easily and efficiently with a native function call (which is why maze blocking is not a problem in SC2 TDs).

    I believe nestharus made such a system, or at least knows who did.
     
  5. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Yeah, someone did make one, it may have been nes, I can't remember. Line Tower Wars uses it too.