SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 02/09/2015, 08:22 PM   #21
JustinAn
Huge Clucker
 
JustinAn's Avatar
 
Join Date: Apr 2012
Location: stfu
Posts: 243
Reputation: 28
Default Re: AW: Re: NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)

Quote:
Originally Posted by NaS View Post
They are in plugins/plugin_includes
I'll move the folder in the next version.

yeah my mistake for not seeing that
__________________
JustinAn is offline   Reply With Quote
Old 03/09/2015, 01:29 AM   #22
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Posts: 1,399
Reputation: 438
Default AW: NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)

Update 1.1

Added correct speed calculations for turning angles and steepness.
NaS is online now   Reply With Quote
Old 03/09/2015, 01:50 AM   #23
nicolaskettler
Huge Clucker
 
nicolaskettler's Avatar
 
Join Date: May 2011
Posts: 348
Reputation: 8
Default Re : NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)

Nice, i made a taxi script too , before u release this one, using FCNPC & GamerZ gps plugin , but mine comes to u even if it's very far ^^ ; nice though, i guess this one is better than mine
nicolaskettler is offline   Reply With Quote
Old 03/09/2015, 02:13 AM   #24
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Posts: 1,399
Reputation: 438
Default AW: Re : NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)

Quote:
Originally Posted by nicolaskettler View Post
Nice, i made a taxi script too , before u release this one, using FCNPC & GamerZ gps plugin , but mine comes to u even if it's very far ^^ ; nice though, i guess this one is better than mine
This one is about 2 years old now
Well that's configurable, but I wanted some realism
NaS is online now   Reply With Quote
Old 03/09/2015, 02:22 AM   #25
trablon
Big Clucker
 
trablon's Avatar
 
Join Date: Jan 2010
Location: Turkish Republic
Posts: 111
Reputation: 10
Default Re: NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)

So much effort..Well done.
trablon is offline   Reply With Quote
Old 04/09/2015, 06:24 PM   #26
Jastak
Huge Clucker
 
Jastak's Avatar
 
Join Date: Jan 2015
Location: Esparta
Posts: 277
Reputation: 17
Default Re: NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)

Is This Fs supported for the version of samp 0.3.7 r2-1?
__________________
The Lag is real!
Jastak is offline   Reply With Quote
Old 04/09/2015, 06:27 PM   #27
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Posts: 1,399
Reputation: 438
Default AW: Re: NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)

Quote:
Originally Posted by Jastak View Post
Is This Fs supported for the version of samp 0.3.7 r2-1?
For me it works without any problems, but I also heared some people had problems with the newest version and FCNPC.
I don't know if this is only happening for Linux, I only tested Windows.
NaS is online now   Reply With Quote
Old 04/09/2015, 07:05 PM   #28
kvann
Banned
 
Join Date: Jun 2012
Location: Estonia
Posts: 365
Reputation: 70
Default Re: NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)

I'm a bit confused because of your FCNPC_OnReachDestination callback. Why is the code so complicated and what's the purpose of all this quaternion calculation? I created a similar system a while ago and the code was a lot shorter. I guess I'm not understanding some functionality and it's necessity in your script.

[ame]www.youtube.com/watch?v=b3i4jcEBcP0[/ame]

Code:
new Float:pos[3], Float:cpos[3], Float:speed, nodeid = TaksoNPC[i][tCurrentNode];
GetNodePos(TaksoNPC[i][tNode][nodeid], pos[0], pos[1], pos[2]);
GetNodePos(TaksoNPC[i][tNode][nodeid - 1], cpos[0], cpos[1], cpos[2]);
				
new Float:a = GetAngleBetweenPoints(cpos[0], cpos[1], pos[0], pos[1]) + 90.0;
pos[0] += (2.5 * floatsin(-a, degrees));
pos[1] += (2.5 * floatcos(-a, degrees));
				
if (GetDistanceBetweenPoints(pos[0], pos[1], pos[2], cpos[0], cpos[1], cpos[2]) < 6.0) speed = 1.0;
else speed = 2.0;
				
FCNPC_GoTo(npcid, pos[0], pos[1], pos[2], MOVE_TYPE_DRIVE, speed, true);
kvann is offline   Reply With Quote
Old 04/09/2015, 08:39 PM   #29
AIped
Gangsta
 
AIped's Avatar
 
Join Date: Feb 2011
Location: Netherlands
Posts: 781
Reputation: 46
Default Re: NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)

I dont know all the details but we used quaternion calculations to make the drivers drive their steep roads more perfect. In older versions the back of the car went stuck inside the road on steep hills if i remember correctly.
It all might seem to be far fetched but its all to make it look smoother.
__________________
Want some traffic?

http://forum.sa-mp.com/showthread.php?t=587634
AIped is offline   Reply With Quote
Old 04/09/2015, 10:43 PM   #30
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Posts: 1,399
Reputation: 438
Default AW: Re: NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)

Quote:
Originally Posted by kvann View Post
I'm a bit confused because of your FCNPC_OnReachDestination callback. Why is the code so complicated and what's the purpose of all this quaternion calculation? I created a similar system a while ago and the code was a lot shorter. I guess I'm not understanding some functionality and it's necessity in your script.

www.youtube.com/watch?v=b3i4jcEBcP0

Code:
new Float:pos[3], Float:cpos[3], Float:speed, nodeid = TaksoNPC[i][tCurrentNode];
GetNodePos(TaksoNPC[i][tNode][nodeid], pos[0], pos[1], pos[2]);
GetNodePos(TaksoNPC[i][tNode][nodeid - 1], cpos[0], cpos[1], cpos[2]);
				
new Float:a = GetAngleBetweenPoints(cpos[0], cpos[1], pos[0], pos[1]) + 90.0;
pos[0] += (2.5 * floatsin(-a, degrees));
pos[1] += (2.5 * floatcos(-a, degrees));
				
if (GetDistanceBetweenPoints(pos[0], pos[1], pos[2], cpos[0], cpos[1], cpos[2]) < 6.0) speed = 1.0;
else speed = 2.0;
				
FCNPC_GoTo(npcid, pos[0], pos[1], pos[2], MOVE_TYPE_DRIVE, speed, true);
Because the x/y rotation of the vehicle wont get updated to actually drive up/down.

Also random rotation bugs are appearing, look this:

http://s22.postimg.org/nn6jy04sx/adss_jpg_000009.jpg (The vehicles seen here are still normally moving along the road, turned by ~30)
http://s22.postimg.org/a4znlpsnl/adss_jpg_000159.jpg (X rotation isn't set)

But that's only a small part, the speed calculation takes a bit more room, but isn't really much code.
In the new version, to save resources, these calculations wont be done when nobody is around.

In the future I also want to calculate the Y rotation too (to the sides).

PS the code you posted looks exactly like the one in my first version
NaS is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] tAxI's XVM System (menu version) (Xtreme Vehicle Management) CJay9209 Filterscripts 2 05/08/2017 03:18 PM
command not working fully please help +rep given Crossfire1989 Scripting Help 0 22/01/2013 12:40 AM
Hamachi not fully working Torran Everything and Nothing 5 04/04/2010 10:50 PM
[Help] Not fully working trunk system Diablo1st Help Archive 1 04/06/2009 09:37 PM


All times are GMT. The time now is 05:16 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.