[Home]004f

HomePage | RecentChanges | Preferences

create_thread iLabel, argument, argument, ...

Description

Creates a thread at the specified label, and loads its local variables with the arguments.

Parameters

iLabel
The label where the newly created thread will start executing.
argument
Zero or more arguments can be supplied. These can be floats or integers of any type (including labels, handles and models). They will be available to the new thread in its local variables (!0, !1, ...).

Example

create_thread @SomeThread, 1000

...

@SomeThread
  wait !0
  ; Do something every !0 milliseconds (determined by the create_thread).
  jump @SomeThread

Comments

The create_thread opcode allows for very powerful code to be written, thanks to the arguments that can be supplied. You could, for example, write [a thread that will teleport you between two points], and have the coordinates of the points supplied by the arguments. That way, it's possible to set up multiple teleports simply by using multiple create_threads.


CategoryStructuralOpcodes

HomePage | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited October 16, 2004 2:15 pm by CyQ (diff)
Search:
SourceForge.net Logo