Difference between revisions of "Creating Multithreaded Skyrim Mods"
Jump to navigation
Jump to search
Creating Multithreaded Skyrim Mods (edit)
Revision as of 01:31, 16 January 2015
, 01:31, 16 January 2015no edit summary
imported>Chesko (Added missing Event registration and Thread ID request) |
imported>Chesko |
||
Line 94: | Line 94: | ||
'''Create Anchor (Object Reference):''' We now want to create a "Future Anchor". This is an XMarker object reference that we will be placing in a far-off, unused cell. You can create your own blank cell, but '''AAADeleteWhenDoneTestJeremy''' is also a good candidate. Wherever you decide to place it, drag an XMarker Static from the Object Window of the Creation Kit into the Render Window and name the reference. We'll name ours '''GuardPlacementFutureAnchor'''. We'll use this to <code>PlaceAtMe()</code> Futures on this object later on. | '''Create Anchor (Object Reference):''' We now want to create a "Future Anchor". This is an XMarker object reference that we will be placing in a far-off, unused cell. You can create your own blank cell, but '''AAADeleteWhenDoneTestJeremy''' is also a good candidate. Wherever you decide to place it, drag an XMarker Static from the Object Window of the Creation Kit into the Render Window and name the reference. We'll name ours '''GuardPlacementFutureAnchor'''. We'll use this to <code>PlaceAtMe()</code> Futures on this object later on. | ||
<gallery widths="240px" heights="120px" perrow="3"> | |||
Image:multithreading-fig1-1.jpg|<b>Fig. 1.1</b>: <br> Create Quest | |||
Image:multithreading-fig1-2.jpg|<b>Fig. 1.2</b>: <br> Create Future Activator | |||
Image:multithreading-fig1-3.jpg|<b>Fig. 1.3</b>: <br> Create Anchor | |||
</gallery> | |||
Line 337: | Line 343: | ||
The PlaceConjuredGuardAsync() function handles making sure that our work gets delegated to an available thread. The function then returns a <code>Future</code> once an available thread is found. Nearly as soon as a thread's <code>get_async()</code> function is called, it begins working, while our calling MagicEffect script is free to do other things in the mean time. | The PlaceConjuredGuardAsync() function handles making sure that our work gets delegated to an available thread. The function then returns a <code>Future</code> once an available thread is found. Nearly as soon as a thread's <code>get_async()</code> function is called, it begins working, while our calling MagicEffect script is free to do other things in the mean time. | ||
'''Compile and attach''' this script to your GuardPlacementQuest. | |||