Torque 3D 3.7
ContentsIndexHome
PreviousUpNext
Functions

The following table lists functions in this documentation.

 
Name 
Description 
 
< @copydoc addCommand( const char*, const char *, StringCallback, const char *, S32, S32, bool, ConsoleFunctionHeader* ) 
 
< @copydoc addCommand( const char*, const char *, StringCallback, const char *, S32, S32, bool, ConsoleFunctionHeader* ) 
 
< @copydoc addCommand( const char*, const char *, StringCallback, const char *, S32, S32, bool, ConsoleFunctionHeader* ) 
 
Register a C++ function with the console making it callable as a method of the given namespace from the scripting engine.
@param nameSpace Name of the namespace to associate the new function with; this is usually the name of a class. @param name Name of the new function. @param cb Pointer to the function implementing the scripting call; a console callback function returning a specific type value. @param usage Documentation for this function. @ref console_autodoc @param minArgs Minimum number of arguments this function accepts @param maxArgs Maximum number of arguments this function accepts... more 
 
< @copydoc addCommand( const char*, const char *, StringCallback, const char *, S32, S32, bool, ConsoleFunctionHeader* ) 
 
< @copydoc addCommand( const char *, StringCallback, const char *, S32, S32, bool, ConsoleFunctionHeader* ) 
 
< @copydoc addCommand( const char *, StringCallback, const char *, S32, S32, bool, ConsoleFunctionHeader* ) 
 
< @copydoc addCommand( const char *, StringCallback, const char *, S32, S32, bool, ConsoleFunctionHeader* ) 
 
Register a C++ function with the console making it a global function callable from the scripting engine.
@param name Name of the new function. @param cb Pointer to the function implementing the scripting call; a console callback function returning a specific type value. @param usage Documentation for this function. @ref console_autodoc @param minArgs Minimum number of arguments this function accepts @param maxArgs Maximum number of arguments this function accepts @param toolOnly Wether this is a TORQUE_TOOLS only function. @param header The extended function header. 
 
< @copydoc addCommand( const char *, StringCallback, const char *, S32, S32, bool, ConsoleFunctionHeader* ) 
 
Add a console constant that references the value of a constant in C++ code.
@param name Global console constant name to create. @param type The type of the C++ constant; see the ConsoleDynamicTypes enum for a complete list. @param pointer Pointer to the constant. @param usage Documentation string.
@see ConsoleDynamicTypes 
 
 
 
Add a console variable that references the value of a variable in C++ code.
If a value is assigned to the console variable the C++ variable is updated, and vice-versa.
@param name Global console variable name to create. @param type The type of the C++ variable; see the ConsoleDynamicTypes enum for a complete list. @param pointer Pointer to the variable. @param usage Documentation string.
@see ConsoleDynamicTypes
 
 
Add a callback for notification when a variable is assigned a new value.
@param name An existing global console variable name. @param callback The notification delegate function. 
 
This is function Con::beginCommandGroup. 
 
note This should only be called from consoleObject.h 
 
This is function Con::collapseScriptFilename. 
 
This is function Con::ConsoleFunctionGroupBegin. 
 
This is function Con::ConsoleFunctionGroupEnd. 
 
This is function Con::consoleLog. 
 
This is function Con::endCommandGroup. 
 
note The console window colors warning text as RED. param type Allows you to associate the warning message with an internal module. param _format A stdlib printf style formatted out put string param ... Variables to be written see Con::errorf() 
 
note The console window colors warning text as RED. param _format A stdlib printf style formatted out put string param ... Variables to be written 
 
Evaluate an arbitrary chunk of code.
@param string Buffer containing code to execute. @param echo Should we echo the string to the console? @param fileName Indicate what file this code is coming from; used in error reporting and such. 
 
Evaluate an arbitrary line of script.
This wraps dVsprintf(), so you can substitute parameters into the code being executed. 
 
This is function Con::execute. 
 
Call a script function from C/C++ code.
@param argc Number of elements in the argv parameter @param argv A character string array containing the name of the function to call followed by the arguments to that function. @code // Call a Torque script function called mAbs, having one parameter. char* argv[] = {"abs", "-9"}; char* result = execute(2, argv); @endcode 
 
This is function Con::execute. 
 
Call a Torque Script member function of a SimObject from C/C++ code. @param object Object on which to execute the method call. @param argc Number of elements in the argv parameter (must be >2, see argv) @param argv A character string array containing the name of the member function to call followed by an empty parameter (gets filled with object ID) followed by arguments to that function. @code // Call the method setMode() on an object, passing it one parameter.
char* argv[] = {"setMode", "", "2"}; char* result = execute(mysimobject, 3, argv); @endcode 
 
This is function Con::expandGameScriptFilename. 
 
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... more 
 
tom, 5/18/2006] FIXME: This needs some bounds checking 
 
This is function Con::gConsumers. 
 
This is function Con::getArgBuffer. 
 
Same as getVariable(), but for bools.
@param name Name of the variable. @param def Default value to supply if no matching variable is found. 
 
This is function Con::getData. 
 
This is function Con::getFloatArg. 
 
Same as getVariable(), but for floats.
@param name Name of the variable. @param def Default value to supply if no matching variable is found. 
 
This is function Con::getFormattedData. 
 
This is function Con::getIntArg. 
 
Same as getVariable(), but for ints.
@param name Name of the variable. @param def Default value to supply if no matching variable is found. 
 
Retrieve the string value to a locally scoped console variable
@note The context of the variable is determined by gEvalState; that is, by the currently executing code.
@param name Local console variable name to get 
 
name Logging 
 
 
 
This is function Con::getNamespaceList. 
 
Retrieve the string value of an object field @param name "object.field" string to query @return The string value of the variable or NULL if no object is specified 
 
This is function Con::getReturnBuffer. 
 
This is function Con::getReturnBuffer. 
 
 
 
This is function Con::getReturnBuffer. 
 
This is function Con::getStringArg. 
 
This is function Con::getStringArg. 
 
Retrieve the string value of a global console variable @param name Global Console variable name to query @return The string value of the variable or "" if the variable does not exist. 
 
init 
Initializes the console.
This performs the following steps:
  • Calls Namespace::init() to initialize the scripting namespace hierarchy.
  • Calls ConsoleConstructor::setup() to initialize globally defined console methods and functions.
  • Registers some basic global script variables.
  • Calls AbstractClassRep::init() to initialize Torque's class database.
  • Registers some basic global script functions that couldn't usefully be defined anywhere else.
 
 
Is the console active at this time? 
 
 
 
Returns true if fn is a global scripting function.
This looks in the global namespace. It also checks to see if fn is in the StringTable; if not, it returns false.
 
 
Returns true when called from the main thread, false otherwise 
 
This is function Con::isScriptPathExpando. 
 
This is function Con::linkNamespaces. 
 
name Namespaces 
 
@name Special Purpose Registration
These are special-purpose functions that exist to allow commands to be grouped, so that when we generate console docs, they can be more meaningfully presented.
@ref console_autodoc "Click here for more information about console docs and grouping." 
 
This is function Con::noteScriptCallback. 
 
This is function Con::popInstantGroup. 
 
This is function Con::postConsoleInput. 
 
param _format A stdlib printf style formatted out put string param ... Variables to be written 
 
name Instant Group
 
 
dhc - found this empty -- trying what I think is a reasonable impl. 
 
This is function Con::removeScriptPathExpando. 
 
Remove a console variable.
@param name Global console variable name to remove @return true if variable existed before removal. 
 
Remove an existing variable assignment notification callback.
@param name An existing global console variable name. @param callback The notification delegate function. 
 
Same as setVariable(), but for bools. 
 
name Dynamic Type System 
 
Same as setVariable(), but for floats. 
 
Same as setVariable(), but for ints. 
 
Assign a string value to a locally scoped console variable
@note The context of the variable is determined by gEvalState; that is, by the currently executing code.
@param name Local console variable name to set @param value String value to assign to name 
 
 
 
Global Functions 
 
@name Global Variable Accessors @{ Assign a string value to a global console variable @param name Global console variable name to set @param value String value to assign to this variable. 
 
This is function Con::sgPathExpandos. 
 
Shuts down the console.
This performs the following steps:
 
 
This is function Con::sInstantGroupStack. 
 
Remove color marking information from a string.
@note It does this in-place, so be careful! It may potentially blast data if you're not careful. When in doubt, make a copy of the string first. 
 
This is the basis for tab completion in the console.
@note This is an internally used function. You probably don't care much about how this works.
This function does some basic parsing to try to ascertain the namespace in which we are attempting to do tab completion, then bumps control off to the appropriate tabComplete function, either in SimObject or Namespace.
@param inputBuffer Pointer to buffer containing starting data, or last result. @param cursorPos Location of cursor in this buffer. This is used to indicate what part of the string should be kept and what part... more 
 
This is function Con::unlinkNamespaces. 
 
This is function Con::unlockLog. 
 
note The console window colors warning text as LIGHT GRAY. param type Allows you to associate the warning message with an internal module. param _format A stdlib printf style formatted out put string param ... Variables to be written see Con::warnf() 
 
note The console window colors warning text as LIGHT GRAY. param _format A stdlib printf style formatted out put string param ... Variables to be written 
Copyright (c) 2015. All rights reserved.
What do you think about this topic? Send feedback!