Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / Dark Physics: AI Move Towards Player

Author
Message
Dark Fire
16
Years of Service
User Offline
Joined: 23rd Jun 2008
Location: In the code you write
Posted: 10th Mar 2009 20:16 Edited at: 10th Mar 2009 20:23
I am using dynamic spheres and moving an AI player towards another player.

I am trying to figure out Angle# in this code snippet:


I tried to have a temp object that is pointed at the Object and getting the Y angle, but it doesn't work.



I even tried adding:

which doesn't make any difference.

I have also tried orbiting the temp object around the AI Player Object and using Intersect Object to get the angle, but it is to slow.

Question:
How can I get the Y angle between two object that would cause object one to go towards the other player? ...

using this code snippet:



I want to use math as much as possible instead of using "Point Object" or "Intersect Object".

I tried some code on the forums and couldn't get it to work. A code snippet would really help!

Note:

Tried code from this threads:
http://forum.thegamecreators.com/?m=forum_view&t=96978&b=8

Tried this code snippet: Doesn't Work because it isn't the y angle.


Thanks,

Dark Fire

My future self met up with one day to teach me what I know today.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 10th Mar 2009 20:31 Edited at: 10th Mar 2009 20:32
have a look these commands see if that helps.



and



Dark Physics makes any hot drink go cold.
Dark Fire
16
Years of Service
User Offline
Joined: 23rd Jun 2008
Location: In the code you write
Posted: 10th Mar 2009 20:38 Edited at: 10th Mar 2009 20:40
@HowDo - Could you explain how I might use these commands? (Dark Physics doesn't explain their commands very well)

Thanks,

Dark Fire

My future self met up with one day to teach me what I know today.
Dark Fire
16
Years of Service
User Offline
Joined: 23rd Jun 2008
Location: In the code you write
Posted: 11th Mar 2009 03:36
@HowDo - Just figured it out. Took me a couple of days to figure out.

What I did:

Using this code:


I had to figure the angle to make the object move towards a point.

To do this you use a temp object, position it at the AI object, and point it at the X#,Y#,Z# point you want the AI player to move to.

Then Angle# = Object Angle Y(TempObject).

This is a way to make ball rolling AI that moves to a point.

Thanks for the help anyways!

Dark Fire

My future self met up with one day to teach me what I know today.

Login to post a reply

Server time is: 2024-11-24 19:36:22
Your offset time is: 2024-11-24 19:36:22