• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Teach me more How to make

Status
Not open for further replies.
Level 6
Joined
Mar 9, 2009
Messages
175
How to Make... A (10)unit Enter a region ..(some order to move left and some order to move right) Help me oh:grin::xxd:
 
Level 8
Joined
Aug 23, 2007
Messages
491
Ok...So let me see if I understood this properly. You want a trigger where a unit enters a region and then it moves left or right...?
 
  • Trigger
  • Events
    • Unit - A unit enters (Your Region <gen>)
  • Conditions
  • Actions
    • Set Point[1] = (Position of (Triggering unit))
    • Set Point[2] = (Point[1] offset by X towards (((Facing of (Triggering unit)) + 90)
    • Set Point[3] = (Point[1]) offsey by X towards (((Facing of (Triggering unit)) - 90)
    • Unit - Order (Triggering unit) to Move to Point[Random number between 2 and 3]
    • Custom script: call RemoveLocation (udg_Point[1])
    • Custom script: call RemoveLocation (udg_Point[2])
    • Custom script: call RemoveLocation (udg_Point[3])
This trigger will order your unit to move left OR right. You can see a placed "X" value. In its place, use a value to define how far from the current position you want your unit moved.

"Set Point[1]" is the Action "Set Variable". Create a new variable, by pressing that green "X" you will see in the window of the Set Variable and set the name of the variable to "Point". Tick the box below stating "Array". Set variable type to "Point".
Then, remove the leaks by the custom scripts i gave you.
For more info, http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/array-tutorial-17789/ (Arrays) and http://www.hiveworkshop.com/forums/triggers-and-scripts-269/things-that-leak-35124/ (Leaks).
 
Level 11
Joined
May 11, 2008
Messages
830
  • Trigger
  • Events
    • Unit - A unit enters (Your Region <gen>)
  • Conditions
  • Actions
    • Set Point[1] = (Position of (Triggering unit))
    • Set Point[2] = (Point[1] offset by X towards (((Facing of (Triggering unit)) + 90)
    • Set Point[3] = (Point[1]) offset by X towards (((Facing of (Triggering unit)) - 90)
    • Unit - Order (Triggering unit) to Move to Point[Random number between 2 and 3]
    • Custom script: call RemoveLocation (udg_Point[1])
    • Custom script: call RemoveLocation (udg_Point[2])
    • Custom script: call RemoveLocation (udg_Point[3])
This trigger will order your unit to move left OR right. You can see a placed "X" value. In its place, use a value to define how far from the current position you want your unit moved.

"Set Point[1]" is the Action "Set Variable". Create a new variable, by pressing that green "X" you will see in the window of the Set Variable and set the name of the variable to "Point". Tick the box below stating "Array". Set variable type to "Point".
Then, remove the leaks by the custom scripts i gave you.
For more info, http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/array-tutorial-17789/ (Arrays) and http://www.hiveworkshop.com/forums/triggers-and-scripts-269/things-that-leak-35124/ (Leaks).

Just helping him out those Set (things) = bla bla bla are called variables if you know what a variable in math is then there's isn't much to explain this one. The Variable type he used was a Point Variable with a Array of 1. So after you made the variable, just make a action called Set Variable and there you go.
 
Level 6
Joined
Mar 9, 2009
Messages
175
ops smthg i dunno how to do ...
Set Point[2] = (Point[1] offset by X towards (((Facing of (Triggering unit)) + 90)
Set Point[3] = (Point[1]) offset by X towards (((Facing of (Triggering unit)) - 90)
got abit i dunno how to create
 
Last edited:
Status
Not open for further replies.
Top