Jump to content

Expose decal road nodes


Recommended Posts

I want to get access to the node points on a decal road so my aivehicle will path along the road. After looking at the c++ code I find this jewel


dSprintf( buffer, 1024, "Node = \"%f %f %f %f\";", node.point.x, node.point.y, node.point.z, node.width );


It prints the node points in the mission file but no way to index them. I can add the index to this printout but not sure how to expose the node array to script. Any ideas there ?

Link to post
Share on other sites

You can use

Point3F DecalRoad::getNodePosition( U32 idx )

instead.


It's also located in decalRoad.cpp. Then you only need to show it to TorqueScript with a DefineEngineMethod.



If you don't want to change the engine you could also create a Path and add various Marker to it that follows the decal road and just use those instead of the decal road.

The downside of doing that is that you have to make two roads (the graphical one of decal road and the script one with markers).

Link to post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...