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

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