[FilterScript] Detect Driving on the wrong side of the road
#1

Summary:
In February I made a video proving that you can detect which side of the road someone is driving on, here is the files I created for it.
http://www.youtube.com/watch?v=IUE6NCxJLww

Files:
filterscript, requires zcmd and incognito's streamer
http://pastebin.com/LTJVqbc2

and the more important include
https://paste.ee/r/XdzSF
gone through a few sites, hopefully this ones good!

Description:
obviously reading through the code, it was not created for performance, it was rushed and made just for a video proving that it is possible.
reading over the filterscript you can see how the include is used and how to create more things based off it like detection for driving off the road, or create a driving test or something more creative.

it can be a little complicated to read through, basically there are nodes and navi nodes
nodes are just points on the roads that the ai follow so they don't drive off the road.
in the include they are in the format:

Code:
enum NodeInfo
{
	Float:nodeX,
	Float:nodeY,
	Float:nodeZ,
	link1ID,
	navi1ID,
	link2ID,
	navi2ID,
	link3ID,
	navi3ID,
	link4ID,
	navi4ID,
};
so there's the x y z which should be obvious, then there's the link1ID which is the link 1 ID number (or index) and the navi 1 index.
the link1ID refers to an index in the NodeInfo and refers to node connected to it
the navi1ID refers to an index in NaviInfo and is the navi in between the current node and link1ID
if a node does not have a connecting node then it'll be -1, same for navi links

I only extracted the following information from the data for the navi nodes:
Code:
enum NaviInfo
{
	from,
	to,
	leftLanes,
	rightLanes,
};
and here's a visual of the combined information

the navi nodes aren't really needed and are just holding data, in the picture L stands for left lanes and R stands for...

Conclusion:
There should be enough stuff for someone to do something better with this data, also some of the data is incorrect like nodes having 0 connections but most of the data is there and you could probably just fix it up as you use it.

I will also not be offering much in the way of support for using this.

this explains it in the data format you can find in your gta directory and whats possible to extract from those files:
http://gta.wikia.com/Paths_%28GTA_SA%29
Reply
#2

Nice cessil, very useful.
Reply
#3

Pretty cool Nice work!
Reply
#4

Great!
Reply
#5

Thanks for the share.
Reply
#6

Good one.
Reply
#7

Cessil do you know how to connect just the ped nodes ?
I made textlabels that show all ped nodes with the id, linked id position and such but for the looks of how they are
placed in compared with vehicles..its a mess.
Reply
#8

Quote:
Originally Posted by AIped
View Post
Cessil do you know how to connect just the ped nodes ?
I made textlabels that show all ped nodes with the id, linked id position and such but for the looks of how they are
placed in compared with vehicles..its a mess.
I'd guess they are connected the same way as vehicles are, which are also a mess
Reply
#9

What's difference between your script and this:

https://sampforum.blast.hk/showthread.php?tid=550986

?
Reply
#10

What is this? No player textdraws?

Code:
new Text:sideCheck[MAX_PLAYERS] = {Text:INVALID_TEXT_DRAW, ...};
Reply
#11

Quote:
Originally Posted by iWhite
View Post
What's difference between your script and this:

https://sampforum.blast.hk/showthread.php?tid=550986

?
mine uses nodes from the data files from the game
Reply
#12

Decent.
Reply
#13

Good Job.
Reply
#14

Alright you can stop posting one-two word replies, I don't care about what you rate it.
Doing so does not help anyone in anyway.
But do post if you have read the whole thread and still have questions that need answering about it.
Reply
#15

SF only? Or all city?
Reply
#16

Very nice, nice usage for GTA:SA nodes info. By the way, is there a file or array for onfoot nodes (sidewalk)? I ever wanted to do some stuff like pedestrian npcs using these nodes but never knew if there is some sidewalk nodes to work with. Really impressive work, thanks for sharing.

@Edit: I've been reading gta wikia and saw that all the nodes are inside .dat files into gta3.img, I would like to know what are the files for onfoot nodes... Sorry for the stupid question, I should read more about it before asking.
Reply
#17

gps_done?
Reply
#18

Quote:
Originally Posted by ipsLeon
View Post
Very nice, nice usage for GTA:SA nodes info. By the way, is there a file or array for onfoot nodes (sidewalk)? I ever wanted to do some stuff like pedestrian npcs using these nodes but never knew if there is some sidewalk nodes to work with. Really impressive work, thanks for sharing.

@Edit: I've been reading gta wikia and saw that all the nodes are inside .dat files into gta3.img, I would like to know what are the files for onfoot nodes... Sorry for the stupid question, I should read more about it before asking.
I am currently working with ped nodes i have a script showing those nodes with info about them in 3dtext.
i am having a hard time connecting them though. maybe we can help eachother out ?
Reply
#19

Useful for roleplay servers !

Great work cessil.
Reply
#20

Yeah nice I like it. Also good job
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)