Discussion of Inner Space
Moderators: Lavish Software Team, Moderators
-
Blazer
- GamingTools Subscriber
- Posts: 38
- Joined: Tue Jul 20, 2004 8:22 am
Post
by Blazer » Mon May 30, 2005 2:32 pm
Cant figure out what im doing wrong here, if you could assist me Lax:)
Here is my Nagivational xml file;
Code: Select all
<?xml version='1.0'?>
<Navigation>
<World Name="TestPath">
<Point Name="TestPath0">
<X>885.130005</X>
<Y>7.090000</Y>
<Z>-471.140015</Z>
</Point>
<Point Name="TestPath1">
<X>886.280029</X>
<Y>6.200000</Y>
<Z>-457.820007</Z>
</Point>
<Point Name="TestPath2">
<X>889.119995</X>
<Y>5.360000</Y>
<Z>-439.929993</Z>
</Point>
<Point Name="TestPath3">
<X>884.039978</X>
<Y>4.030000</Y>
<Z>-420.369995</Z>
</Point>
<Point Name="TestPath4">
<X>881.270020</X>
<Y>0.890000</Y>
<Z>-393.500000</Z>
</Point>
</World>
</Navigation>
Here is some code im testing it with;
Code: Select all
declare filename string local EQ2Navigation.xml
declare NearestPoint string local
declare world string local TestPath
declare EndPoint string local TestPath5
Navigation -load ${filename}
NearestPoint:Set[${Navigation.World["${world}"].NearestPoint[${Me.X},${Me.Y},${Me.Z}]}]
echo ${world}
echo ${NearestPoint}
echo ${EndPoint}
NavPath "${world}" "${NearestPoint}" "${EndPoint}"
echo ${NavPath.Points}
The ${NearestPoint} seems to be working as it should when I move around the recorded navpoints. However, the NavPath.Points is always returning 0. Something wrong with NavPath, and I dont know what im doing wrong.
-
Lax
- Owner
- Posts: 6634
- Joined: Fri Jun 18, 2004 6:08 pm
Post
by Lax » Mon May 30, 2005 2:37 pm
The points are simply not connected, so there's no path from any point to another.
Code: Select all
<Connection From="TestPath" To="TestPath1" BiDirectional="1" />
-
Blazer
- GamingTools Subscriber
- Posts: 38
- Joined: Tue Jul 20, 2004 8:22 am
Post
by Blazer » Mon May 30, 2005 8:59 pm
Figured out my problem. I was actually using the NavPoint -connect already, but then I found that my syntax for ${LastPoint} was incorrect. It was strange because
Code: Select all
LastPoint:["${world}${PointCount}"]
wasnt generating an error for me, as it should have been this;
Code: Select all
LastPoint:Set["${world}${PointCount}"]
And because it didnt generate an error, thought there was something else wrong:)
-
Lax
- Owner
- Posts: 6634
- Joined: Fri Jun 18, 2004 6:08 pm
Post
by Lax » Mon May 30, 2005 9:40 pm
Interesting, I'll fix that