Thread: FollowPlayer
View Single Post
  #13  
Old 07-27-2001, 12:54 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
Followplayer won't work online, and I believe it might be taken out soon. It's nothing more than a seeking script though. If you can make 'heat-seeking' missiles (or arrows) in graal then you can make a followplayer script.

There's a few ways you can do it: one just moves x/y using a a set speed toward the correct position depending on if the x/y is greater or smaller than the current x/y. Another way is to use trig and find the exact angle to move at...though harder, it's usually more accurate and can have a nice effect. The third way is to just make an array of positions the object being followed has been in, and put the following object in those positions.

Bomies use the third method. It's pretty easy to pick out which method is being used. If you use arrays the path will go where you've been. If you use trig it will go straight toward where you are (see: boomerang). The first method will look kinda blocky...and either x or y will level out first and the NPC will walk in a straight line. You can usually tell how much effort is put into a following script by observing how it follows

There's a fourth method of course...a more advanced version of the trig one...that uses pathfinding to go around objects instead of going through them...but that's a hard one to get down...I've only seen a couple people come close to doing it effectively...
Reply With Quote