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

NPC Drivers (FS Version) v1.2.5 by AIped & NaS


> About

NPC Drivers are NPCs (created with FCNPC), which are driving around San Andreas like the ones you see in Singleplayer.

> Citizen

The crazy citizen just drive around, ignoring everything and everyone trying to stop them. Seriously.

> Taxis

Among the crazy citizen, there are also actual taxis driving around.
If you call one (using /Taxi), a taxi near your position will respond and pick you up.
But if there are no taxis around, you will have to wait.

> Notes

The NPCs still look quite laggy, and there are issues with their movement when they drive up/down steep roads or such.
This cannot be fixed (at least I tested everything I could imagine), it may be a FCNPC or SA-MP bug.

After the start the script needs to calculate new paths for all NPCs, which can take some time. You'll get notified as soon as it has finished.

If you find bugs that I can fix, please post them here. Also every suggestion is welcome!

You may also want to use the JIT Compiler if possible, it reduces the average path calculation time by about 7-10 times, however this may vary for different PCs and settings.

Also note that reloading the FS may lead to a crash, GMX is working well.

> Commands

/Taxi - Calls a taxi

Admin:

/ds [id] - Puts you in the car of a Driver
/DInfo - Prints debug info (containing general info and some data about performance) to the console/server log

> Download

Filterscript + Fixed GPS.dat (GitHub): Click!

Make sure to download the GPS.dat too, this Script uses the Parking Lots added in my version. If you do not do this, the FS may not start properly.

> Install

Click on the above link to GitHub and download the contents as ZIP.
Then open the archive and copy the filterscripts and scriptfiles folders into your SA-MP Server directory, after that compile driverfs.pwn.

Also make sure to download the newest versions of the plugins required (see below).

It's important that your maxnpc is adjusted to at least the total amount of Drivers and other NPCs on your server!

> Dependencies

You will need to download the following plugins:

- Fully Controllable NPC Plugin (2.0.0 RC1-7)
- Modern GPS Plugin (Click)
- Rotations.inc by Nero_3D (v1.2.0) (Click)
- ColAndreas Plugin (Click)

> Changelog

Version 1.2.5
  • Switched to kvann's Modern GPS Plugin
Version 1.2.4
  • Works with FCNPC 1.7.*
  • NPCs can now drive bikes (and also lean left/right in turns) - needs some more work though
  • NPCs rotate on all axes now, depending on terrain.
  • Taxi call will now be correctly aborted if the called Taxi gets killed by someone
  • Adjusted path smoothing to be more lightweight. Needs some more tweaking as well.
Version 1.2.3
  • Removed dependancy on QuaternionStuff Plugin
  • Now uses Nero_3D's Rotations.inc (see Dependancies)
  • Fixed infinite loop when using /ds
  • Now using ZCMD for commands
  • Works with latest FCNPC Version
Version 1.2.2
  • Some small optimizations and bug fixes
Version 1.2.1
  • Added support for FCNPC 1.0.4
  • Added Cops (count as civilains) - They turn on the sirens sometimes to annoy their surroundings
  • Added Skin Arrays for different types (Civ, Cops, Taxis)
  • There is a very rough time measurement now when you choose your destination
  • Fixed stop'n'go (Using proper math instead of buggy distance checks)
Version 1.2
  • General performance improvements
  • Using ColAndreas for more precise rotations - If you need it to be MapAndreas, PM me for a MapAndreas version
  • Using Streamer for its simple and effective Area functions
  • Manually fixed hundreds of nodes
  • Reduction of path lengths (Node distance are now dynamic)
  • Streaming NPC-Movements (NPCs without players around will only calculate very rough movements)
  • NPCs brake when another NPC is in front of them (not yet perfect)
Version 1.1
  • Improved Start- and Endnode calculation
  • Shortened paths on recalculations (Improves performance)
  • Improved speed calculations, speed changes over time (based on steepness/turning angle)
  • Reworked some values (smoothing, paths, ...)
> Credits

AIped - Help, Support, Ideas, Scripting, ...
Gamer_Z - Testing, RouteConnector Plugin, QuaternionStuff Plugin and great help with some math-problems.
OrMisicL & ZiGGi - FCNPC Plugin
DeathonaStick - Help with quaternions, testing
Pottus, Slice, Chris42O, uint32 - Greatest plugin of all times - ColAndreas
kvann - Modern GPS Plugin
SA-MP Team - SA-MP
Reply
#2

Saw your video, good job mate.
Reply
#3

Good work.
Create an extended video. It will be interesting to look at moving in city traffic
Reply
#4

Yea i think its good finaly seeing this released. Looking forward to see other scripters make some good use of this.

Edit: by the way did our include and FCNPC still work well with sa-mp 0.3.7-R2 ?
Reply
#5

Quote:
Originally Posted by Sellize
View Post
Saw your video, good job mate.
Thanks!

Quote:
Originally Posted by Logofero
View Post
Good work.
Create an extended video. It will be interesting to look at moving in city traffic
I'm currently working on a video showing the whole script

Quote:
Originally Posted by AIped
View Post
Yea i think its good finaly seeing this released. Looking forward to see other scripters make some good use of this.

Edit: by the way did our include and FCNPC still work well with sa-mp 0.3.7-R2 ?
Seems like I didn't try it with the newest version yet.
I will now and report back.

Edit: It's working without any problems for me.
Reply
#6

Amazing...just amazing
Reply
#7

Quote:
Originally Posted by NaS
View Post


Seems like I didn't try it with the newest version yet.
I will now and report back.

Edit: It's working without any problems for me.
Great tellme if you need any help
Reply
#8

Woa!! That's amazing. Good job!
Reply
#9

This is one of the best NPCs filterscripts. It's simply amazing! I can realize how much effort you put in it.
Reply
#10

Aparee this in the log: [16:08:29] [sampgdk:error] Too many callback arguments (at most 32 allowed)
Reply
#11

Looks interesting, great job. Rep.
Reply
#12

Quote:
Originally Posted by GustavoSouza
View Post
Aparee this in the log: [16:08:29] [sampgdk:error] Too many callback arguments (at most 32 allowed)
I never encountered that one. How did it happen?

Quote:
Originally Posted by Michael B
View Post
This is one of the best NPCs filterscripts. It\'s simply amazing! I can realize how much effort you put in it.
Thanks, and yea, we kinda went through many different versions.
Reply
#13

Awesome, will test it soon, thank you)
Reply
#14

Very nice, just the VehicleZAngle need some more work to be perfect, congrats NaS, +6
Reply
#15

Excellent job NaS .`I can see alot of ppl using this.(I know I will).Thanks for the effort. ++Rep\'d.
Reply
#16

Great job! +REP!
Reply
#17

Good Job!
Reply
#18

Thanks guys!


Updated the code for some performance tweaks.

The calculations should be a bit faster now.


If you want even more performance look for the line "newpath = smooth_path(...)" and change the 0.2 to 0.1, this will make the path less smooth.
Reply
#19

Deleted.
Reply
#20

Quote:
Originally Posted by JustinAn
View Post
For your server package, you\'ve missed the includes. I don\'t know if it\'s on purpose or accident but just a heads up for ya.
They are in plugins/plugin_includes

I\'ll move the folder in the next version.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)