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.

Author
Message
Yamman
19
Years of Service
User Offline
Joined: 11th Jun 2005
Location:
Posted: 9th Mar 2006 12:55
hm having some trouble with a.i., at first i was just making an ivisible sphere around the enemy then when i touch that he comes closer, but ive got a feeling that thats cuasing some problems. im now trying to use the intersect command, but i have no idea how.
george_d
19
Years of Service
User Offline
Joined: 4th Mar 2005
Location:
Posted: 9th Mar 2006 14:23
I looked through your code briefly and you should note that when using intersect object() a value of 0 will be returned if the object is not intersected. When this is the case your program will interpret the 0 as within a distance of 3

You should change it to..

Yamman
19
Years of Service
User Offline
Joined: 11th Jun 2005
Location:
Posted: 9th Mar 2006 16:17
thanks, but it still wont do anything, the cube wont move
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 10th Mar 2006 00:51
I would suggest using vectors to find the distance between the player and enemy. I changed the code so that the enemy attacks when within a distance of 100, because 3 is a very small distance.



Insanity is just a state of mind
Yamman
19
Years of Service
User Offline
Joined: 11th Jun 2005
Location:
Posted: 11th Mar 2006 23:31
thanks, i dont rly understand vectors
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 12th Mar 2006 23:55
I used this site to learn vectors. It is long, I only read half.
[href]
http://www.kentaree-studios.com/tutorials/vectors/index.htm
[/href]

Insanity is just a state of mind

Login to post a reply

Server time is: 2024-09-24 19:29:11
Your offset time is: 2024-09-24 19:29:11