• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] A unit comes within range.

Status
Not open for further replies.
Level 6
Joined
Oct 18, 2008
Messages
100
  • MarketSet
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) |cffffd700Select Market|r
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Target unit of ability being cast)) Equal to (==) Market
          • (Owner of (Target unit of ability being cast)) Not equal to (!=) (Owner of (Triggering unit))
        • Then - Actions
          • Set Market_Point[(Player number of (Owner of (Triggering unit)))] = (Position of (Target unit of ability being cast))
          • Set Home_Market[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
          • Set Home_Point[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
          • Set Allied_Market[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
          • Trigger - Add to MarketPointReached <gen> the event (Unit - A unit comes within 100.00 of Allied_Market[(Player number of (Owner of (Triggering unit)))])
          • Quest - Display to (Player group((Owner of (Triggering unit)))) the Quest Update message: (|cffffd700You have succesfully opened trade with: |r + (Name of (Owner of (Target unit of ability being cast))))
          • Set Distance = (Integer((Distance between Home_Point[(Player number of (Owner of (Triggering unit)))] and Market_Point[(Player number of (Owner of (Triggering unit)))])))
          • Quest - Display to (All players) the Quest Update message: (String(Distance))
          • Set Point = (Position of Allied_Market[(Player number of (Owner of (Triggering unit)))])
          • Cinematic - Ping minimap for (Player group((Owner of (Triggering unit)))) at Point for 2.00 seconds
          • Custom script: call RemoveLocation(udg_Point)
        • Else - Actions
          • Quest - Display to (Player group((Owner of (Target unit of ability being cast)))) the Quest Update message: |cffffd700You must ...
I am trying to create a simple trade system.

There is a problem with this. I have placed a simple text message if a unit becomes in range with the selected market. The action doesn't occur does anyone know why it doesn't work?

Note: I am adding the variable to the event since for some reason I cant do it in the other trigger.

thx in advance.
 
Level 6
Joined
Oct 18, 2008
Messages
100
  • MarketPointReached
    • Events
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to (==) Trade Caravan
    • Actions
      • Set Distance = (Integer((Distance between Home_Point[(Player number of (Owner of (Triggering unit)))] and Market_Point[(Player number of (Owner of (Triggering unit)))])))
      • Quest - Display to (All players) the Quest Update message: (String(Distance))
 
Status
Not open for further replies.
Top