Expose decal road nodes

Scripting questions, discussions, etc
3 posts Page 1 of 1
Posts: 104
Joined: Fri Dec 29, 2017 4:34 pm
by Hodo33 » Fri Apr 06, 2018 3:11 am
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 ?
Posts: 84
Joined: Fri Feb 27, 2015 5:13 pm
by irei1as » Mon Apr 09, 2018 9:37 am
You can use
Point3F DecalRoad::getNodePosition( U32 idx )

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).
Posts: 104
Joined: Fri Dec 29, 2017 4:34 pm
by Hodo33 » Mon Apr 23, 2018 2:45 am
Thanks for the info, sounds like engine change would be easier
3 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests