Game Development Community

Using export() method in TorqueScript

by Nmuta Jones · in Torque Game Engine · 07/16/2008 (6:14 pm) · 1 replies

Here is my code from inside of an in-game trigger. pretty basic. :
%newpos = %obj.getTransform(); 
	
        $mynew::x = getWord(%newpos,0);
	$mynew::y = getWord(%newpos,1);
	$mynew::z = getWord(%newpos,2);
	
	centerprint(%obj.client, "Your z Position"@$mynew::z, 2,1);

	export("$mynew::*", "./client/save.cs", False);

Where %obj is the object that trips the trigger.

It prints the z position of the player to the screen. Which means that the $mynew::z variable is working correctly.

BUT my save.cs file has nothing being written to it. why not? Isn't my code correct?
What am I doing wrong. ?

#1
07/16/2008 (6:36 pm)
Ok, I figured it out. My script was working.

the file path is relative, so since triggers.cs was calling it, it was saving it within the server folder in a "client" subfolder.


the corrected file path,
export("$mynew::*", "./../../client/save2.cs", False);

dumped it where I wanted it.

nothing to see here folks, move along . ;)