enderalse/source/scripts/_00e_playerhousing_furniture.psc

49 lines
1.6 KiB
Plaintext
Raw Normal View History

scriptname _00E_Playerhousing_Furniture extends ObjectReference
{A manipulatable housing object while being in the world}
Float Property CustomDistance Auto
{ Custom distance from the player in the placemenet Move Mode }
Float Property OffsetAngleZ Auto
{ Custom offset Z rotation in the placemenet Move Mode }
Float Property OffsetPositionZ Auto
{ Custom offset Z position in the placemenet Move Mode }
Bool Property IsSetPositionIncompatible Auto
{ If the .nif of the object has a bhkCollisionObject with SET_LOCAL flag, SetPosition() or MoveTo() can easily mess this object up in the placement mode. }
Form Property InventoryItem Auto Hidden
_00E_Playerhousing_FurnitureItem Property furnitureItem Auto Hidden
{ OBSOLETE. Left for compatibility with older saves. }
Form Function GetInventoryItem()
If furnitureItem ; Update from the old way of storing the base inventory item
If InventoryItem == None
InventoryItem = furnitureItem.GetBaseObject()
EndIf
furnitureItem = None
EndIf
Return InventoryItem
EndFunction
Function finishPlacement()
; This function is called when the furniture object is at the right position and being placed.
SetMotionType(Motion_Dynamic, True)
; in case we place a mannequin, we need to store its position
ObjectReference myObjRef = self as ObjectReference
If myObjRef as _00E_Playerhousing_MannequinControl
(myObjRef as _00E_Playerhousing_MannequinControl).FinishPlacement()
Else
BlockActivation(true)
Disable()
Utility.Wait(0.1)
Enable()
If myObjRef as _00E_Phasmalist_Workbench
(myObjRef as _00E_Phasmalist_Workbench).FinishPlacement()
EndIf
EndIf
EndFunction