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.

Newcomers DBPro Corner / ai question

Author
Message
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 1st Sep 2004 13:38
ok this is a dumb one

i cant seem to get the computer controlled player to face my player...

it should be easy

heres the code im using

thanks for the help

Physics coder
20
Years of Service
User Offline
Joined: 25th May 2004
Location: United States
Posted: 1st Sep 2004 23:15 Edited at: 1st Sep 2004 23:18
you're using atan, thats for angles >0 and <90, try atanfull, where it returns an angle between 0 and 360 (or maybe it's -180 and 180, idk). The other thing that might be a problem is the third parameter of the curveangle is 1, that means it will turn directly to the target angle, if you want that then you could use the point object command and point the enemy at the target, otherwise make the third parameter something like 4 or 5.



i don't know if this way works, cuz i don't have the rest of the code, but it should work.

you have these in an array:

when you could use this, and make the code more simple:


-----------------------------------
To delete the bug, delete the code.
Specs: Sony VAIO Laptop, Windows XP, P4 2.8Ghz, 512MB RAM, ATI Radeon 64MB video memory, DBP Upgrade 5.3.
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 2nd Sep 2004 02:08
i save the locations to prevent the overhead of calling a function just to get the locations

it eliminates 3 function calls every time i need to find where the player is

i am using them at several different points in the code and it saves me about 5 fps during high processing events
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 2nd Sep 2004 05:46
sweet man that works... stupid me

ah well next time ill get it

thanks

Login to post a reply

Server time is: 2024-09-22 22:35:09
Your offset time is: 2024-09-22 22:35:09