dim3 Forum

Full Version: Node parameters
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I make an AI unit follow it's own node walk using parameters.
Since no one else has answered, might as well try my thoughts.
The current Joefoe's node walk section includes this:
Code:
function joeFoeStartNodeWalk(obj)
{
    var            nodeId,nodeName;
    nodeId=map.node.nearest(obj.position.x,obj.position.z,obj.position.y,null,null,null,0,3000);
    if (nodeId==-1) return;            // can't start walking, no node nearby
    
    nodeName=map.node.getName(nodeId);
    
    obj.motionVector.walkToNode(nodeName,'Dest01',JF_WALK_TO_DEST01);
Name all the nodes in your map with something easily memorable. Make the node name a variable taken from the parameter. Make what goes in the 'dest01' slot a variable too, and do the same. You'll want to still include something like the map.node.nearest command so it can find its way back on path from fighting the player.

Edit: gah!! has anyone else noticed that the forum never notices you put a closing tag in for code, so it inserts one where your cursor was. Making me go back and edit all my posts that have a code inlay, and also write this little rant. woo. [/code] <- See
Ok cool, I'll try that when I get internet for my Mac.
Reference URL's