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 iFormListIndex = 0
- int iNestedFormListCount = 0
- FormList formlistCurrent
- bool bIterating = false
- ObjectReference[] objrefarrayFoundItems
- ObjectReference objrefFoundItem
- int iFoundItemsCount = 0
- int iFoundItemIndex = 0
- Event OnInit()
- iNestedFormListCount = AAAFyTy_PhysicsItemsMasterFormList.GetSize()
- RegisterForKey(35)
- EndEvent
- Function ClearTheVariables()
- iFormListIndex = 0
- iNestedFormlistCount = 0
- formlistCurrent = None
- bIterating = false
- objrefarrayFoundItems = None
- objrefFoundItem = None
- iFoundItemsCount = 0
- iFoundItemIndex = 0
- EndFunction
- Event OnKeyDown(int iKeyCode)
- Debug.MessageBox("End Key Pressed")
- if (iKeyCode == 35) && (bIterating == false)
- Debug.MessageBox("Iterating")
- bIterating = true
- While iFormListIndex <= iNestedFormlistCount
- iFormListIndex += 1
- formlistCurrent = AAAFyTy_PhysicsItemsMasterFormList.GetAt(iFormListIndex) as FormList
- objrefarrayFoundItems = PlayerRef.FindAllReferencesOfType(formlistCurrent, 300)
- iFoundItemsCount = objrefarrayFoundItems.Length
- Debug.MessageBox("Found items: "+ iFoundItemsCount as string)
- if iFoundItemsCount > 0
- While iFoundItemIndex <= iFoundItemsCount
- Debug.MessageBox("Setting Motion Type on Index: "+ iFoundItemIndex as string)
- iFoundItemIndex += 1
- objrefFoundItem = objrefarrayFoundItems[iFoundItemIndex] as ObjectReference
- objrefFoundItem.SetMotionType(2, true)
- EndWhile
- EndIf
- EndWhile
- Debug.MessageBox("Done, reseting variables")
- ClearTheVariables()
- EndIf
- EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement