![]() |
FollowPlayer
How do you stop the command Followplayer? No one seems to know LOL
|
LOL!
|
READ COMMANDS.RTF FOR ONCE!
It says something like: followplayer makes the npc follow player untill an x,y is specified. |
(Shaun)
<Shaun>
until the npc is thrown </Shaun> |
set it's x and y coordinates
|
Alright, well how would I detect what x any y it is at now and then make it so it stays there and changes back to the idle.gif?? Here is what i tried:
if(created){ setimg zen1kuros1.gif; //the idle gif } if(playerchats&&strequals(#c,come)){ followplayer; set following; } while (following) { if(playerdir==0){ setimg zen1kuros6.gif; } if(playerdir==1){ setimg zen1kuros7.gif; } if(playerdir==2){ setimg zen1kuros5.gif; } if(playerdir==3){ setimg zen1kuros8.gif; } if (playersays(stop)) { this.x=x; this.y=y; setimg zen1kuros1.gif,x,y; } sleep 0.05; } How can I change this so that It knows its X and Y and stays there which would cause it to change back to the idle image and to stop following player?? |
Okay, first I believe that followplayer only works offline...
x=x; y=y; May work... That or x+=0.05 or something like that. |
what!?!?! Followplayer only works offline? :(
Would it be hard to script it so that a NPC follows and does all the stuff in the script about accept it looks like followplayer accept scripted?? |
BTW, Thanks Cyanide
|
*cough* bomy pets follow player and are online *cough*
But thats coded out, it isn't just "followplayer" I have made scripted following npcs before.. I could give it a try and make an example if you want me to. |
Konidias he means the actual command follow player cannot be used online.Bomy pet's use wa more complicated then followplayer -_-
|
Merlin:
what if you do like while (flag) {followplayer;} while (!flag) { } |
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... |
Quote:
|
I believe there is a npc tutorial on the G2k1 site about making baddies. They have a few player following scripts.
|
Quote:
|
Holy crap!
I understand what Kyle is talking about... That's scary. |
Not really cuz ur a good scripter too
|
there's also the move-method...I think you could do it using the move command...I dunno, that might be worse than doing some of the others though...
|
Quote:
Oh and probably move playerx,playery,time,type; would work, it's just that the NPC would ignore walls :rolleyes: |
| All times are GMT +2. The time now is 06:42 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.