dim3 Forum

Full Version: Node Name Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well, I need to kinds of nodes for my game, cover nodes, and attack nodes.
I made these.
Problem? Well, when I script it to run to the nearest node, it finds the id, the name, it runs to the name, but since the name isn't unique it runs to the first one of those ever made.
I CAN'T make all the names unique, because the bot also runs using obj.motionVector.walkToPlayer(); and I need it to be able to switch and run back to a DIFFERENT attack node by choosing the nearest one then continue on that path to a DIFFERENT cover node, and if I don't know what the name of the cover node (or attack node) I can't run to it Sad.

I've been trying to make good+simple AI and now I've coded myself into a corner :P.


Ideas?
I'm sorry if this is a dumb question after all the complicated scripting stuff Rolleyes
but how do nodes work?
PatrickA Wrote:I'm sorry if this is a dumb question after all the complicated scripting stuff Rolleyes
but how do nodes work?
Look at the JoeFoe script. Rolleyes

@ccccc:
First make sure that all your nodes have different names.
You could name them "attacknode1", "attacknode2", "attacknode3" etc.
Now give all the attack nodes a user value of 1 and all the cover nodes a user value of 2.
Now to find a node use
Code:
nearest(x,z,y,user,angle,angleSweep,minDist,maxDist);
If you want attack nodes, use 1 for the user value, for cover nodes use 2.
Now you have the id of the nearest attack/cover node and can get the name and tell the AI to run towards it (because the node has a unique name).
I hope that helped.
THANK YOU! I GET IT Smile.
Really, thanks!
Reference URL's