Gonna need a little more details, do you want to spawn, and then move units, or are you trying to give orders to an existing unit? In a trigger these events (after spawning units) would cause them to move to point A, move to point B and then patrol between points B and C.
Unit - Order all units in (Last created units) to ( Move targeting relative points near POINT A) (Replace Existing Orders)
Unit - Order all units in (Last created units) to ( Move targeting relative points near POINT B) (After Existing Orders)
Unit - Order all units in (Last created units) to ( Patrol targeting relative points near POINT C) (After Existing Orders)
Edit: note that these orders target a spot NEAR a point, good for moving groups, but not so good for moving one unit, if you want them to move to a very specific spot.
Still not entirely sure what you want to do here, but this should get your unit moving at least. On map initialization the unit will patrol from it's start position to a point you've created, back and forth. If you want him to move instead of patrol, substitute that command, chain others together and create additional points to have it move in more complex patterns. Game initialization isn't repeatable, so if you want this to happen more than once build in another event as well. If you want to adjust the unit's height (Z) that's a little more complex, but you can do it by using the "Change Unit Height to X over X seconds" action.
Events
Game - Map initialization
Local Variables
Conditions
Actions
Unit - Order UNIT NAME [0,0,0] to (Patrol targeting Target Point) (Replace Existing Orders)
@Batomys: Go Sorry, not even close to what I'm asking.
I'm moving my units using triggers from a vector XYZ to another vector XYZ. I have the units movement speed, the camera yaw (angle used for XY movement), and the cameras pitch (angle for Z offset). I don't know or understand how to compute using Cos() and Sine() to get from point xyz to xyz.
So, you want the unit to move in the direction your camera is facing, using the unit's speed as the distance? It's hard to understand what you mean. I'm assuming you have it set to third person camera.
Anyway, for the trig it's something like this:
X = cosine (yaw) * cosine (pitch)
Y = sine (yaw) * cosine (pitch)
Z = sine (pitch)
Although my pitch might be mixed up where you have to swap its sine with cosine and vice versa.
So, you want the unit to move in the direction your camera is facing, using the unit's speed as the distance? It's hard to understand what you mean. I'm assuming you have it set to third person camera.
Anyway, for the trig it's something like this:
X = cosine (yaw) * cosine (pitch)
Y = sine (yaw) * cosine (pitch)
Z = sine (pitch)
Although my pitch might be mixed up where you have to swap its sine with cosine and vice versa.
How do I add/apply the units movement speed (lets just say it has a movement of 10 in any direction)
Edit:
Been looking around. I think I just add "times 10" to the end of each XYZ.
Another question, how do I have a starting vector (XYZ) and get to a second vector (XYZ). Example, x0y0z0 (vector formula and movement speed of 10) = x3y3z4.
Well it depends how you want to implement it. With physics and momentum? You'd need to apply a force and have it update momentum periodically.
Without that, you could just use Move Unit Instantly with Blend enabled. Move it to a Point With Offset.
Offset X = X of Point (Position of Unit) + Speed * cosine (yaw) * cosine (pitch)
Offset Y = Y of Point (Position of Unit) + Speed * sine (yaw) * cosine (pitch)
Then, make another action Set Unit Property. Set the unit's Height property to:
Height = Unit Property (Unit's current Height) + Speed * sine (pitch)
For the second question do you mean the vector as in a point or location? You can get the vector between two points by subtracting their X, Y and Z components.
If you had a unit with a movement speed of 10 you wanted to move along a xyz how would you do it?
@zandose: Go
Gonna need a little more details, do you want to spawn, and then move units, or are you trying to give orders to an existing unit? In a trigger these events (after spawning units) would cause them to move to point A, move to point B and then patrol between points B and C.
Unit - Order all units in (Last created units) to ( Move targeting relative points near POINT A) (Replace Existing Orders) Unit - Order all units in (Last created units) to ( Move targeting relative points near POINT B) (After Existing Orders) Unit - Order all units in (Last created units) to ( Patrol targeting relative points near POINT C) (After Existing Orders)
Edit: note that these orders target a spot NEAR a point, good for moving groups, but not so good for moving one unit, if you want them to move to a very specific spot.
@Batomys: Go
My unit is already created at the center of the map (x32y32) and it has no orders.
I forgot to include I'm using the cameras pitch for z offset and cameras yaw for x/y movement.
@zandose: Go
Still not entirely sure what you want to do here, but this should get your unit moving at least. On map initialization the unit will patrol from it's start position to a point you've created, back and forth. If you want him to move instead of patrol, substitute that command, chain others together and create additional points to have it move in more complex patterns. Game initialization isn't repeatable, so if you want this to happen more than once build in another event as well. If you want to adjust the unit's height (Z) that's a little more complex, but you can do it by using the "Change Unit Height to X over X seconds" action.
Events Game - Map initialization
Local Variables
Conditions
Actions
Unit - Order UNIT NAME [0,0,0] to (Patrol targeting Target Point) (Replace Existing Orders)
@Batomys: Go Sorry, not even close to what I'm asking.
I'm moving my units using triggers from a vector XYZ to another vector XYZ. I have the units movement speed, the camera yaw (angle used for XY movement), and the cameras pitch (angle for Z offset). I don't know or understand how to compute using Cos() and Sine() to get from point xyz to xyz.
So, you want the unit to move in the direction your camera is facing, using the unit's speed as the distance? It's hard to understand what you mean. I'm assuming you have it set to third person camera.
Anyway, for the trig it's something like this:
X = cosine (yaw) * cosine (pitch)
Y = sine (yaw) * cosine (pitch)
Z = sine (pitch)
Although my pitch might be mixed up where you have to swap its sine with cosine and vice versa.
How do I add/apply the units movement speed (lets just say it has a movement of 10 in any direction)
Edit: Been looking around. I think I just add "times 10" to the end of each XYZ. Another question, how do I have a starting vector (XYZ) and get to a second vector (XYZ). Example, x0y0z0 (vector formula and movement speed of 10) = x3y3z4.
Well it depends how you want to implement it. With physics and momentum? You'd need to apply a force and have it update momentum periodically.
Without that, you could just use Move Unit Instantly with Blend enabled. Move it to a Point With Offset.
Offset X = X of Point (Position of Unit) + Speed * cosine (yaw) * cosine (pitch)
Offset Y = Y of Point (Position of Unit) + Speed * sine (yaw) * cosine (pitch)
Then, make another action Set Unit Property. Set the unit's Height property to:
Height = Unit Property (Unit's current Height) + Speed * sine (pitch)
For the second question do you mean the vector as in a point or location? You can get the vector between two points by subtracting their X, Y and Z components.
Hello again, is this right because I cannot get it to work correctly.
Also, does the formula take into account negative angles? And, does the game do math properly, ex BEDMAS.