NavPoint Bug

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
Blazer
GamingTools Subscriber
Posts: 38
Joined: Tue Jul 20, 2004 8:22 am

NavPoint Bug

Post by Blazer » Sat Jun 04, 2005 11:28 pm

The following crashes my eq2 session.

Code: Select all

	NavPoint -set "Some World" "Some Label" ${Me.X} ${Me.Y} ${Me.Z}
I guess NavPoint doesnt like spaces?

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Sun Jun 05, 2005 1:06 am

NavPoint loves spaces and people use it with spaces all the time.

The following does not crash my session:

Code: Select all

NavPoint -set "Some World" "Some Label" 1 2 3
Neither do the following

Code: Select all

NavPoint -set "Some World" "Some Label" 1 2
NavPoint -set "Some World" "Some Label" 1
NavPoint -set "Some World" "Some Label" 1 2 3 4

I can't imagine why that crashed, perhaps a bug in ISXEQ2?

ml2517
GamingTools Subscriber
Posts: 12
Joined: Tue Jul 13, 2004 8:16 pm

Post by ml2517 » Sun Jun 05, 2005 1:32 am

Maybe try simulating a float instead of an integer?

Blazer
GamingTools Subscriber
Posts: 38
Joined: Tue Jul 20, 2004 8:22 am

Post by Blazer » Sun Jun 05, 2005 5:27 am

Graaa. Was crashing before, now its not. It was happening when I had the spaces, but when I took them away, it was not.
However!! There is still the problem with the spaces, and I thought it was related somehow;

Code: Select all

; Test Script

function main()
{
	Navigation -reset
	Navigation -load TestFile.xml
	declare tempvar1 string local "Some World"
	declare tempvar2 string local "Some Label"

	NavPoint -set ${tempvar1} ${tempvar2} ${Me.X} ${Me.Y} ${Me.Z}
	Navigation -dump TestFile.xml
}
The generated xml file is

Code: Select all

<?xml version='1.0'?>
<Navigation>
	<World Name="Some">
		<Point Name="World">
			<X>0.000000</X>
			<Y>0.000000</Y>
			<Z>84.480003</Z>
		</Point>
	</World>
</Navigation>
:)

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Sun Jun 05, 2005 9:33 am

ok, THAT issue is simply needing to follow syntax rules. The value of your variables are literally:

Code: Select all

Some World
and

Code: Select all

Some Label
The quotes are removed the same as with any other command, the DeclareVariable command doesnt know they exist in your variable declaration

So your navpoint command ends up doing exactly this:

Code: Select all

NavPoint -set Some World Some Label 1.234 2.345 3.456
and I'm sure you realize the problem with figuring out where each parameter is supposed to begin and end.

Complete syntax rules (For commands, not for script formatting) are found here: http://www.lavishsoft.com/wiki/index.ph ... ipt:Syntax
Parameters are words separated by spaces. If an individual parameter must itself include a space, or certain special characters should not be interpreted as part of a complex command, double quotes (") should be used around the parameter. Data are valid in any parameter, and will be processed (potentially becoming multiple parameters) unless the command name indicates a command that instructs otherwise (in which case the data will be treated as a single word). If data are processed, they will be replaced with the "return" (also referred to as "To String") value of the final resulting object.
Here is what your NavPoint should be:

Code: Select all

NavPoint -set "$&#123;tempvar1&#125;" "$&#123;tempvar2&#125;" $&#123;Me.X&#125; $&#123;Me.Y&#125; $&#123;Me.Z&#125;
I think Fippy has posted something for helping with nav paths on ISMods (and if not, I know he is working on something and talking about it in IRC), it might be worth trying to find

Post Reply