Torque 3D 3.8
Con::expandScriptFilename Function
bool expandScriptFilename(char * filename, U32 size, const char * src);

Convert from a relative script path to an absolute script path. 

This is used in (among other places) the exec() script function, which takes a parameter indicating a script file and executes it. Script paths can be one of:

  • Absolute: fps/foo/bar.cs Paths of this sort are passed through.
  • Mod-relative: ~/foo/bar.cs Paths of this sort have their replaced with the name of the current mod.
  • File-relative: ./baz/blip.cs Paths of this sort are calculated relative to the path of the current scripting file.


@note This function determines paths relative to the currently executing CodeBlock. Calling it outside of script execution will result in it directly copying src to filename, since it won't know to what the path is relative! 

@param filename Pointer to string buffer to fill with absolute path. @param size Size of buffer pointed to by filename. @param src Original, possibly relative script path. 


Copyright (c) 2015. All rights reserved.
What do you think about this topic? Send feedback!