[FilterScript] NPC Drivers - Citizen & Fully working Taxi script - (FS-Version)
#21

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
Reply
#22

Update 1.1

Added correct speed calculations for turning angles and steepness.
Reply
#23

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
Reply
#24

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
Reply
#25

So much effort..Well done.
Reply
#26

Is This Fs supported for the version of samp 0.3.7 r2-1?
Reply
#27

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.
Reply
#28

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]

pawn 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);
Reply
#29

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.
Reply
#30

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

pawn 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
Reply
#31

Yes exactly right now the motorbike drivers look kinda weird when they turn on an intersection ..they dont lean to the side if you know what i mean..thats the Y rotation i think..anyways..

If some math genius out here knows how to handle with quaternion calculations like that and if you have time and are willing to help in that part?
Then please hit me with a PM ( yes me so NaS can focus on other things concerning this script) .
Reply
#32

So that\'s the reason why your script acts a lot better on slopes. The only disadvantage is that it doesn\'t look as smooth when taking curves. I really like what you\'ve done here, the NPCs just can\'t be perfect yet. You should save Drivers[driverid][nCurNode] in a variable in the FCNPC_OnReachDestination callback, it would make the code look a lot better and it should be a tiny-tiny bit faster as you\'re using it many times.
Reply
#33

Quote:
Originally Posted by kvann
View Post
So that\'s the reason why your script acts a lot better on slopes. The only disadvantage is that it doesn\'t look as smooth when taking curves. I really like what you\'ve done here, the NPCs just can\'t be perfect yet. You should save Drivers[driverid][nCurNode] in a variable in the FCNPC_OnReachDestination callback, it would make the code look a lot better and it should be a tiny-tiny bit faster as you\'re using it many times.
True.. there is definitely a limit with the current version (with version i mean SAMP and its plugins).

But I get closer with every little thing I add, so let\'s see what\'s possible..


For the next version, ColAndreas will be needed for that.

This fixes many broken GPS nodes during route calculations and also 95% perfect rotations on the X axis. Even in tunnels or on more "detailed" surfaces.

And it\'s not any slower than MapAndreas.


For the CurNode variable, I will do it for the next version, also many other little improvements.
Reply
#34

Good job bro,
Reply
#35

How to fix FCNPC Exception Handler?
Reply
#36

Quote:
Originally Posted by alibassam
View Post
How to fix FCNPC Exception Handler?
Can you provide a little more info?

Are you using Linux and/or the newest server version?
Reply
#37

I can\'t load plugin FCNPC
Reply
#38

Good
Reply
#39

Quote:
Originally Posted by xXDuno2000ManXx
View Post
I can\'t load plugin FCNPC
There are some problems with the newest SAMP version which I cannot fix. I also encountered some problems with an old crashdetect version, if you use it you may want to update it.
Reply
#40

Good job!
Reply


Forum Jump:


Users browsing this thread: 19 Guest(s)