Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname FyTyTweaks:AAAFyTy_ItemPhysics_HotkeyQuestScript extends Quest
- Actor Property PlayerRef Auto Const
- FormList Property AAAFyTy_PhysicsItemsMasterFormList Auto Const
- Message Property AAAFyTy_ItemPhysics_DoneMessage Auto Const
- int iNestedFormListCount = 0
- bool bIterating = false
- Event OnInit()
- iNestedFormListCount = AAAFyTy_PhysicsItemsMasterFormList.GetSize()
- RegisterForKey(35)
- EndEvent
- Event OnKeyDown(int iKeyCode)
- Debug.MessageBox("End Key Pressed")
- int iFormListIndex = 0
- if (iKeyCode == 35) && (bIterating == false)
- Debug.MessageBox("Iterating")
- bIterating = true
- While iFormListIndex < iNestedFormlistCount
- FormList formlistCurrent = AAAFyTy_PhysicsItemsMasterFormList.GetAt(iFormListIndex) as FormList
- ObjectReference[] objrefarrayFoundItems = PlayerRef.FindAllReferencesOfType(formlistCurrent, 300)
- int iFoundItemsCount = objrefarrayFoundItems.Length
- int iFoundItemIndex = 0
- Debug.MessageBox("Found items: "+ iFoundItemsCount as string)
- if iFoundItemsCount > 0
- While iFoundItemIndex < iFoundItemsCount
- Debug.MessageBox("Setting Motion Type on Index: "+ iFoundItemIndex as string)
- ObjectReference objrefFoundItem = objrefarrayFoundItems[iFoundItemIndex] as ObjectReference
- objrefFoundItem.SetMotionType(2, true)
- iFoundItemIndex += 1
- EndWhile
- EndIf
- iFormListIndex += 1
- EndWhile
- Debug.MessageBox("Done, reseting variables")
- EndIf
- bIterating = false
- EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement