Game Development Community

path nodes only accept numbers?

by Glenn Thomas · in Torque Game Builder · 06/30/2010 (9:52 pm) · 4 replies

Hello I'm trying to use a variable in the getNode() like below:
%newPath.addNode("%xPoint,%yPoint", 0);

Is this impossible?

#1
07/01/2010 (8:47 am)
Try this instead:
%newPath.addNode(%xPoint,%yPoint, 0);

or this:
%newPath.addNode(%xPoint SPC %yPoint, 0);

Not sure which way since i'm not familiar with path nodes. However I know for a fact this: "%xPoint,%yPoint" is a literal string and torque does not see the variables.
#2
07/01/2010 (9:40 am)
Hi Kevin, I tried the:
%newPath.addNode(%xPoint,%yPoint, 0);

but I will definitely try your second suggestion tonight! Also I think the parenthesis' were in the documentation I read. It seemed to work with or without as long as I was using numbers. Thanks again for the suggestion and I'll get back to you with my findings. Hopefully this well help some other devs as well. :)
#3
07/01/2010 (9:45 am)
Okay, if its looking for a string then separating the variables with SPC will do the trick.
#4
07/03/2010 (10:43 am)
Hi Kevin, thank you for the tip. Used this:
%newPath.addNode(%xPoint SPC %yPoint, 0);