Chapter 1. TorqueScript: The Only Script You Need to Know
In this chapter we will cover the following topics:
Accessing delimited fields within a string
Iterating on words in a string list
Retrieving components of a variable using accessors
Iterating on objects in a
SimSet
orSimGroup
collectionGetting a random object from a
SimSet
orSimGroup
collectionFinding an object in a
SimSet
orSimGroup
collection using its internal nameExecuting a method on a
SimSet
orSimGroup
collectionCreating a new
SimObject
instanceCreating a new internal name only
SimObject
instanceCreating a new
Datablock
objectCreating a new singleton
Extending a
SimObject
instance using theclass
propertyUsing a variable to access methods or properties of a
SimObject
instanceUsing
call()
to call a variable method on aSimObject
instance with argumentsUsing
call()
to call a variable function with argumentsUsing script arrays as dictionaries
Using
ArrayObject
and custom script sorting callbacksScheduling
SimObject
methodsScheduling functions
Activating and deactivating a package