Jump to content
Sign in to follow this  
mr_centipede

Need help with some Math Problems on my Assault Script

Recommended Posts

Hello all, got stuck on some math problem here...

Here's the situation.

I have an AI squad at [x0,y0] and the objective is at [x1,y1]. The angle between the assault team and the objective is at _angle degrees. I want to "addWaypoint" or "Move" for assault team toward the objective at a 50m interval (probably will actually make them assault in straight line instead of they make their own route).

So, how can I get the subsequent [x,y] in a 50m interval?

Share this post


Link to post
Share on other sites

waypoints are never exact, trying to be exact with AI is ulcer inducing. That said, you can use things like the function BIS_fnc_dirTo to get the direction from one object to another then something like math or modeltoworld maybe to find a spot 50m ahead. Or limit waypoints and enjoy the game more. :)

Share this post


Link to post
Share on other sites

I already got the _angle using BIS_fnc_dirTo, next is trying to get the 50m intervals... Right now lets just say I'm enjoying the scripting side of the game :)

Share this post


Link to post
Share on other sites

Use BIS_fnc_relPos to return a a location from the AI unit in the direction of its target x metres away.

Just watch BIS_fnc_dirTo it sometime returns a negative bearing in which case adding 360 to result will fixed it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×