Console System
The Console system is the basis for logging, SimObject, and TorqueScript itself.
Classes:
This is the backend for the ConsoleMethod()/ConsoleFunction() macros.
An arbitrary fragment of auto-doc text for the script reference.
Extended information about a console function.
Represents an entry in the log.
Utility class to save and restore the current console stack frame.
Groups:
Exports console information to XML representation.
The scripting engine makes heavy use of callbacks to represent function exposed to the scripting language.
User Defined
DefineConsoleType(TypeBool , bool )
DefineConsoleType(TypeBoolVector , Vector< bool > )
DefineConsoleType(TypeS8 , S8 )
DefineConsoleType(TypeS32 , S32 )
DefineConsoleType(TypeS32Vector , Vector< S32 > )
DefineConsoleType(TypeF32 , F32 )
DefineConsoleType(TypeF32Vector , Vector< F32 > )
DefineUnmappedConsoleType(TypeString , const char * )
const char *
DefineConsoleType(TypeRealString , String )
DefineConsoleType(TypeCommand , String )
DefineConsoleType(TypeFilename , const char * )
DefineConsoleType(TypeStringFilename , String )
DefineConsoleType(TypeRotationF , RotationF )
DefineConsoleType(TypeUUID , Torque::UUID )
A universally unique identifier.
DefineUnmappedConsoleType(TypePID , SimPersistID * )
A persistent ID that is associated with an object.
DefineConsoleType(TypeImageFilename , String )
TypeImageFilename is equivalent to TypeStringFilename in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type that can display a texture preview.
DefineConsoleType(TypePrefabFilename , String )
TypePrefabFilename is equivalent to TypeStringFilename in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type.
DefineConsoleType(TypeShapeFilename , String )
TypeShapeFilename is equivalent to TypeStringFilename in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type.
DefineConsoleType(TypeMaterialName , String )
TypeMaterialName is equivalent to TypeRealString in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type.
DefineConsoleType(TypeTerrainMaterialIndex , S32 )
TypeTerrainMaterialIndex is equivalent to TypeS32 in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type.
DefineConsoleType(TypeTerrainMaterialName , const char * )
TypeTerrainMaterialName is equivalent to TypeString in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type.
DefineConsoleType(TypeCubemapName , String )
TypeCubemapName is equivalent to TypeRealString in its usage, but the Inspector will provide a drop-down list of CubemapData objects.
DefineConsoleType(TypeParticleParameterString , const char * )
DefineConsoleType(TypeFlag , S32 )
DefineConsoleType(TypeColorI , ColorI )
DefineConsoleType(TypeColorF , LinearColorF )
DefineConsoleType(TypeSimObjectName , SimObject * )
DefineConsoleType(TypeShader , GFXShader * )
DefineConsoleType(TypeSimObjectPtr , SimObject * )
DefineConsoleType(TypeSimPersistId , SimPersistID * )
A persistent reference to an object.
DefineConsoleType(TypeName , const char * )
Special field type for SimObject::objectName.
DefineConsoleType(TypeRectUV , RectF )
TypeRectUV is equivalent to TypeRectF in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type.
Offset(x, cls) offsetof(cls, x)
Global Console Definition Macros
note:If TORQUE_DEBUG is defined, then we gather documentation information, and do some extra sanity checks.
ConsoleConstructor console_autodoc
DECLARE_CALLBACK(returnType, name, args) virtual returnType name ## _callback args
Define a C++ method that calls back to script on an object.
conmethod_return_const() return (
conmethod_return_S32() return (
conmethod_return_F32() return (
conmethod_nullify(val)
conmethod_return_bool() return (bool
ConsoleFunctionGroupBegin(groupName, usage) static cfg_ConsoleFunctionGroup_##groupName##_GroupBegin(,#groupName,usage)
ConsoleToolFunction(name, returnType, minArgs, maxArgs, usage1) returnType ctf_##name( *, , *argv); \ cc_##name##_obj(,#name,ctf_##name,usage1,minArgs,maxArgs, true); \ returnType ctf_##name( *, argc, *argv)
ConsoleFunctionGroupEnd(groupName) static cfg_##groupName##_GroupEnd(,#groupName,)
ConsoleNamespace(className, usage) cc_##className##_Namespace(#className, usage)
ConsoleMethodGroupBegin(className, groupName, usage) static cc_##className##_##groupName##_GroupBegin(#className,#groupName,usage)
ConsoleMethodGroupEnd(className, groupName) static cc_##className##_##groupName##_GroupEnd(#className,#groupName,)
ConsoleDoc(text) namespace { \ _sDocFragment( text ); \ }
Add a fragment of auto-doc text to the console API reference.
Enumerations
StringTableConstants { StringTagPrefixByte = 0x01 }
Typedefs
const char *
StringTableEntry
Variables
bool
Indicates that warnings about undefined script variables should be displayed.
char *
Functions
bool
collapseEscape(char * buf)
bool
dAtob(ConsoleValue & ref)
dAtof(ConsoleValueRef & ref)
dAtoi(ConsoleValueRef & ref)
expandEscape(char * dest, const char * src)
Detailed Description
The Console system is the basis for logging, SimObject, and TorqueScript itself.
User Defined
DefineEnumType(LogLevel )
typedef ConsoleLogEntry::Level LogLevel
User Defined
DefineConsoleType(TypeBool , bool )
DefineConsoleType(TypeBoolVector , Vector< bool > )
DefineConsoleType(TypeS8 , S8 )
DefineConsoleType(TypeS32 , S32 )
DefineConsoleType(TypeS32Vector , Vector< S32 > )
DefineConsoleType(TypeF32 , F32 )
DefineConsoleType(TypeF32Vector , Vector< F32 > )
DefineUnmappedConsoleType(TypeString , const char * )
DefineConsoleType(TypeRealString , String )
DefineConsoleType(TypeCommand , String )
DefineConsoleType(TypeFilename , const char * )
DefineConsoleType(TypeStringFilename , String )
DefineConsoleType(TypeRotationF , RotationF )
DefineConsoleType(TypeUUID , Torque::UUID )
A universally unique identifier.
DefineUnmappedConsoleType(TypePID , SimPersistID * )
A persistent ID that is associated with an object.
This type cannot be used to reference PIDs of other objects.
DefineConsoleType(TypeImageFilename , String )
TypeImageFilename is equivalent to TypeStringFilename in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type that can display a texture preview.
DefineConsoleType(TypePrefabFilename , String )
TypePrefabFilename is equivalent to TypeStringFilename in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type.
DefineConsoleType(TypeShapeFilename , String )
TypeShapeFilename is equivalent to TypeStringFilename in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type.
DefineConsoleType(TypeMaterialName , String )
TypeMaterialName is equivalent to TypeRealString in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type.
DefineConsoleType(TypeTerrainMaterialIndex , S32 )
TypeTerrainMaterialIndex is equivalent to TypeS32 in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type.
DefineConsoleType(TypeTerrainMaterialName , const char * )
TypeTerrainMaterialName is equivalent to TypeString in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type.
DefineConsoleType(TypeCubemapName , String )
TypeCubemapName is equivalent to TypeRealString in its usage, but the Inspector will provide a drop-down list of CubemapData objects.
DefineConsoleType(TypeParticleParameterString , const char * )
DefineConsoleType(TypeFlag , S32 )
DefineConsoleType(TypeColorI , ColorI )
DefineConsoleType(TypeColorF , LinearColorF )
DefineConsoleType(TypeSimObjectName , SimObject * )
DefineConsoleType(TypeShader , GFXShader * )
DefineConsoleType(TypeSimObjectPtr , SimObject * )
DefineConsoleType(TypeSimPersistId , SimPersistID * )
A persistent reference to an object.
This reference indirectly goes through the referenced object's persistent ID.
DefineConsoleType(TypeName , const char * )
Special field type for SimObject::objectName.
DefineConsoleType(TypeRectUV , RectF )
TypeRectUV is equivalent to TypeRectF in its usage, it exists for the benefit of GuiInspector, which will provide a custom InspectorField for this type.
Offset(x, cls) offsetof(cls, x)
Global Console Definition Macros
note:If TORQUE_DEBUG is defined, then we gather documentation information, and do some extra sanity checks.
ConsoleConstructor console_autodoc
DECLARE_CALLBACK(returnType, name, args) virtual returnType name ## _callback args
Define a C++ method that calls back to script on an object.
consoleCallback.h
conmethod_return_const() return (
conmethod_return_S32() return (
conmethod_return_F32() return (
conmethod_nullify(val)
conmethod_return_void() (
conmethod_return_bool() return (bool
ConsoleFunctionGroupBegin(groupName, usage) static cfg_ConsoleFunctionGroup_##groupName##_GroupBegin(,#groupName,usage)
ConsoleToolFunction(name, returnType, minArgs, maxArgs, usage1) returnType ctf_##name( *, , *argv); \ cc_##name##_obj(,#name,ctf_##name,usage1,minArgs,maxArgs, true); \ returnType ctf_##name( *, argc, *argv)
ConsoleFunctionGroupEnd(groupName) static cfg_##groupName##_GroupEnd(,#groupName,)
ConsoleNamespace(className, usage) cc_##className##_Namespace(#className, usage)
ConsoleMethodGroupBegin(className, groupName, usage) static cc_##className##_##groupName##_GroupBegin(#className,#groupName,usage)
ConsoleMethodGroupEnd(className, groupName) static cc_##className##_##groupName##_GroupEnd(#className,#groupName,)
ConsoleDoc(text) namespace { \ _sDocFragment( text ); \ }
Add a fragment of auto-doc text to the console API reference.
note:There can only be one ConsoleDoc per source file.
Enumerations
StringTableConstants
Enumerator
- StringTagPrefixByte = 0x01
Magic value prefixed to tagged strings.
Typedefs
typedef const char * StringTableEntry
Variables
bool gWarnUndefinedScriptVariables
Indicates that warnings about undefined script variables should be displayed.
note:This is set and controlled by script.
char * typeValueEmpty
Functions
collapseEscape(char * buf)
dAtob(ConsoleValue & ref)
dAtof(ConsoleValueRef & ref)
dAtoi(ConsoleValueRef & ref)
expandEscape(char * dest, const char * src)
HashPointer(StringTableEntry ptr)