Detect Driving on the wrong side of the road -
cessil - 24.05.2015
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
Re: Detect Driving on the wrong side of the road -
ZaBraNjeNi - 24.05.2015
Nice cessil, very useful.
Re: Detect Driving on the wrong side of the road -
PT - 24.05.2015
Pretty cool Nice work!
Re: Detect Driving on the wrong side of the road -
Neutralneu - 24.05.2015
Great!
Re: Detect Driving on the wrong side of the road -
SiraBots - 24.05.2015
Thanks for the share.
Re: Detect Driving on the wrong side of the road -
SpikY_ - 24.05.2015
Good one.
Re: Detect Driving on the wrong side of the road -
AIped - 24.05.2015
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.
Re: Detect Driving on the wrong side of the road -
cessil - 24.05.2015
Quote:
Originally Posted by AIped
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
Re: Detect Driving on the wrong side of the road -
iWhite - 24.05.2015
What's difference between your script and this:
https://sampforum.blast.hk/showthread.php?tid=550986
?
Re: Detect Driving on the wrong side of the road -
Pottus - 24.05.2015
What is this? No player textdraws?
Code:
new Text:sideCheck[MAX_PLAYERS] = {Text:INVALID_TEXT_DRAW, ...};
Re: Detect Driving on the wrong side of the road -
cessil - 24.05.2015
Quote:
Originally Posted by iWhite
|
mine uses nodes from the data files from the game
Re: Detect Driving on the wrong side of the road -
Phaze - 25.05.2015
Decent.
Re: Detect Driving on the wrong side of the road -
AdHaM612 - 25.05.2015
Good Job.
Re: Detect Driving on the wrong side of the road -
cessil - 25.05.2015
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.
Re: Detect Driving on the wrong side of the road -
kkeeii - 27.05.2015
SF only? Or all city?
Re: Detect Driving on the wrong side of the road -
n0minal - 27.05.2015
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.
Re: Detect Driving on the wrong side of the road -
kkeeii - 27.05.2015
gps_done?
Re: Detect Driving on the wrong side of the road -
AIped - 27.05.2015
Quote:
Originally Posted by ipsLeon
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 ?
Re: Detect Driving on the wrong side of the road -
Alex MagaŃa - 27.05.2015
Useful for roleplay servers
!
Great work cessil.
Re: Detect Driving on the wrong side of the road -
Konverse - 27.05.2015
Yeah nice I like it. Also good job