How to turn and face direction to next waypoint
How to turn and face direction to next waypoint
Hi there,
how can i get my char to turn direction to the naxt WP?
When reaching one waypoint, I want to change char direction and camera view to the next waypoint, without movint to the next WP.
Thanx
Ric
how can i get my char to turn direction to the naxt WP?
When reaching one waypoint, I want to change char direction and camera view to the next waypoint, without movint to the next WP.
Thanx
Ric
Re: How to turn and face direction to next waypoint
Code: Select all
player:aimAt(__WPL:getNextWaypoint())
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
-
- Posts: 35
- Joined: Sat Feb 04, 2012 6:53 am
Re: How to turn and face direction to next waypoint
Call this function:
Code: Select all
function lookatTarget(X,Z,Y)
local angle = math.atan2(Z - player.Z, X - player.X);
local yangle = math.atan2(Y - player.Y, ((X - player.X)^2 + (Z - player.Z)^2)^.5 );
player:faceDirection(angle, yangle);
camera:setRotation(angle);
end
Re: How to turn and face direction to next waypoint
Ah yes, my command only turns the camera
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: How to turn and face direction to next waypoint
thanx!
i call the function this way
and it works fine
btw, how can i get accass to the actual WP info? i could not find this info in the wiki - Waypoint File Functions
i would like to get the actual WP index. i am using this as a workaround
but i would also like to get access to the rest of the actual wp´s table.
i call the function this way
Code: Select all
lookatTarget(__WPL:getNextWaypoint().X,__WPL:getNextWaypoint().Z,__WPL:getNextWaypoint().Y)
btw, how can i get accass to the actual WP info? i could not find this info in the wiki - Waypoint File Functions
i would like to get the actual WP index. i am using this as a workaround
Code: Select all
wp_index = __WPL:getNextWaypoint().wpnum - 1
Re: How to turn and face direction to next waypoint
you mean this?
basically use __WPL instead of self for this stuff
Code: Select all
__WPL.CurrentWaypoint
Code: Select all
self.Waypoints = {};
self.CurrentWaypoint = 1;
self.LastWaypoint = 1;
self.Direction = WPT_FORWARD;
self.OrigX = player.X;
self.OrigZ = player.Z;
self.Radius = 500;
self.FileName = nil;
self.Mode = "waypoints";
self.KillZone = {};
self.ExcludeZones = {}
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: How to turn and face direction to next waypoint
All the waypoints are stored in a table in __WPL.Waypoints. __WPL:getNextWaypoint() returns the 'currentwaypoint' which is one of those waypoints. When moving between waypoints the 'currentwaypoint' is the one you are heading towards. When you reach a waypoint and it is executing the code there, the 'currentwaypoint' is the next waypoint. If you want information about the waypoint you are at you can get it like this
thiswp will include X, Z, Y, Action, Type, Tag and wpnum (wpnum is not normally part of the __WPL table but is added in that function). You can also get the wp number you are at with __WPL.CurrentWaypoint-1.
Hope that wasn't too confusing.
Code: Select all
thiswp = __WPL:getNextWaypoint(-1)
Hope that wasn't too confusing.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: How to turn and face direction to next waypoint
nope, not confusing. that was exactly what i needed! thank you all!
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests