Jump to content
Sign in to follow this  
arjay

Road Segment Direction

Recommended Posts

I was wondering if anyone could help me with getting the direction of a road segment. The following code only returns 0 for the direction of any roads I try it with? Do road segments even have a direction or are they not considered as normal objects like buildings?

_nearRoads = _parkingPosition nearRoads 10;

if(count _nearRoads > 0) then
{
_road = _nearRoads select 0;
_direction = getDir _road;
};

---------- Post added at 13:51 ---------- Previous post was at 13:44 ----------

Answered my own question :) Might be helpful to others...

_nearRoads = _parkingPosition nearRoads 10;

if(count _nearRoads > 0) then
{
_road = _nearRoads select 0;
_roadConnectedTo = roadsConnectedTo _road;
_connectedRoad = _roadConnectedTo select 0;
_direction = [_road, _connectedRoad] call BIS_fnc_DirTo;
};

  • Like 1

Share this post


Link to post
Share on other sites

disregard

Share this post


Link to post
Share on other sites

On a related matter, I have noticed that some stratis road segment directions do not always run flush with the visual road geometry as with Takistan.

ie The following code can return some inconsistent results.

_vehicle setDir (getDir _segment);

Edit: 10,000 Posts for kju! :)

Edited by Kushluk

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×