1) each object in torque is either a simobject object or a subclass object of simobject.
2) console function also called method, which is different from other common functions because the first parameter of method is the handle of the object that called the function (console function is different from other functions, the first parameter is the handle of the called object)
3) if the parameter is not enough, torque automatically sets the parameter not provided to a null string. If the parameter is greater than the maximum parameter, torque ignores more parameters.
4) There are three types of objects in torque: 1. Id. This ID is unique. 2. Name. This name can be repeated. 3 handle and this handle are also unique. The object creation syntax is as follows:
% Handle = new objecttype (Name: copysource, arg1 ...... Argn ){}
5) You can use dump () to obtain all the methods of the object. The specific method is
% Object = new simobject ();
% Object. Dump ();
Echo (% object. GETID ());
6) You can directly add member variables and methods to the existing class as follows:
% OBJ = new simobject ();
% Obj. Miss = "miss ";
Echo (% obj. Miss );
Function simobject: Hello ()
{
Echo ("hello ");
}
7) datablocks is actually equivalent to a class in C ++ or a struct in C. Its role is to save a set of fixed data, this set of data templates is used to create the corresponding objects. Once a data block is created, it will not be deleted. The specific creation syntax is as follows:
Datablock classidentifer (nameidentifier)
{
// Classidentifier indicates the name of an existing data block class, And nameidentifier indicates the name of the data block to be created.
}