SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 02/07/2019, 11:31 PM   #1
FR0DG3R
Little Clucker
 
FR0DG3R's Avatar
 
Join Date: Nov 2018
Location: Belo Horizonte, MG, Brazil
Posts: 4
Reputation: 0
Question NODES*.dat's path width and flags

So, my work involves making cars follow paths made by NODES*.dat nodes. The community nodes documentation on the grandtheftwiki says that every node has a property called "Path Width" that is 0 by default (?) and can be changed, is it made for us to change manually change each node? Has someone ever done that?
I need a way of obtaining the width value for the nodes because I really want to adapt the code for working with many car models and street widths.

I also have a problem with some navi node flags I'd like to use (e. g. traffic light behavior, left/right lanes), they are always 0, but the wiki says it should really give a value. I don't think I'm reading it wrong because most data comes just as expected, I have proper coords and target nodes from the navi nodes, and the binary reading works on path nodes' flags.


This is the way I read a NaviNode (C++)

I declare the struct, according to the wiki:
Code:
struct NaviNode {
    short pos[2];
    unsigned short areaId, nodeId;
    char direction[2];
    unsigned flags;
};
And read it on the file:
Code:
NaviNode naviNode;

for(unsigned i = 0; i < header.naviNodes; i++) {
    fread(&naviNode, 14, 1, inputFile);// following the wiki it uses 14 bytes
   //store it
}
note: wiki page I mention is https://www.grandtheftwiki.com/Paths_(GTA_SA)
FR0DG3R is offline   Reply With Quote
Old 18/08/2019, 08:10 PM   #2
FR0DG3R
Little Clucker
 
FR0DG3R's Avatar
 
Join Date: Nov 2018
Location: Belo Horizonte, MG, Brazil
Posts: 4
Reputation: 0
Default Re: NODES*.dat's path width and flags

In case someone ends up here looking for a way to get number of lanes on the streets:

Download Aschratts Path Editor and, after decompiling the NODES*.dat to a .dnf file, you can read this file just like plain text, it contains everything that the original game files has about the nodes.

I had a problem where the reading of navi node flags were always the same (maybe it was just a mistake by me and no one will ever have this problem, anyway), about the Paths Width, tough, I didn't find out if there's a way of getting it.
FR0DG3R is offline   Reply With Quote
Old 21/08/2019, 03:12 AM   #3
n0minal
High-roller
 
n0minal's Avatar
 
Join Date: Mar 2013
Location: Rio de Janeiro
Posts: 4,029
Reputation: 758
Default Re: NODES*.dat's path width and flags

Why don't you use a simple pathfinder like Gamerz's one? It's easier (if you're not willing to create your own pathfinder though, if that's the case and it's for study, ignore this comment).
n0minal is offline   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
Path nodes to zone polygons? Chaser98 Discussion 3 16/11/2017 10:59 PM
Path nodes Dayvison_ Scripting Help 2 29/10/2016 07:42 PM
[Include] Textdraw Flags - Over 30 country flags Drebin Includes 71 25/09/2016 09:29 PM
Textdraw width help Jstylezzz Scripting Help 4 23/02/2013 08:48 PM
Dialog Width spd_sahil Scripting Help 1 18/01/2012 02:13 PM


All times are GMT. The time now is 11:50 AM.


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