Toolset Vectors not plotting properly.
HydroMerano
Member Posts: 2
A friend of mine is having an issue that I'm really hoping one of you fine folk can help him fix.
He's using transformobject to simulate a jump between two objects, what should be a simple (x,y)-(x2,y2) multiplies into a number of problems with facing. He's slammed his head against it for days with the best result giving him 2/4 directions working and the other 2 sending you off into oblivion.
When it works, the object moves to the other object. Other times it veers off in the wrong direction. Could be he's making a simple mistake that he's gone blind to considering the time he's spent trying to make this work.
He's trying for a more dynamic range, using it for abilities and spells as well as standard jump triggers
He set up a function to get the change in X and Y with
vector vOrigin = GetPositionFromLocation(lOrigin);
vector vTarget = GetPositionFromLocation(lTarget);
float fY;
fY = vOrigin.y-vTarget.y;
Theres a duplicate function for x with appropriate changes.
(I'm asking for him, because he's being too prideful, and he figures that if I ask, its not HIM asking for help. I have direct contact with him, and I can ask him anything that might be needed, because he is aware I a asking for him.)
He's using transformobject to simulate a jump between two objects, what should be a simple (x,y)-(x2,y2) multiplies into a number of problems with facing. He's slammed his head against it for days with the best result giving him 2/4 directions working and the other 2 sending you off into oblivion.
When it works, the object moves to the other object. Other times it veers off in the wrong direction. Could be he's making a simple mistake that he's gone blind to considering the time he's spent trying to make this work.
He's trying for a more dynamic range, using it for abilities and spells as well as standard jump triggers
He set up a function to get the change in X and Y with
vector vOrigin = GetPositionFromLocation(lOrigin);
vector vTarget = GetPositionFromLocation(lTarget);
float fY;
fY = vOrigin.y-vTarget.y;
Theres a duplicate function for x with appropriate changes.
(I'm asking for him, because he's being too prideful, and he figures that if I ask, its not HIM asking for help. I have direct contact with him, and I can ask him anything that might be needed, because he is aware I a asking for him.)
0
Comments
Will only give the y distance between the two points and depending on the two y's could be a negative number. Can you post the whole function(s) in question please so we can see what is going on.
Why not use - instead?
TR
When using a timed series of visual transformations to create the illusion of motion, those actions come last.
Vector math in NWScript generally works fine, though IIRC the axis labels for the visual transformation function are confusing.