• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[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).
 
  • 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?
 
Well, you can't do anything better, unless you want to use a custom script:
  • Custom script: call IssuePointOrderLoc (yourunit, "attack", udg_temploc2)
I still though don't get why do you need that.

how u know that ?
  • Custom script: call IssuePointOrderLoc (yourunit, "attack", udg_temploc2)
where can i found some custom scripts ? :grin:
 
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.
Back
Top