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 Discussion / how can I create this AI effect?

Author
Message
thinkdigital
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 30th Mar 2004 05:05
I'm making a game where two tanks have a stand-off in an arena. The player is object #9, and the enemy is object #13.

Is there a way I can simply have object 13 face the player? I don't mean set the object orientation or anything. I just want object 13 to face the player object (#9), no matter which way the player is actually facing. Static line of sight won't work; I'm not using static collision boxes. How can it be done?

2.3 Gigs. 1993 MHz. 256 MB Ram. Home Sweet Home.
http://www.egenericworks.com
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 30th Mar 2004 07:17
Do a little research and search the various threads in this forum. The question has been asked before and several solutions are available.
--
TAZ

The admiral
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location:
Posted: 30th Mar 2004 09:10
point object command

[href]www.vapourhost.com/~flyer[/href]
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 30th Mar 2004 16:47
Use the point object command, just like Admiral said. But you should use this:

Point object 13, object position x(9),object position y(13),object position z(9)

if you use that one, the tank will not "x" rotate and will stay on the ground.

Quote: "
UPDATED

Amd 2800+ 1024mb pc3200 A7N8X - Deluxe Ati Radeon 9800PRO 256mb
"
Cyberflame
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: Im not sure....
Posted: 30th Mar 2004 17:16
@Emperor Baal
Why, does that work?

DANGIT NEO, YOU CHANGED THE CODE AND NOW THE MATRIX WONT TEXTURE RIGHT.
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 30th Mar 2004 18:13
It works because you tell object 13 to look at object 9, but look at the same level as object 13. That way object 13 does not pitch or roll to look at object 9's elevation. It just looks in object 9's direction (sans elevation.)
--
TAZ

thinkdigital
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 30th Mar 2004 23:52
Thanks guys (must have overlooked that one...) That's just what I needed to know

2.3 Gigs. 1993 MHz. 256 MB Ram. Home Sweet Home.
http://www.egenericworks.com
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st Mar 2004 12:48
atanfull(), check it out.

"eureka" - Archimedes
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 31st Mar 2004 18:41
Aye, knowing the math is good. I'm something of a math phobe (either that or my brain is wired for geometry and not trig/calculus), go figure as to why I'm a professional programmer.

Anyway, having the math functions is useless unless you know how to apply them. Care to provide some example code perhaps with some comments as to why the functions are used the way they are?
--
TAZ

thinkdigital
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 1st Apr 2004 06:37 Edited at: 3rd Apr 2004 03:13
P.S. - I finished the game:

http://darkbasic.thegamecreators.com/?m=forum_view&t=28957&b=5



2.3 Gigs. 1993 MHz. 256 MB Ram. Home Sweet Home.
http://www.egenericworks.com
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 1st Apr 2004 17:35
Congrats.

Login to post a reply

Server time is: 2025-05-23 04:17:54
Your offset time is: 2025-05-23 04:17:54