• 🏆 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!

Cant figure out what to do.

Status
Not open for further replies.
You can do something like this:
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hashtable = (Last created hashtable)
  • Trgger2
  • Events
    • Unit - A unit is issued an order targeting a point
  • Conditions
    • (Issued order) Equal to (order(townhall))
  • Actions
    • Set Point = (Target point of issued order)
    • Set Temp_Group = (Units within 2000.00 of Points[1] matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((Matching unit) is a town-hall-type unit) Equal to True)
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Number of units in Temp_Group) Not Equal to 0
      • Then - Actions
        • Unit - Create 1 dummy for (Owner of (Triggering unit)) at Points[1] facing default building degrees
        • Hashtable - Save Handle of (Triggering unit) as 0 of (Key(Last created unit)) in Hashtable
        • Unit - Add 0.01 Generic expiration timer to (Last created unit)
      • Else - Actions
    • Custom script: call RemoveLocation (udg_Point)
    • Custom script: call DestroyGroup (udg_Temp_Group)
  • Trigger3
  • Events
    • Unit - A unit dies
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to dummy
  • Actions
    • Set Builder = (Load 0 of (Key(Triggering unit)) from Hashtable)
    • Unit - Order Builder to Stop
    • Custom script: call IssueImmediateOrderById (udg_Builder, 0xD0008)
    • Hashtable - Clear all child hashtables of (Key(Triggering unit)) in Hashtable
    • Game - Display to (Player Group(Owner of (Triggering unit))) the text: "An enemy's base is too near!"
For more about hashtables:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/
 
Status
Not open for further replies.
Top