23.12.2018, 23:27
(
Last edited by kristo; 16/04/2019 at 05:44 PM.
)
Version 1.1.0 has been released!
Code:
native GetAngleBetweenMapNodes(MapNode:first, MapNode:second, &Float:angle); native GetMapNodeAngleFromPoint(MapNode:nodeid, Float:x, Float:y, &Float:angle); native GetMapNodeConnectionCount(MapNode:nodeid, &count); native GetHighestMapNodeID(); native GetRandomMapNode(&MapNode:nodeid); I have these things planned for the next bigger release or the one after. Right now this plugin only contains functions I needed to convert my gamemode from RouteConnector plus some extras. Runtime editing of nodes and loading/saving them will definitely be a thing, not sure when though, since I have a busy period coming in school. I'm not sure about RebuildNet right now, I believe it's a RouteConnector thing since it prebuilds the graph. This plugin doesn't do that, all the nodes and their connections just act as a graph in the pathfinder. Correct me if I'm wrong though. Yeah, I took a look at the original data format when trying to understand how directions in GPS.dat work. Road widths and lane counts could also be used in the pathfinding algorithm to prioritise highways and main roads. I would also like to make as much data accessible to developers as possible. Also, for now, I've found out that an offset of 2.5 units is the golden mean that works for most roads. I'm actually using the fixed one, you're even in the credits. Also, can you confirm if Gamer_Z is the creator of the original one or is it someone else? |
native GetPathNodeIndex(Path:pathid, MapNode:nodeid, &index);
Just switched from RouteConnector to this plugin for the NPC Drivers and found a small issue with node connections.
If a node points to another node but it doesn't point back, the path sometimes stops there (although it should probably try to find another way). It seems to work in most cases but rarely doesn't. An example for that would be near the LS Airport highway (I can try to find two node ids that produce this if this helps). I also get a warning/error in the console sometimes: "Failed to dispatch thread: resource unavailable try again: resource unavailable try again" It keeps spamming that and then crashes. So far no idea why it happens, it doesn't seem to be too busy at that point and I made sure the nodes passed to FindPathThreaded are valid etc. |