• 🏆 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] GUI Custom Script + Issue unit an order?

Status
Not open for further replies.
Level 6
Joined
Jul 24, 2008
Messages
180
I've researched this thoroughly and I haven't found an answer. The WE allows specific pre-determined commands to be used, but I want commands based on a variable.


  • Follow
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
      • ((Triggering unit) is in Group_Follow) Equal to True
    • Actions
      • Set temploc1 = (Target point of issued order)
      • Unit Group - Pick every unit in Group_Follow and do (Actions)
        • Loop - Actions
          • Set temploc2 = (temploc1 offset by Follw_Distance towards ((Facing of (Picked unit)) - 90.00) degrees)
          • Unit - Order (Load 1 of (Key (Picked unit)) in Hashtable_Follow) to Attack-Move To temploc2
          • Custom script: call RemoveLocation(udg_temploc2)
          • Set temploc2 = (temploc1 offset by Follw_Distance towards ((Facing of (Picked unit)) + 90.00) degrees)
          • Unit - Order (Load 2 of (Key (Picked unit)) in Hashtable_Follow) to Attack-Move To temploc2
          • Custom script: call RemoveLocation(udg_temploc2)
          • Set temploc2 = (temploc1 offset by Follw_Distance towards ((Facing of (Picked unit)) + 180.00) degrees)
          • Unit - Order (Load 3 of (Key (Picked unit)) in Hashtable_Follow) to Attack-Move To temploc2
          • Custom script: call RemoveLocation(udg_temploc2)
          • Set temploc2 = (temploc1 offset by (Square root(((Power(Follw_Distance, 2.00)) + (Power(Follw_Distance, 2.00))))) towards ((Facing of (Picked unit)) - 135.00) degrees)
          • Unit - Order (Load 4 of (Key (Picked unit)) in Hashtable_Follow) to Attack-Move To temploc2
          • Custom script: call RemoveLocation(udg_temploc2)
          • Set temploc2 = (temploc1 offset by (Square root(((Power(Follw_Distance, 2.00)) + (Power(Follw_Distance, 2.00))))) towards ((Facing of (Picked unit)) + 135.00) degrees)
          • Unit - Order (Load 5 of (Key (Picked unit)) in Hashtable_Follow) to Attack-Move To temploc2
          • Custom script: call RemoveLocation(udg_temploc2)
      • Custom script: call RemoveLocation(udg_temploc1)
to Attack-Move To temploc2

The above needs to be a variable.

(I realize that not all commands use a location).
 
Level 6
Joined
Jul 24, 2008
Messages
180
  • Follow to Point
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • ((Triggering unit) is in Group_Follow) Equal to (==) True
    • Actions
      • Set follow_order = (Issued order)
      • Set temploc1 = (Target point of issued order)
      • Game - Display to (All players) the text: (String(follow_order))
      • Set tempunit = (Load 1 of (Key (Triggering unit)) in Hashtable_Follow)
      • Set temploc2 = (temploc1 offset by Follw_Distance towards ((Facing of (Triggering unit)) - 90.00) degrees)
      • Custom script: call IssuePointOrderLoc (udg_tempunit, I2S(udg_follow_order), udg_temploc2)
      • Custom script: call RemoveLocation(udg_temploc2)
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
      • Set tempunit = (Load 2 of (Key (Triggering unit)) in Hashtable_Follow)
      • Set temploc2 = (temploc1 offset by Follw_Distance towards ((Facing of (Triggering unit)) + 90.00) degrees)
      • Custom script: call IssuePointOrderLoc (udg_tempunit, I2S(udg_follow_order), udg_temploc2)
      • Custom script: call RemoveLocation(udg_temploc2)
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
      • Set tempunit = (Load 3 of (Key (Triggering unit)) in Hashtable_Follow)
      • Set temploc2 = (temploc1 offset by Follw_Distance towards ((Facing of (Triggering unit)) + 180.00) degrees)
      • Custom script: call IssuePointOrderLoc (udg_tempunit, I2S(udg_follow_order), udg_temploc2)
      • Custom script: call RemoveLocation(udg_temploc2)
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
      • Set tempunit = (Load 4 of (Key (Triggering unit)) in Hashtable_Follow)
      • Set temploc2 = (temploc1 offset by (Square root(((Power(Follw_Distance, 2.00)) + (Power(Follw_Distance, 2.00))))) towards ((Facing of (Triggering unit)) - 135.00) degrees)
      • Custom script: call IssuePointOrderLoc (udg_tempunit, I2S(udg_follow_order), udg_temploc2)
      • Custom script: call RemoveLocation(udg_temploc2)
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
      • Set tempunit = (Load 5 of (Key (Triggering unit)) in Hashtable_Follow)
      • Set temploc2 = (temploc1 offset by (Square root(((Power(Follw_Distance, 2.00)) + (Power(Follw_Distance, 2.00))))) towards ((Facing of (Picked unit)) + 135.00) degrees)
      • Custom script: call IssuePointOrderLoc (udg_tempunit, I2S(udg_follow_order), udg_temploc2)
      • Custom script: call RemoveLocation(udg_temploc2)
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
      • Custom script: call RemoveLocation(udg_temploc1)
  • Follow to None
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • ((Triggering unit) is in Group_Follow) Equal to (==) True
    • Actions
      • Set follow_order = (Issued order)
      • Game - Display to (All players) the text: (String(follow_order))
      • Set tempunit = (Load 1 of (Key (Triggering unit)) in Hashtable_Follow)
      • Custom script: call IssueImmediateOrder (udg_tempunit, (udg_tempunit, I2S(udg_follow_order))
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
      • Set tempunit = (Load 2 of (Key (Triggering unit)) in Hashtable_Follow)
      • Custom script: call IssueImmediateOrder (udg_tempunit, (udg_tempunit, I2S(udg_follow_order))
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
      • Set tempunit = (Load 3 of (Key (Triggering unit)) in Hashtable_Follow)
      • Custom script: call IssueImmediateOrder (udg_tempunit, (udg_tempunit, I2S(udg_follow_order))
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
      • Set tempunit = (Load 4 of (Key (Triggering unit)) in Hashtable_Follow)
      • Custom script: call IssueImmediateOrder (udg_tempunit, (udg_tempunit, I2S(udg_follow_order))
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
      • Set tempunit = (Load 5 of (Key (Triggering unit)) in Hashtable_Follow)
      • Custom script: call IssueImmediateOrder (udg_tempunit, (udg_tempunit, I2S(udg_follow_order))
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
  • Follow to Object
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Triggering unit) is in Group_Follow) Equal to (==) True
      • ((Target unit of issued order) belongs to an enemy of (Owner of (Triggering unit))) Equal to (==) True
    • Actions
      • Set follow_order = (Issued order)
      • Set temptarget = (Target unit of issued order)
      • Game - Display to (All players) the text: (String(follow_order))
      • Set tempunit = (Load 1 of (Key (Triggering unit)) in Hashtable_Follow)
      • Custom script: call IssueTargetOrder (udg_tempunit, (udg_tempunit, I2S(udg_follow_order), udg_temptarget)
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
      • Set tempunit = (Load 2 of (Key (Triggering unit)) in Hashtable_Follow)
      • Custom script: call IssueTargetOrder (udg_tempunit, (udg_tempunit, I2S(udg_follow_order), udg_temptarget)
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
      • Set tempunit = (Load 3 of (Key (Triggering unit)) in Hashtable_Follow)
      • Custom script: call IssueTargetOrder (udg_tempunit, (udg_tempunit, I2S(udg_follow_order), udg_temptarget)
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
      • Set tempunit = (Load 4 of (Key (Triggering unit)) in Hashtable_Follow)
      • Custom script: call IssueTargetOrder (udg_tempunit, (udg_tempunit, I2S(udg_follow_order), udg_temptarget)
      • Game - Display to (All players) the text: (String((Current order of tempunit)))
      • Set tempunit = (Load 5 of (Key (Triggering unit)) in Hashtable_Follow)
      • Custom script: call IssueTargetOrder (udg_tempunit, (udg_tempunit, I2S(udg_follow_order), udg_temptarget)
      • Game - Display to (All players) the text: (String((Current order of tempunit)))

Globals
temploc1 - point
temploc2 - point
tempunit - unit
temptarget - unit
follow_order - order
follw_distance - real
hashtable_follow - hashtable

-===-

This trigger should issue duplicate orders to 5 other 'party members' from a 'party leader'. In the editor, there are no problems, but once in-game the party members will do nothing. Help?
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
All natives are written in blizzard.j and common.j files in the war3patch.mpq. There are no descriptions for what they do. Also you could use this site, however it's a bit outdated(link). That's basically those two files with HTML wrapup.
Also, when you create a trigger, you can use "Convert to custom text" function, to see which functions the acions get converted to.
 
Status
Not open for further replies.
Top