Difference between revisions of "User:DavidJCobb/Rotation Library Tutorial"

imported>DavidJCobb
imported>DavidJCobb
(→‎Creating the Dibella Statue: under construction)
Line 1: Line 1:
== Creating the Dibella Statue ==
== Setting up a basic test ==
 
under construction
 
=== Creating our test object ===


In the [[Object Window]], filter to Activators. Right-click in the list pane and select "New." Fill out the dialog box as shown below:
In the [[Object Window]], filter to Activators. Right-click in the list pane and select "New." Fill out the dialog box as shown below:
[[Image:CobbRotLibTut - Defining the statue.png]]


;Name
;Name
Line 54: Line 60:
   EndIf
   EndIf
EndFunction</pre>
EndFunction</pre>
=== Finishing up ===


Now go to any cell (or make your own) and add the new statue to it; place the statue at (0, 0, 0) and do not rotate it. Then, add a Dragon Priest Mask to the cell, and position and rotate it so that it rests on top of the statue's face. Write down the mask's coordinates and rotation.
Now go to any cell (or make your own) and add the new statue to it; place the statue at (0, 0, 0) and do not rotate it. Then, add a Dragon Priest Mask to the cell, and position and rotate it so that it rests on top of the statue's face. Write down the mask's coordinates and rotation.
[[Image:CobbRotLibTut - Setting script properties.png|frame|none|The properties that I use. I don't have any mods that remesh or retexture the Dibella Statue.]]


Edit the base activator's script properties. Set ''pfPositionOffset'' to an array containing the mask's coordinates; set ''pfRotationOffset'' to an array containing the mask's rotation. Edit the placed activator's properties as well: set ''pkChildObject'' to the placed mask itself.
Edit the base activator's script properties. Set ''pfPositionOffset'' to an array containing the mask's coordinates; set ''pfRotationOffset'' to an array containing the mask's rotation. Edit the placed activator's properties as well: set ''pkChildObject'' to the placed mask itself.


=== Test it! ===
Load the cell in-game. You'll most likely find your Dragon Priest Mask lying on the floor near the statue. This is normal; we can't usually disable the mask's physics quickly enough OnInit.
[[File:CobbRotLibTut - Test, initial.png|thumb|none|600px|The test, as it appears initially.]]
Walk up to the statue and activate it a few times to randomize its rotation. (The statue's origin lies on its bottom surface, so it may clip through the ground several times. You may need to use the ''tcl'' command to view it.) You should find that the mask is positioned properly on the statue's face with every random rotation.
<gallery caption="A few examples of random rotations with correct mask positioning.">
File:CobbRotLibTut - Test, 1.png
File:CobbRotLibTut - Test, 2.png
File:CobbRotLibTut - Test, 3.png
</gallery>


== Notes ==
== Notes ==
Anonymous user