Difference between revisions of "Threading Notes (Papyrus)"

line break
imported>Qazaaq
(added images for threads)
imported>Qazaaq
(line break)
Line 35: Line 35:
In the image below, the player is activating a lever.  Because this a nice and cooperative player, he's only activated it once.  The game sends Papyrus a notification of the activate event.  Because our script contains an '''onActivate()''' Event, the game creates a '''"Thread"''', which you can think of as a set of instructions copied from our script. The game queues this thread up, and will process it momentarily.
In the image below, the player is activating a lever.  Because this a nice and cooperative player, he's only activated it once.  The game sends Papyrus a notification of the activate event.  Because our script contains an '''onActivate()''' Event, the game creates a '''"Thread"''', which you can think of as a set of instructions copied from our script. The game queues this thread up, and will process it momentarily.


[[File:PapyrusThreads01.jpg|700px]]
<BR>[[File:PapyrusThreads01.jpg|700px]]<BR>
Very soon - probably on the next frame - the game processes the thread.  Let's pretend that the contents of our onActivate() event look like this:
Very soon - probably on the next frame - the game processes the thread.  Let's pretend that the contents of our onActivate() event look like this:


Anonymous user