Advertisement
Guest User

Untitled

a guest
Sep 16th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 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. int iFormListIndex = 0
  10. int iNestedFormListCount = 0
  11. FormList formlistCurrent
  12.  
  13. bool bIterating = false
  14.  
  15. ObjectReference[] objrefarrayFoundItems
  16. ObjectReference objrefFoundItem
  17. int iFoundItemsCount = 0
  18. int iFoundItemIndex = 0
  19.  
  20. Event OnInit()
  21.  
  22. iNestedFormListCount = AAAFyTy_PhysicsItemsMasterFormList.GetSize()
  23. RegisterForKey(35)
  24.  
  25. EndEvent
  26.  
  27. Function ClearTheVariables()
  28.  
  29. iFormListIndex = 0
  30. iNestedFormlistCount = 0
  31. formlistCurrent = None
  32. bIterating = false
  33. objrefarrayFoundItems = None
  34. objrefFoundItem = None
  35. iFoundItemsCount = 0
  36. iFoundItemIndex = 0
  37.  
  38. EndFunction
  39.  
  40. Event OnKeyDown(int iKeyCode)
  41.  
  42. Debug.MessageBox("End Key Pressed")
  43.  
  44. if (iKeyCode == 35) && (bIterating == false)
  45.  
  46. Debug.MessageBox("Iterating")
  47.  
  48. bIterating = true
  49.  
  50. While iFormListIndex <= iNestedFormlistCount
  51.  
  52. iFormListIndex += 1
  53. formlistCurrent = AAAFyTy_PhysicsItemsMasterFormList.GetAt(iFormListIndex) as FormList
  54. objrefarrayFoundItems = PlayerRef.FindAllReferencesOfType(formlistCurrent, 300)
  55.  
  56. iFoundItemsCount = objrefarrayFoundItems.Length
  57.  
  58. Debug.MessageBox("Found items: "+ iFoundItemsCount as string)
  59.  
  60. if iFoundItemsCount > 0
  61.  
  62. While iFoundItemIndex <= iFoundItemsCount
  63.  
  64. Debug.MessageBox("Setting Motion Type on Index: "+ iFoundItemIndex as string)
  65.  
  66. iFoundItemIndex += 1
  67. objrefFoundItem = objrefarrayFoundItems[iFoundItemIndex] as ObjectReference
  68. objrefFoundItem.SetMotionType(2, true)
  69.  
  70. EndWhile
  71.  
  72. EndIf
  73.  
  74. EndWhile
  75.  
  76. Debug.MessageBox("Done, reseting variables")
  77. ClearTheVariables()
  78.  
  79. EndIf
  80.  
  81. EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement