Dota 2 Workshop Tools/Scripting/ThinkerFunctions: Difference between revisions
Jump to navigation
Jump to search
Dysphemism (talk | contribs) No edit summary |
m (moved Dota 2 Workshop Tools/Scripting/Thinkers to Dota 2 Workshop Tools/Scripting/ThinkerFunctions: Updating page name to reflect updated clarified content.) |
(No difference)
|
Revision as of 13:44, 12 August 2014
Think functions can be registered at any time using SetThink
with a function. It is possible to have multiple think functions running on an entity at the same time, but does require the think functions to be named so as not to overlap.
Usage
SetThink( "ThinkerFunction", self, "thinkerNameString", 1 )
ThinkerFunction
- This can be a string of the name of the function to call, or a function object.
The following arguments are optional:
ThinkerFunctionScope
- This can be a table, to cause ThinkerFunction will be indexed on this object. Use this to get member functions as think callbacks.thinkerNameString
- The name of the think slot. Use this when handling multiple thinkers.1
- Number specifying a delay in seconds before the thinker starts to think.
Returning a nil will unregister the thinker and stop it. Returning a number sets the next think time.