Advertisement
Guest User

Untitled

a guest
Sep 16th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. Scriptname FyTyTweaks:AAAFyTy_ItemPhysics_HotkeyQuestScript extends Quest
  2.  
  3. Actor Property PlayerRef Auto Const
  4.  
  5. FormList Property AAAFyTy_PhysicsItemsMasterFormList Auto Const
  6.  
  7. Message Property AAAFyTy_ItemPhysics_DoneMessage Auto Const
  8.  
  9.  
  10. int iNestedFormListCount = 0
  11.  
  12. bool bIterating = false
  13.  
  14. Event OnInit()
  15.  
  16. iNestedFormListCount = AAAFyTy_PhysicsItemsMasterFormList.GetSize()
  17. RegisterForKey(35)
  18.  
  19. EndEvent
  20.  
  21. Event OnKeyDown(int iKeyCode)
  22.  
  23. Debug.MessageBox("End Key Pressed")
  24.  
  25. int iFormListIndex = 0
  26.  
  27. if (iKeyCode == 35) && (bIterating == false)
  28.  
  29. Debug.MessageBox("Iterating")
  30.  
  31. bIterating = true
  32.  
  33. While iFormListIndex < iNestedFormlistCount
  34.  
  35. FormList formlistCurrent = AAAFyTy_PhysicsItemsMasterFormList.GetAt(iFormListIndex) as FormList
  36. ObjectReference[] objrefarrayFoundItems = PlayerRef.FindAllReferencesOfType(formlistCurrent, 300)
  37.  
  38. int iFoundItemsCount = objrefarrayFoundItems.Length
  39. int iFoundItemIndex = 0
  40.  
  41. Debug.MessageBox("Found items: "+ iFoundItemsCount as string)
  42.  
  43. if iFoundItemsCount > 0
  44.  
  45. While iFoundItemIndex < iFoundItemsCount
  46.  
  47. Debug.MessageBox("Setting Motion Type on Index: "+ iFoundItemIndex as string)
  48.  
  49. ObjectReference objrefFoundItem = objrefarrayFoundItems[iFoundItemIndex] as ObjectReference
  50. objrefFoundItem.SetMotionType(2, true)
  51.  
  52. iFoundItemIndex += 1
  53.  
  54. EndWhile
  55.  
  56. EndIf
  57.  
  58. iFormListIndex += 1
  59.  
  60. EndWhile
  61.  
  62. Debug.MessageBox("Done, reseting variables")
  63.  
  64. EndIf
  65.  
  66. bIterating = false
  67.  
  68. EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement