Getting a NPC to follow me -
miokie - 08.11.2009
After seeing Mo3's Intelligent NPCs and studying his scripts, it gave me a idea on how to make a NPC to follow me...
The problem is, The Animation of the Walk Walks a few steps forward then resets itself back to the base x,y,z where the NPC spawns..
Here is my script:
pawn Код:
public OnPlayerText(playerid, text[])
{
new JackID = GetPlayerID("Jack");
new Float:x,Float:y,Float:z;
GetPlayerPos(JackID,x,y,z);
if(IsPlayerFacingPlayer(playerid,JackID,10.0))
{
if(strfind(text, "Follow me") != -1 && IsPlayerInRangeOfPoint(playerid,5.0,x,y,z))
{
SetPlayerChatBubble(JackID,"Ok!",white, 100.0, 5000);
SetTimerEx("GetJackToFolow",100,1,"i",playerid);
ApplyAnimation(JackID,"PED","WALK_PLAYER",4.1,1,1,1,1,0);
return 1;
}
}
return 1;
}
And the timer:
pawn Код:
forward GetJackToFolow(playerid);
public GetJackToFolow(playerid)
{
new JackID = GetPlayerID("Jack");
SetPlayerFacingPlayer(JackID, playerid);
}
I've never done anything that uses animations...
Any ideas on what is causing the animation to keep repeating other than keep on going?
Re: Getting a NPC to follow me -
shady91 - 08.11.2009
yea the 100 timer make it somthing like 5000 and set the animation timer to 5000 per animation.
Re: Getting a NPC to follow me -
miokie - 08.11.2009
Still does the same thing
Re: Getting a NPC to follow me -
shady91 - 08.11.2009
Quote:
|
Originally Posted by Miokie*
Still does the same thing 
|
its probably your record file is just replaying.
Re: Getting a NPC to follow me -
miokie - 08.11.2009
Ahh Good thinking!
I'm going to record it to make it much longer and see if it works any better.
Still The Same Problem...
Re: Getting a NPC to follow me -
shady91 - 08.11.2009
Quote:
|
Originally Posted by Miokie*
Ahh Good thinking!
I'm going to record it to make it much longer and see if it works any better.
Still The Same Problem... 
|
yea i'm testing it and i'm getting the same problem i will post as soon as i fix it.
Re: Getting a NPC to follow me -
miokie - 08.11.2009
Quote:
|
Originally Posted by Shady91
Quote:
|
Originally Posted by Miokie*
Ahh Good thinking!
I'm going to record it to make it much longer and see if it works any better.
Still The Same Problem... 
|
yea i'm testing it and i'm getting the same problem i will post as soon as i fix it.
|
Ok Cool, I'm going to bed now, It's almost 1am and I have school in the morning, Ill look up this topic in the morning.
Thanks for helping me out.
Re: Getting a NPC to follow me -
Daren_Jacobson - 08.11.2009
try putting param 6 and 7 to 0, not sure though.
Re: Getting a NPC to follow me -
shady91 - 09.11.2009
i can make it follow but not by using the animation everytime he walks he just goes back again but i have another way it don't look to good tho.
Re: Getting a NPC to follow me -
miokie - 09.11.2009
Quote:
|
Originally Posted by Shady91
i can make it follow but not by using the animation everytime he walks he just goes back again but i have another way it don't look to good tho.
|
What is this other way? Maybe I can build on the idea...