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.

DarkBASIC Professional Discussion / Wrapvalue and/or Atanfull problem.

Author
Message
Dante Labon
23
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 3rd Dec 2003 14:52
Does anybody know how to code around the 360 -> 0 or 0 -> 360 problem? My enemy will follow me until I (or he) rotates past 360 degrees (or from 360 to 0 degrees), then he turns around the other way. Any help would be GREAT!
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 3rd Dec 2003 15:01 Edited at: 3rd Dec 2003 15:02



God created the world in 7 days, but we're still waiting for the patch.
Dante Labon
23
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 3rd Dec 2003 15:30
Thanks man, Ironically I have been looking for your code all over the forums. Would you by chance have a working example of the code?
My game has gotten to be so complex, that I don't know how to hook this code up. Thanks again.
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 3rd Dec 2003 15:46



God created the world in 7 days, but we're still waiting for the patch.
Dante Labon
23
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 3rd Dec 2003 17:09
Sorry to sound like such a noob, but I'm having trouble figuring these out. Is there any way you could comment these? I promise I won't bug you any more. Thanks.

targetBearing#=whereIsHe(aiObject,targetObject(aiObject))
turn#=whichWay(object angle y(aiObject),targetBearing#)
whichWay(facing#,targetBearing#)
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 3rd Dec 2003 18:52
not sure if anyone cares but the dbp WrapValue() function blows up and returns zero if you pass in values above 35999. IanM wrote a function that replaces the dbp function, or you can justwrite one yourself - this is a known bug however. I posted it below just for reference:



-RUST-
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 4th Dec 2003 03:10
Sorry I could not comment earlier as I was getting ready for work so I was brief.




God created the world in 7 days, but we're still waiting for the patch.
Dante Labon
23
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 4th Dec 2003 14:10
Thanks much man. Worked like a charm. It's amazing how complicated my code can get when I try to perform AI with as little math as possible That code you posted is a keeper! Thanks again.

Login to post a reply

Server time is: 2026-07-26 20:16:54
Your offset time is: 2026-07-26 20:16:54