Offset is being... odd.

Monsterous

In the Shadows, Lurking.
What i want is a unit to keep moving past the target point.
Now, the easiest way i can think of is using an Offset, which i've done. However, the moving unit always moves to the side of the point. However, if i remove the offset, the moving unit goes exactly to the point.
Its strange, because the offset is directed towards that point, so surely the unit would go past the point, as the offset is directed on the unit to the point?

Code:
Unit - Order (Last created unit) to ( Move targeting (ShipPoint offset by 50.0 towards (Point((X of ShipPoint), (Y of ShipPoint))))) (Replace Existing Orders)
I've tried the angle between the two points, and other methods. The unit simply just goes to the offset, disregarding the position of the ship, the angle between two points, or the degree it is moving.

Basically, can anyone give me another way as to how to make a unit target a point, and go past it in the direction its going? Offsets arent working here for unknown reasons to me. Or if anyone can tell me why my action is wrong.
 

Frozenwind

System maker
I'm sorry to disapoint you, but the offset behaves as I expect it to behave ;)


What goes wrong?
Basically, what you do is the following:

You order the unit to move to the point (allow me to call it X), with an offset of 50.0 towards the very same point X. However, how can a unit move to point X with an offset of 50.0 towards point X? To translate it:
Code:
Move unit to point X
Offset 50.0
Angle from point X to point X (will most-likely return 0 = east)
An angle between one point doesn't exist. An angle will always be determined by two different points, as it requires two dimensions (or more of course).
I hope the thing between code-tags will explain why it doesn't work.

(Small edit: Actually, it requires any amount of dimensions (in 1 dimension you simply only have 2 angles: left or right (0° and 1°? xD)), but it does require 2 or 3 points. 3 points would be a "math angle", with 2 lines drawn (AB and BC) giving the angle between those 2 lines. Whereas 2 points would be the angle from A to B - which is used in programming - which is now. Technically, this is the same as with 3 points, but one point is imaginary on the x-axis, having the same Y-coördinate as point A)


How to fix it?
I assume you want the ship to move straight over the point? Then I recommend you do this:
[not at home, so I typed it]
Code:
Unit - Order (Last created unit) to ( Move targeting (TargetPoint offset by 50.0 towards (Angle from (Position of (Last Created unit)) to (TargetPoint)))) (Replace Existing Orders)

The (Point(X,Y)) function
One more thing, rather off-topic:
Code:
Unit - Order (Last created unit) to ( Move targeting (ShipPoint offset by 50.0 towards ([COLOR="Green"]Point((X of ShipPoint), (Y of ShipPoint))[/COLOR]))) (Replace Existing Orders)
The green part equals the following:
Code:
(ShipPoint)
 

Monsterous

In the Shadows, Lurking.
Very informative.
However, if what you say is true, why wouldnt this work?
Code:
Unit - Order (Last created unit) to ( Move targeting ((Position of Your Ship) offset by 30.0 towards (Angle from (Position of (Last created unit)) to (Position of Your Ship)) degrees)) (Replace Existing Orders)
I tried this, this contains 2 different points, yet the unit goes to the offset, not in a line towards the ship and going past it.
Unless im reading it wrong, the unit should go to an offset of 30 at an angle of the direction of the unit to the ship, which would be its normal movement line, thus it should just move towards the point, and go on its offset.
 

Frozenwind

System maker
Few questions:
- Is the "last created unit" on top of the ship (cos then the 2 different points are the same)? --> this will break his "normal movement line" and force him to go to "0°" = east.
- When is the function called? Since if you call it before it passes the ship (makes him move over) and after he passes the ship (makes him move over again - which is backwards), he'll be stacked on top of the ship.
 

Monsterous

In the Shadows, Lurking.
Its a seperate unit firing at the ship, so the unit will move towards the ship.
The function is called instantly as the unit is made.
 

Frozenwind

System maker
Then it should work, unless:

- Your last created unit isn't created yet (impossible as there always is a last created unit - unless it's your first call - besides that, it responds)
- Is "Your Ship" declared?

If not.. Mind posting your trigger?
 

Monsterous

In the Shadows, Lurking.
Amazingly, it now works. I had to recreate it as i had deleted it previously, tested it, and amazingly, it now works even though i did the same thing as i always had.

I thank you for help, and holding my hand trying to find a way to fix my problem.
I've +rep you, and i'd +rep again for your tremendous amount of help, but unfortunately i cant yet :(
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    I really do not want to move to California otherwise I might consider it.
  • The Helper The Helper:
    yeah California is not anywhere you really want to live
  • The Helper The Helper:
    That is why I did not take the job Blizzard offered me back in the day, there is no way I could have moved my family there on what they were offering, not even close and that was like 20 years ago
  • The Helper The Helper:
    yeah they wanted me on the tech support team when they did not get me they got one of the next MVPs in Dinobot
  • The Helper The Helper:
    Dinobot was one of the youngest of the MVPs tkron probably could have worked for Blizzard but he had a good job in Chicago doing business programming already
  • The Helper The Helper:
    Dinobot probably still works for Blizzard would love to reconnect with that guy
  • The Helper The Helper:
    I wonder what ever happened to Wargasm?
  • The Helper The Helper:
    This new version of Xenforo really is awesome
  • Ghan Ghan:
    Wargasm is still around. He works for the domain registrar where thehelper.net is kept.
  • Varine Varine:
    Is sqrage still around?
  • The Helper The Helper:
    I have not seen him on lately the forum says he was last on 2 years ago
  • The Helper The Helper:
    How are you doing Varine have not seen you around in a minute
  • thewrongvine thewrongvine:
    lol I live in CA
  • thewrongvine thewrongvine:
    I've got some friends in animation department who have been applying for Blizzard, doing interviews and such. They said the workplace seems nice, though now it'd be all remote work I suppose
  • The Helper The Helper:
    good for them I live close to Austin and am trying to get my kids interested in getting into Games but not having much luck. I would never let them move to Cali.
  • The Helper The Helper:
    unless it was huge money
  • The Helper The Helper:
    and even then with the taxes I really could never let them move there
  • thewrongvine thewrongvine:
    Haha fair enough, I have no interest in CA at all as a living place either. Really only here just for the work in LA, but hopefully once I get settled enough in my work, I can move out
  • Ghan Ghan:
    +1
  • jonas jonas:
    " a traditionally-sized California family of one person ":cool:

    Members online

    No members online now.

    Affiliates

    Hive Workshop
    Top