Advertisement
ThoraldGM

HH_QuestScript 20180109-2

Jan 9th, 2018
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 59.82 KB | None | 0 0
  1. Scriptname HH_QuestScript extends Quest
  2. { It just works. }
  3.  
  4. ;/
  5.  
  6. Fallout 4 Papyrus script by ThoraldGM | http://thoraldgm.com | Updated 20180109
  7. Hitchhiker mod: (url pending)
  8.  
  9. SCRIPT SECTIONS:
  10.  
  11. LINE 0031: PROPERTIES
  12. LINE ####: ON INIT
  13. LINE ####: HH START HITCHING
  14. LINE ####: ON MENU OPEN CLOSE EVENT
  15. LINE ####: (OPTIONAL AUTO TIME CHANGE)
  16. LINE ####: (OPTIONAL AUTO WEATHER CHANGE)
  17. LINE ####: HH SPIN CAMERA
  18. LINE ####: ON TIMER
  19. LINE ####: HH STOP SPINNING
  20. LINE ####: HH SET RANDOM DESTINATION
  21. LINE ####: HH IS IN FAR HARBOR
  22. LINE ####: HH IS IN NUKA WORLD
  23. LINE ####: IS FURNITURE
  24. LINE ####: HH TRY TO USE FURNITURE
  25. LINE ####: HH FORCE TIME
  26. LINE ####: HH FORCE WEATHER
  27.  
  28. /;
  29.  
  30. ; ------------------------------------------------------------------------------------------------------------
  31. ; PROPERTIES
  32. ; ------------------------------------------------------------------------------------------------------------
  33.  
  34. ; ************************************************************************************************************
  35. ; Player menu options (23 here. Plus Force Time Now, Force Weather Now, Spin Idle Camera Now, & Restore Defaults):
  36. ; ************************************************************************************************************
  37. GlobalVariable Property HH_OptionAlwaysCOC Auto Mandatory
  38. { Does player prefer CenterOnCell instead of MoveTo? }
  39. GlobalVariable Property HH_OptionCamMaxDistance Auto Mandatory
  40. { Max camera distance (default: 200, vanilla: 150) }
  41. GlobalVariable Property HH_OptionCamMinDistance Auto Mandatory
  42. { Min camera distance (default: 100, vanilla: 0) }
  43. GlobalVariable Property HH_OptionDevTracking Auto Mandatory
  44. { Does player want dev messages? (default: no) }
  45. GlobalVariable Property HH_OptionExcludeDLC Auto Mandatory
  46. { Turn all DLC on/off in random destinations (default: off) }
  47. GlobalVariable Property HH_OptionExcludeFH Auto Mandatory
  48. { Turn Far Harbor DLC on/off in destinations (default: off) }
  49. GlobalVariable Property HH_OptionExcludeNW Auto Mandatory
  50. { Turn Nuka-World DLC on/off in destinations (default: off) }
  51. GlobalVariable Property HH_OptionExcludeVT Auto Mandatory
  52. { Turn Vault-Tec DLC on/off in destinations (default: off) }
  53. GlobalVariable Property HH_OptionFastTravel Auto Mandatory
  54. { Does player want loading screens? (default: yes) }
  55. GlobalVariable Property HH_OptionHeal Auto Mandatory
  56. { Does player want to heal after teleport? (default: no) }
  57. GlobalVariable Property HH_OptionOffsetX Auto Mandatory
  58. { Player can choose X offset (default: 250) }
  59. GlobalVariable Property HH_OptionOffsetY Auto Mandatory
  60. { Player can choose Y offset (default: 250) }
  61. GlobalVariable Property HH_OptionOffsetZ Auto Mandatory
  62. { Player can choose Z offset (default: 500) }
  63. GlobalVariable Property HH_OptionSetTime Auto Mandatory
  64. { Change time after teleport? (default: no) }
  65. GlobalVariable Property HH_OptionSetTimePreference Auto Mandatory
  66. { Preferred game hour (player sets in menu) }
  67. GlobalVariable Property HH_OptionSetWeather Auto Mandatory
  68. { Change weather after teleport? (default: no) }
  69. GlobalVariable Property HH_OptionSetWeatherPreference Auto Mandatory
  70. { Preferred game weather (player sets in menu) }
  71. GlobalVariable Property HH_OptionSitFurniture Auto Mandatory
  72. { If destination is furniture, choose whether to use it (default: yes) }
  73. GlobalVariable Property HH_OptionSpinCamera Auto Mandatory
  74. { Does player want teleport to spin camera? (default: yes) }
  75. GlobalVariable Property HH_OptionSpinDuration Auto Mandatory
  76. { How long should camera spin? (default: 20 seconds) }
  77. GlobalVariable Property HH_OptionSpinGhost Auto Mandatory
  78. { Does player want invulnerable spin? (default: yes) }
  79. GlobalVariable Property HH_OptionTeleportSound Auto Mandatory
  80. { Does player want teleport sound? (default: yes) }
  81. GlobalVariable Property HH_OptionVaultBoy Auto Mandatory
  82. { Does player want Vault Boy animations? (default: yes) }
  83.  
  84. ; ************************************************************************************************************
  85. ; Weather:
  86. ; ************************************************************************************************************
  87. Weather Property DefaultWeather Auto Const Mandatory
  88. { Default weather (outdoors) }
  89. Weather Property CommonwealthClear Auto Const Mandatory
  90. { Clear }
  91. Weather Property CommonwealthDusty Auto Const Mandatory
  92. { Dusty }
  93. Weather Property CommonwealthFoggy Auto Const Mandatory
  94. { Foggy }
  95. Weather Property CommonwealthMisty Auto Const Mandatory
  96. { Misty }
  97. Weather Property CommonwealthMistyRainy Auto Const Mandatory
  98. { Misty Rainy }
  99. Weather Property CommonwealthOvercast Auto Const Mandatory
  100. { Overcast }
  101. Weather Property CommonwealthGSRadstorm Auto Const Mandatory
  102. { Radstorm }
  103. Weather Property CommonwealthRain Auto Const Mandatory
  104. { Rain }
  105.  
  106. ; ************************************************************************************************************
  107. ; Other CK Properties:
  108. ; ************************************************************************************************************
  109. Book Property HH_Map Auto Const Mandatory
  110. { Hitchhiker map }
  111. FormList Property HH_IsFurniture Auto Const Mandatory
  112. { Formlist of formlists of furnitures }
  113. GlobalVariable Property HH_IsSpinning Auto Mandatory
  114. { Is the camera currently spinning? }
  115. GlobalVariable Property HH_PlayerHasFH Auto Mandatory
  116. { Does player have Far Harbor DLC? }
  117. GlobalVariable Property HH_PlayerHasNW Auto Mandatory
  118. { Does player have Nuka-World DLC? }
  119. GlobalVariable Property HH_PlayerHasPC Auto Mandatory
  120. { Is player gaming on a PC? (Prereq for COC option) }
  121. GlobalVariable Property HH_PlayerHasVT Auto Mandatory
  122. { Does player have Vault-Tec DLC? }
  123. GlobalVariable Property HH_Category Auto Mandatory
  124. { Which category did player select? }
  125. GlobalVariable Property HH_TargetID Auto Mandatory
  126. { Which location did player select? }
  127. GlobalVariable Property HH_ShowMenu Auto Mandatory
  128. { Don't show menu when map placed in inventory }
  129. GlobalVariable Property pGameHour Auto Mandatory
  130. { Current game hour (from vanilla CK) }
  131. Perk Property HH_TeleportNoFallDamage Auto Const Mandatory
  132. { Temp perk so teleport falls don't kill player }
  133. Sound Property DRSVertibirdFlightLoadOpen Auto Const Mandatory
  134. { Teleport start sound effect }
  135. Sound Property OBJHijackerTeleportOut2DA Auto Const Mandatory
  136. { Teleport end sound effect }
  137. STATIC Property pXMarker Auto Const Mandatory
  138. { Xmarker (from vanilla CK) }
  139. STATIC Property pXMarkerHeading Auto Const Mandatory
  140. { Xmarker heading (from vanilla CK) }
  141. STATIC Property pCOCMarkerHeading Auto Const Mandatory
  142. { COC Xmarker heading (from vanilla CK) }
  143. WorldSpace Property pCommonwealth Auto Const Mandatory
  144. { Used with GetWorldSpace to check if player is in Commonwealth }
  145.  
  146. ; ************************************************************************************************************
  147. ; Non-CK Variables Defined "Globally"
  148. ; ************************************************************************************************************
  149. Actor Player ; Player actor
  150.  
  151. Int BUS_SHELTERS = 1 ; Category ints (makes code easier to read)
  152. Int DINERS = 2
  153. Int DIVES = 3
  154. Int DRIVE_INS = 4
  155. Int FACTORIES = 5
  156. Int FARMS = 6
  157. Int JUNKYARDS = 7
  158. Int MILITARY_BASES = 8
  159. Int MONUMENTS = 9
  160. Int POWER_LIFTS = 10
  161. Int RED_ROCKETS = 11
  162. Int VAULTS = 12
  163.  
  164. String GO_FILE = "Fallout4.esm" ; Vanilla or DLC destination?
  165.  
  166. Int[] Go_Bus ; Destination arrays (hex refIDs converted to decimal)
  167. Int[] Go_Diner
  168. Int[] Go_Dive
  169. Int[] Go_Drive
  170. Int[] Go_Factory
  171. Int[] Go_Farm
  172. Int[] Go_Junkyard
  173. Int[] Go_Military
  174. Int[] Go_Monument
  175. Int[] Go_Power
  176. Int[] Go_Red
  177. Int[] Go_Vault
  178.  
  179. String[] Coc_Bus ; Destination arrays (CenterOnCell strings)
  180. String[] Coc_Diner
  181. String[] Coc_Dive
  182. String[] Coc_Drive
  183. String[] Coc_Factory
  184. String[] Coc_Farm
  185. String[] Coc_Junkyard
  186. String[] Coc_Military
  187. String[] Coc_Monument
  188. String[] Coc_Power
  189. String[] Coc_Red
  190. String[] Coc_Vault
  191.  
  192. Int[] Visited_Bus ; Arrays track whether destinations have been visited
  193. Int[] Visited_Diner
  194. Int[] Visited_Dive
  195. Int[] Visited_Drive
  196. Int[] Visited_Factory
  197. Int[] Visited_Farm
  198. Int[] Visited_Junkyard
  199. Int[] Visited_Military
  200. Int[] Visited_Monument
  201. Int[] Visited_Power
  202. Int[] Visited_Red
  203. Int[] Visited_Vault
  204.  
  205. ; ------------------------------------------------------------------------------------------------------------
  206. ; EVENT: ON INIT
  207. ; ------------------------------------------------------------------------------------------------------------
  208.  
  209. Event OnInit()
  210. Player = Game.GetPlayer() ; Player actor
  211. Utility.Wait(0.1) ; Wait a moment before using actor
  212.  
  213. If Debug.GetPlatformName() == "PC" ; If player is on PC,
  214. HH_PlayerHasPC.SetValue(1) ; update HasPC global (for COC option)
  215. EndIf
  216.  
  217. If Player.GetItemCount(HH_Map) == 0 ; If player doesn't have hitchhiker map,
  218. HH_ShowMenu.SetValue(0) ; don't show menu when map placed in inventory
  219. Utility.Wait(5) ; wait 5 seconds
  220. Player.AddItem(HH_Map) ; spawn hitchhiker map in player inventory
  221. EndIf
  222.  
  223. ; ********************************************************************************************************
  224. ; Initialize the destination arrays (hex refIDs converted to decimal)
  225. ; ********************************************************************************************************
  226.  
  227. Go_Bus = New Int[10] ; Array of Bus Shelters (hex refIDs converted to decimal)
  228. Go_Bus[0] = 1532935 ; College Square
  229. Go_Bus[1] = 1532909 ; D.B. Tech High School
  230. Go_Bus[2] = 1532960 ; Fallon's Dept Store
  231. Go_Bus[3] = 1532952 ; Fiddler's Green
  232. Go_Bus[4] = 1532899 ; Goodneighbor
  233. Go_Bus[5] = 1532938 ; Kendall Hospital
  234. Go_Bus[6] = 1036336 ; Lexington Station
  235. Go_Bus[7] = 1532931 ; Prospect Park
  236. Go_Bus[8] = 1532877 ; Revere Beach Station
  237. Go_Bus[9] = 1521373 ; University Point
  238.  
  239. Go_Diner = New Int[30] ; Array of Diners (hex refIDs converted to decimal)
  240. Go_Diner[0] = 1122296 ; Anna's Cafe
  241. Go_Diner[1] = 2183822 ; Cambridge Campus Diner
  242. Go_Diner[2] = 230033 ; DLC NW: Cappy's Cafe
  243. Go_Diner[3] = 173685 ; DLC FH: Cliff's Edge Hotel
  244. Go_Diner[4] = 2295674 ; Diamond City Concessions
  245. Go_Diner[5] = 2392399 ; Diamond City Diner
  246. Go_Diner[6] = 2359733 ; Drumlin Diner Concord
  247. Go_Diner[7] = 653229 ; Drumlin Diner East Boston
  248. Go_Diner[8] = 1691105 ; Drumlin Diner Gibson Point Pier
  249. Go_Diner[9] = 384976 ; Drumlin Diner Jamaica Plain
  250. Go_Diner[10] = 331602 ; Drumlin Diner Salem
  251. Go_Diner[11] = 1104080 ; Fens Cafe
  252. Go_Diner[12] = 570559 ; Fentons Food Stuffs
  253. Go_Diner[13] = 227275 ; DLC NW: Fizztop Grille
  254. Go_Diner[14] = 2240433 ; Forest Grove Bakery
  255. Go_Diner[15] = 2240407 ; Forest Grove Crab Shack
  256. Go_Diner[16] = 978915 ; Handy Eats
  257. Go_Diner[17] = 1738539 ; Joe's Spuckies Andrews Station
  258. Go_Diner[18] = 1690551 ; Joe's Spuckies Mean Pastries
  259. Go_Diner[19] = 1406325 ; Joe's Spuckies Postal Square
  260. Go_Diner[20] = 978894 ; Pinelli's Bakery
  261. Go_Diner[21] = 1517424 ; Pizza Parlor
  262. Go_Diner[22] = 12384 ; Power Noodles
  263. Go_Diner[23] = 1463497 ; Quincy Diner
  264. Go_Diner[24] = 426896 ; Revere Beach Ice Cream Parlor
  265. Go_Diner[25] = 664050 ; Shenley's Oyster Bar
  266. Go_Diner[26] = 2337293 ; Slocum's Joe Corporate HQ
  267. Go_Diner[27] = 978903 ; Slocum's Joe Galleria
  268. Go_Diner[28] = 1033582 ; Slocum's Joe Lexington
  269. Go_Diner[29] = 2258997 ; Slocum's Joe Monsignor Plaza
  270.  
  271. Go_Dive = New Int[13] ; Array of Dives (hex refIDs converted to decimal)
  272. Go_Dive[0] = 101019 ; Colonial Taphouse
  273. Go_Dive[1] = 146480 ; Concord Speakeasy
  274. Go_Dive[2] = 280352 ; DLC NW: Doc Phosphate's Saloon
  275. Go_Dive[3] = 406929 ; Dugout Inn
  276. Go_Dive[4] = 2240517 ; Forest Grove Pub Buffet
  277. Go_Dive[5] = 313396 ; Gwinnett Restaurant
  278. Go_Dive[6] = 857986 ; Nahant Bar Restaurant
  279. Go_Dive[7] = 1534528 ; Prost Bar
  280. Go_Dive[8] = 1730482 ; Quincy Liquors
  281. Go_Dive[9] = 993894 ; Shamrock Taphouse
  282. Go_Dive[10] = 13532 ; DLC FH: The Last Plank
  283. Go_Dive[11] = 1094147 ; The Third Rail
  284. Go_Dive[12] = 1835650 ; Ticker Tape Lounge
  285.  
  286. Go_Drive = New Int[12] ; Array of Drive-Ins (hex refIDs converted to decimal)
  287. Go_Drive[0] = 304799 ; DLC NW: Bradberton Amphitheater
  288. Go_Drive[1] = 418374 ; Charles View Amphitheater
  289. Go_Drive[2] = 667329 ; Combat Zone
  290. Go_Drive[3] = 280574 ; DLC NW: Dry Rock Gulch Theater
  291. Go_Drive[4] = 512351 ; Easy City Downs
  292. Go_Drive[5] = 19439 ; DLC FH: Eden Meadows Cinemas
  293. Go_Drive[6] = 348713 ; Memory Den
  294. Go_Drive[7] = 355872 ; Pickman Gallery
  295. Go_Drive[8] = 1762068 ; Starlight Drive-In
  296. Go_Drive[9] = 59247 ; DLC NW: Starlight Interstellar Theater
  297. Go_Drive[10] = 138624 ; DLC NW: The Parlor
  298. Go_Drive[11] = 753389 ; Warren Theater
  299.  
  300. Go_Factory = New Int[12] ; Array of Factories (hex refIDs converted to decimal)
  301. Go_Factory[0] = 1703801 ; Beantown Brewery
  302. Go_Factory[1] = 1401756 ; Choice Chops
  303. Go_Factory[2] = 251478 ; Four Leaf Fishpacking Plant
  304. Go_Factory[3] = 313398 ; Gwinnett Brewery
  305. Go_Factory[4] = 251954 ; Longneck Lukowski's
  306. Go_Factory[5] = 346176 ; Mahkra Fishpacking
  307. Go_Factory[6] = 316735 ; Parsons Creamery
  308. Go_Factory[7] = 227672 ; DLC FH: Super Duper Mart Far Harbor
  309. Go_Factory[8] = 321315 ; Super Duper Mart Lexington
  310. Go_Factory[9] = 1177129 ; Super Duper Mart Quincy
  311. Go_Factory[10] = 94102 ; DLC FH: Vim! Pop Factory
  312. Go_Factory[11] = 103732 ; DLC NW: World of Refreshment
  313.  
  314. Go_Farm = New Int[12] ; Array of Farms (hex refIDs converted to decimal)
  315. Go_Farm[0] = 457355 ; Abernathy Farm
  316. Go_Farm[1] = 635383 ; Breakheart Banks
  317. Go_Farm[2] = 635349 ; County Crossing
  318. Go_Farm[3] = 635295 ; Finch Farm
  319. Go_Farm[4] = 481105 ; Graygarden
  320. Go_Farm[5] = 1762027 ; Greentop Nursery
  321. Go_Farm[6] = 1762039 ; Nordhagen Beach
  322. Go_Farm[7] = 1762043 ; Oberland Station
  323. Go_Farm[8] = 1762062 ; Somerville Place
  324. Go_Farm[9] = 635315 ; Tenpines Bluff
  325. Go_Farm[10] = 1762083 ; The Slog
  326. Go_Farm[11] = 481057 ; Warwick Homestead
  327.  
  328. Go_Junkyard = New Int[20] ; Array of Junkyards (hex refIDs converted to decimal)
  329. Go_Junkyard[0] = 368210 ; Big John's Salvage
  330. Go_Junkyard[1] = 37875 ; DLC FH: Echo Lake Lumber
  331. Go_Junkyard[2] = 2174576 ; FMS Northern Star Wreck
  332. Go_Junkyard[3] = 132938 ; DLC FH: Fringe Cove Docks
  333. Go_Junkyard[4] = 37874 ; DLC FH: Horizon Flight 1207
  334. Go_Junkyard[5] = 1602063 ; Hub City Auto Wreckers
  335. Go_Junkyard[6] = 45519 ; DLC FH: Huntress Island
  336. Go_Junkyard[7] = 341442 ; Jalbert Brothers Disposal
  337. Go_Junkyard[8] = 132698 ; DLC FH: MS Azalea
  338. Go_Junkyard[9] = 95274 ; DLC NW: Nuka-World Junkyard
  339. Go_Junkyard[10] = 327591 ; DLC FH: Oceanarium
  340. Go_Junkyard[11] = 367442 ; Robotics Disposal Ground
  341. Go_Junkyard[12] = 344623 ; DLC FH: Rock Point Camp
  342. Go_Junkyard[13] = 481064 ; Rotten Landfill
  343. Go_Junkyard[14] = 313557 ; Scrap Palace
  344. Go_Junkyard[15] = 712077 ; Skylanes Flight 1665
  345. Go_Junkyard[16] = 2359843 ; Skylanes Flight 1981
  346. Go_Junkyard[17] = 235979 ; DLC FH: Southwest Harbor
  347. Go_Junkyard[18] = 178994 ; USS Riptide Wreck
  348. Go_Junkyard[19] = 418367 ; Wicked Shipping Fleet Lockup
  349.  
  350. Go_Military = New Int[20] ; Array of Military Bases (hex refIDs converted to decimal)
  351. Go_Military[0] = 213829 ; DLC FH: Acadia
  352. Go_Military[1] = 178950 ; Boston Mayoral Shelter
  353. Go_Military[2] = 181849 ; Boston Police Rationing Site
  354. Go_Military[3] = 129959 ; Coast Guard Pier
  355. Go_Military[4] = 178560 ; Federal Ration Stockpile
  356. Go_Military[5] = 1630298 ; Federal Supply Cache 84NE
  357. Go_Military[6] = 764620 ; Fort Hagen
  358. Go_Military[7] = 1761682 ; Fort Hagen Satellite Array
  359. Go_Military[8] = 179188 ; Fort Strong
  360. Go_Military[9] = 420828 ; Listening Post Bravo
  361. Go_Military[10] = 180014 ; National Guard Training Yard
  362. Go_Military[11] = 353903 ; DLC NW: Northpoint Reservoir
  363. Go_Military[12] = 307598 ; DLC NW: Nuka-World Power Plant
  364. Go_Military[13] = 767042 ; Recon Bunker Theta
  365. Go_Military[14] = 180012 ; Revere Satellite Array
  366. Go_Military[15] = 1690999 ; Sentinel Site
  367. Go_Military[16] = 366429 ; S. Boston Military Checkpoint
  368. Go_Military[17] = 701236 ; The Castle
  369. Go_Military[18] = 19733 ; DLC FH: The Nucleus
  370. Go_Military[19] = 481039 ; USAF Satellite Station Olivia
  371.  
  372. Go_Monument = New Int[30] ; Array of Monuments (hex refIDs converted to decimal)
  373. Go_Monument[0] = 2400418 ; Boston Airport
  374. Go_Monument[1] = 1558498 ; Boston Public Library
  375. Go_Monument[2] = 60647 ; DLC FH: Brooke's Head Lighthouse
  376. Go_Monument[3] = 2056500 ; Bunker Hill
  377. Go_Monument[4] = 353976 ; DLC FH: Children of Atom Shrine
  378. Go_Monument[5] = 179040 ; Custom House Tower
  379. Go_Monument[6] = 102400 ; Diamond City
  380. Go_Monument[7] = 482878 ; Fallen Skybridge
  381. Go_Monument[8] = 179106 ; Faneuil Hall
  382. Go_Monument[9] = 319727 ; DLC NW: Ferris Wheel
  383. Go_Monument[10] = 1967529 ; Garden Terrace
  384. Go_Monument[11] = 1732997 ; Gunners Plaza
  385. Go_Monument[12] = 369107 ; Jamaica Plain
  386. Go_Monument[13] = 180861 ; Kingsport Lighthouse
  387. Go_Monument[14] = 294870 ; Mass Fusion Building
  388. Go_Monument[15] = 1604595 ; Mass State House
  389. Go_Monument[16] = 888476 ; Minuteman Statue Lexington
  390. Go_Monument[17] = 119589 ; Minuteman Statue Sanctuary
  391. Go_Monument[18] = 694029 ; Monsignor Plaza
  392. Go_Monument[19] = 119827 ; Museum of Freedom
  393. Go_Monument[20] = 1426695 ; Museum of Witchcraft
  394. Go_Monument[21] = 43815 ; DLC FH: National Park Visitor's Center
  395. Go_Monument[22] = 1761683 ; North End Graveyard
  396. Go_Monument[23] = 227773 ; DLC NW: Nuka-Town USA
  397. Go_Monument[24] = 44469 ; DLC NW: Nuka-World Transit Center
  398. Go_Monument[25] = 122031 ; Old North Church
  399. Go_Monument[26] = 354583 ; DLC FH: Radiant Crest Shrine
  400. Go_Monument[27] = 117479 ; Swan's Pond
  401. Go_Monument[28] = 135473 ; Trinity Tower
  402. Go_Monument[29] = 827566 ; USS Constitution
  403.  
  404. ; NOTE: POWER LIFTS ARE NOT IN ABC ORDER DUE TO BEING GRANDFATHERED IN FROM DISCARDED REFQUEST METHOD
  405.  
  406. Go_Power = New Int[15] ; Array of Power Lifts (hex refIDs converted to decimal)
  407. Go_Power[0] = 1859070 ; Wilderness (-18, -7)
  408. Go_Power[1] = 1858996 ; Mass Pike Interchange
  409. Go_Power[2] = 1911054 ; Wildwood Cemetery
  410. Go_Power[3] = 1835452 ; Tucker Memorial Bridge
  411. Go_Power[4] = 1835429 ; College Square
  412. Go_Power[5] = 1835431 ; Layton Towers
  413. Go_Power[6] = 1835430 ; Financial District
  414. Go_Power[7] = 2062988 ; Union Man's Circle
  415. Go_Power[8] = 2010360 ; Parsons State Asylum
  416. Go_Power[9] = 2016674 ; Sunshine Tidings Co-Op
  417. Go_Power[10] = 1875342 ; Mass Bay Medical Center
  418. Go_Power[11] = 2392999 ; Beacon Hill
  419. Go_Power[12] = 2393009 ; Cabot House
  420. Go_Power[13] = 300729 ; DLC NW: Bradberton North
  421. Go_Power[14] = 335533 ; DLC NW: Bradberton South
  422.  
  423. ; NOTE: RED ROCKETS ARE NOT IN ABC ORDER DUE TO BEING GRANDFATHERED IN FROM DISCARDED REFQUEST METHOD
  424.  
  425. Go_Red = New Int[25] ; Array of Red Rockets (hex refIDs converted to decimal)
  426. Go_Red[0] = 137728 ; Commonwealth (-11, -16)
  427. Go_Red[1] = 1367517 ; Egret Tours Marina
  428. Go_Red[2] = 997755 ; Graygarden
  429. Go_Red[3] = 2048404 ; Electrical Hobbyist's Club
  430. Go_Red[4] = 1082593 ; Lexington Ext 06
  431. Go_Red[5] = 1882831 ; Commonwealth (2, -12)
  432. Go_Red[6] = 1703608 ; Shaw High School
  433. Go_Red[7] = 651672 ; Neponset Park
  434. Go_Red[8] = 1934605 ; Commonwealth (12, 4)
  435. Go_Red[9] = 1846213 ; Commonwealth (-3, -9)
  436. Go_Red[10] = 1418985 ; Glowing Sea
  437. Go_Red[11] = 1898269 ; Commonwealth (-3, 2)
  438. Go_Red[12] = 1186505 ; Lexington Ext 02
  439. Go_Red[13] = 1817557 ; Wilson Atomatoys Factory
  440. Go_Red[14] = 1997542 ; Commonwealth (20, 8)
  441. Go_Red[15] = 1289039 ; Red Rocket Settlement
  442. Go_Red[16] = 1866305 ; Atom Cats Garage
  443. Go_Red[17] = 1845371 ; Commonwealth (2, -10)
  444. Go_Red[18] = 1933571 ; Commonwealth (5, -21)
  445. Go_Red[19] = 421969 ; Nahant Red Rocket
  446. Go_Red[20] = 19823 ; DLC FH: Beaver Creek Red Rocket
  447. Go_Red[21] = 50458 ; DLC FH: Harbor North Red Rocket
  448. Go_Red[22] = 183954 ; DLC FH: Harbor Southwest Red Rocket
  449. Go_Red[23] = 54163 ; DLC NW: Hubologist's Camp
  450. Go_Red[24] = 277523 ; DLC NW: Nuka-World Red Rocket
  451.  
  452. Go_Vault = New Int[10] ; Array of Vaults (hex refIDs converted to decimal)
  453. Go_Vault[0] = 454896 ; Sanctuary Hills
  454. Go_Vault[1] = 1761691 ; Vault-Tec Regional HQ
  455. Go_Vault[2] = 788058 ; Vault 75
  456. Go_Vault[3] = 626404 ; Vault 81 New
  457. Go_Vault[4] = 2035848 ; Vault 81 Old
  458. Go_Vault[5] = 16919 ; DLC VT: Vault 88
  459. Go_Vault[6] = 1247746 ; Vault 95
  460. Go_Vault[7] = 418357 ; Vault 111
  461. Go_Vault[8] = 1789587 ; Vault 114
  462. Go_Vault[9] = 232187 ; DLC FH: Vault 118
  463.  
  464. ; ********************************************************************************************************
  465. ; Initialize the destination arrays (CenterOnCell strings)
  466. ; ********************************************************************************************************
  467.  
  468. Coc_Bus = New String[10] ; Array of Bus Shelters (CenterOnCell strings)
  469. Coc_Bus[0] = "CollegeSquareExt03"
  470. Coc_Bus[1] = "DBTechHighSchoolExt"
  471. Coc_Bus[2] = "FallonsDepartmentStoreExt"
  472. Coc_Bus[3] = "FiddlersGreenExt"
  473. Coc_Bus[4] = "GoodneighborExt02"
  474. Coc_Bus[5] = "KendallHospitalExt"
  475. Coc_Bus[6] = "LexingtonExt06"
  476. Coc_Bus[7] = "ProspectParkExt02"
  477. Coc_Bus[8] = "RevereBeachStationExt04"
  478. Coc_Bus[9] = "UniversityPointExt02"
  479.  
  480. Coc_Diner = New String[30] ; Array of Diners (CenterOnCell strings)
  481. Coc_Diner[0] = "FensBankExt"
  482. Coc_Diner[1] = "CambridgeDiner01"
  483. Coc_Diner[2] = "NukaWorldNukaTownUSA02"
  484. Coc_Diner[3] = "DLC03POI60"
  485. Coc_Diner[4] = "DiamondCityExt"
  486. Coc_Diner[5] = "DiamondCityExt03"
  487. Coc_Diner[6] = "DrumlinDiner"
  488. Coc_Diner[7] = "DNPrimeBridge01"
  489. Coc_Diner[8] = "GibsonPointPierExt02"
  490. Coc_Diner[9] = "JamaicaPlainExt03"
  491. Coc_Diner[10] = "SandyCovesHomeExt"
  492. Coc_Diner[11] = "FensSquare"
  493. Coc_Diner[12] = "QuincyRuinsExt04"
  494. Coc_Diner[13] = "DmndDugoutInn01"
  495. Coc_Diner[14] = "ForestGroveMarshExt02"
  496. Coc_Diner[15] = "ForestGroveMarshExt02"
  497. Coc_Diner[16] = "GeneralAtomicsGalleriaExt02"
  498. Coc_Diner[17] = "SouthBostonExtN"
  499. Coc_Diner[18] = "NorthEndGraveyardEXT"
  500. Coc_Diner[19] = "FinancialPostalSquare"
  501. Coc_Diner[20] = "GeneralAtomicsGalleriaExt"
  502. Coc_Diner[21] = "POIMilitaryMC02"
  503. Coc_Diner[22] = "DiamondCityOrigin"
  504. Coc_Diner[23] = "QuincyRuinsExt04"
  505. Coc_Diner[24] = "RevereBeachStationExt03"
  506. Coc_Diner[25] = "HalluciGenExt"
  507. Coc_Diner[26] = "SlocumsJoeHQExt"
  508. Coc_Diner[27] = "GeneralAtomicsGalleriaExt"
  509. Coc_Diner[28] = "SwitchboardExt"
  510. Coc_Diner[29] = "CambridgeMonsignorPlaza01"
  511.  
  512. Coc_Dive = New String[13] ; Array of Dives (CenterOnCell strings)
  513. Coc_Dive[0] = "DiamondCityUpperStands"
  514. Coc_Dive[1] = "ConcordExt"
  515. Coc_Dive[2] = "NukaWorldWWSaloon"
  516. Coc_Dive[3] = "DiamondCityUpperStands"
  517. Coc_Dive[4] = "ForestGroveMarshExt"
  518. Coc_Dive[5] = "GwinnettBreweryExt"
  519. Coc_Dive[6] = "NahantChapelExt"
  520. Coc_Dive[7] = "BeaconHillPub"
  521. Coc_Dive[8] = "QuincyRuinsExt05"
  522. Coc_Dive[9] = "ShamrockTaphouseExt"
  523. Coc_Dive[10] = "DLC03FarHarborLastPlank"
  524. Coc_Dive[11] = "GoodneighborTheThirdRail"
  525. Coc_Dive[12] = "Theater27TickerTapeLounge"
  526.  
  527. Coc_Drive = New String[12] ; Array of Drive-Ins (CenterOnCell strings)
  528. Coc_Drive[0] = "BradbertonAmphitheater01"
  529. Coc_Drive[1] = "CharlesViewAmphitheaterExt"
  530. Coc_Drive[2] = "CombatZoneExt"
  531. Coc_Drive[3] = "NukaWorldWildWestExt03"
  532. Coc_Drive[4] = "EasyCityDownsExt03"
  533. Coc_Drive[5] = "EdenMeadowsCinemasExt"
  534. Coc_Drive[6] = "GoodneighborTheMemoryDen"
  535. Coc_Drive[7] = "PickmanGalleryExt"
  536. Coc_Drive[8] = "StarlightDriveInExt"
  537. Coc_Drive[9] = "DLC04GalacticZoneExt03"
  538. Coc_Drive[10] = "DLC04HubOperatorLair01"
  539. Coc_Drive[11] = "WarrenTheater01"
  540.  
  541. Coc_Factory = New String[12] ; Array of Factories (CenterOnCell strings)
  542. Coc_Factory[0] = "POIBoS101"
  543. Coc_Factory[1] = "DiamondCityOrigin"
  544. Coc_Factory[2] = "FourLeafFishpackingExt"
  545. Coc_Factory[3] = "GwinnettBreweryExt"
  546. Coc_Factory[4] = "LongneckLukowskisExt"
  547. Coc_Factory[5] = "MahkraFishpackingExt"
  548. Coc_Factory[6] = "ParsonsPOIExt"
  549. Coc_Factory[7] = "BeaverCreekLanesExt" ; Nearest COC to FH Super Duper Mart?
  550. Coc_Factory[8] = "SuperDuperMartExt"
  551. Coc_Factory[9] = "QuincyRuinsExt07"
  552. Coc_Factory[10] = "VimPopFactoryExt"
  553. Coc_Factory[11] = "DLC04BottlingPlant01"
  554.  
  555. Coc_Farm = New String[12] ; Array of Farms (CenterOnCell strings)
  556. Coc_Farm[0] = "AbernathyFarmExt"
  557. Coc_Farm[1] = "BreakheartBanksExt"
  558. Coc_Farm[2] = "CountyCrossing"
  559. Coc_Farm[3] = "FinchFarmExt"
  560. Coc_Farm[4] = "GraygardenHomesteadExt"
  561. Coc_Farm[5] = "GreentopNurseryExt"
  562. Coc_Farm[6] = "NordhagenBeach"
  563. Coc_Farm[7] = "OberlandStation"
  564. Coc_Farm[8] = "SomervillePlace02"
  565. Coc_Farm[9] = "TenPinesBluff"
  566. Coc_Farm[10] = "TheSlogExt02"
  567. Coc_Farm[11] = "WarwickHomesteadExt"
  568.  
  569. Coc_Junkyard = New String[20] ; Array of Junkyards (CenterOnCell strings)
  570. Coc_Junkyard[0] = "BigJohnsSalvageExt"
  571. Coc_Junkyard[1] = "EchoLakeLumberExt"
  572. Coc_Junkyard[2] = "WreckoftheFMSNorthernStarExt"
  573. Coc_Junkyard[3] = "FringeCoveDocksExt"
  574. Coc_Junkyard[4] = "HorizonFlight1207Ext"
  575. Coc_Junkyard[5] = "HubCityAutoWreckersExt"
  576. Coc_Junkyard[6] = "DLC03POI45" ; Nearest COC to Huntress Island is Waves Crest Orphanage
  577. Coc_Junkyard[7] = "JalbertBrothersDisposalExt02"
  578. Coc_Junkyard[8] = "MSAzaleaExt"
  579. Coc_Junkyard[9] = "DLC04JunkyardExt01"
  580. Coc_Junkyard[10] = "DLC03POI54"
  581. Coc_Junkyard[11] = "RoboticsDisposalExt"
  582. Coc_Junkyard[12] = "RockPointCampExt"
  583. Coc_Junkyard[13] = "RottenLandfillExt02"
  584. Coc_Junkyard[14] = "ScrapPalaceExt"
  585. Coc_Junkyard[15] = "GlowingSeaPOIDB01"
  586. Coc_Junkyard[16] = "SkylanesFlightExt04"
  587. Coc_Junkyard[17] = "SouthWestHarborExt"
  588. Coc_Junkyard[18] = "USSRiptideExt02"
  589. Coc_Junkyard[19] = "WickedShippingExt"
  590.  
  591. Coc_Military = New String[20] ; Array of Military Bases (CenterOnCell strings)
  592. Coc_Military[0] = "AcadiaObservatoryExt"
  593. Coc_Military[1] = "BostonMayoralShelterExt"
  594. Coc_Military[2] = "BostonPoliceRationingSiteExt"
  595. Coc_Military[3] = "CoastGuardPierExt"
  596. Coc_Military[4] = "FederalRationStockpileExt"
  597. Coc_Military[5] = "GlowingSeaPOIJS01"
  598. Coc_Military[6] = "FortHagenExt02"
  599. Coc_Military[7] = "FortHagenSatelliteArrayExt"
  600. Coc_Military[8] = "FortStrongExt"
  601. Coc_Military[9] = "ListeningPostBravoExt"
  602. Coc_Military[10] = "NationalGuardTrainingYardExt"
  603. Coc_Military[11] = "DLC04POIBB05" ; Nearest COC to Northpoint Reservoir is Bradberton West
  604. Coc_Military[12] = "NukaWorldPowerPlantExt"
  605. Coc_Military[13] = "ReconBunkerThetaExt02"
  606. Coc_Military[14] = "RevereSatelliteArrayExt"
  607. Coc_Military[15] = "GlowingSeaSentinelSiteExt"
  608. Coc_Military[16] = "SouthBostonCheckpointExt"
  609. Coc_Military[17] = "TheCastleExt"
  610. Coc_Military[18] = "NucleusExt"
  611. Coc_Military[19] = "USAFSatelliteExt"
  612.  
  613. Coc_Monument = New String[30] ; Array of Monuments (CenterOnCell strings)
  614. Coc_Monument[0] = "BostonAirportExt02"
  615. Coc_Monument[1] = "FensIntersection01"
  616. Coc_Monument[2] = "BrookesHeadLighthouseExt"
  617. Coc_Monument[3] = "BunkerHillExt03"
  618. Coc_Monument[4] = "DLC03POI24"
  619. Coc_Monument[5] = "CustomHouseTowerExt"
  620. Coc_Monument[6] = "DiamondCityExt"
  621. Coc_Monument[7] = "TheaterHub360Ext"
  622. Coc_Monument[8] = "FaneuilHallExt"
  623. Coc_Monument[9] = "KiddieKingdomExt02"
  624. Coc_Monument[10] = "USSConstitutionPostExt"
  625. Coc_Monument[11] = "GNNExt"
  626. Coc_Monument[12] = "JamaicaPlainExt"
  627. Coc_Monument[13] = "KingsportLighthouseExt"
  628. Coc_Monument[14] = "MassFusionExt"
  629. Coc_Monument[15] = "VaultTecOfficeExt02"
  630. Coc_Monument[16] = "LexingtonExt03"
  631. Coc_Monument[17] = "RedRocketExt"
  632. Coc_Monument[18] = "CambridgeMonsignorPlazaExt"
  633. Coc_Monument[19] = "ConcordMuseumExt"
  634. Coc_Monument[20] = "SalemExt03"
  635. Coc_Monument[21] = "NationalParkVisitorsCenterExt"
  636. Coc_Monument[22] = "NorthEndGraveyardEXT"
  637. Coc_Monument[23] = "NukaWorldNukaTownUSAMainGate"
  638. Coc_Monument[24] = "DLC04TransitCenterExt"
  639. Coc_Monument[25] = "OldNorthChurchExt"
  640. Coc_Monument[26] = "DLC03POI38"
  641. Coc_Monument[27] = "BostonCommonExt03"
  642. Coc_Monument[28] = "TrinityTowerExt"
  643. Coc_Monument[29] = "USSConstitutionExt"
  644.  
  645. ; NOTE: POWER LIFTS ARE NOT IN ABC ORDER DUE TO BEING GRANDFATHERED IN FROM DISCARDED REFQUEST METHOD
  646.  
  647. Coc_Power = New String[15] ; Array of Power Lifts (CenterOnCell strings)
  648. Coc_Power[0] = "BunkerHillExt03" ; Wilderness (-18, -7)
  649. Coc_Power[1] = "MassPikeInterchangeExt02" ; Mass Pike Interchange
  650. Coc_Power[2] = "POIRJ07" ; Wildwood Cemetery
  651. Coc_Power[3] = "POIJS030" ; Tucker Memorial Bridge
  652. Coc_Power[4] = "CollegeSquareExt" ; College Square
  653. Coc_Power[5] = "LaytonTowersExt" ; Layton Towers
  654. Coc_Power[6] = "Financial22Ext" ; Financial District
  655. Coc_Power[7] = "POISC10" ; Union Man's Circle
  656. Coc_Power[8] = "POIRJ16" ; Parsons State Asylum
  657. Coc_Power[9] = "POIJS021" ; Sunshine Tidings Co-Op
  658. Coc_Power[10] = "CrossRoadsExt01" ; Mass Bay Medical Center
  659. Coc_Power[11] = "BeaconHillApartmentsExt02" ; Beacon Hill
  660. Coc_Power[12] = "CabotHouseExt" ; Cabot House
  661. Coc_Power[13] = "DLC04POIBB06" ; DLC NW: Bradberton North
  662. Coc_Power[14] = "DLC04POIBB01" ; DLC NW: Bradberton South
  663.  
  664. ; NOTE: RED ROCKETS ARE NOT IN ABC ORDER DUE TO BEING GRANDFATHERED IN FROM DISCARDED REFQUEST METHOD
  665.  
  666. ; 20180109: Remove Nahant and AtomatoysFactoryExt duplicates? Destinations contain small building and gas prices sign.
  667. ; (The mod is nearly done, so it would be an excessive amount of work for a non-issue. Will remove if problems occur.)
  668.  
  669. Coc_Red = New String[25] ; Array of Red Rockets (CenterOnCell strings)
  670. Coc_Red[0] = "CoastGuardPierExt03" ; Commonwealth (-11, -16)
  671. Coc_Red[1] = "EgretToursMarinaExt02" ; Egret Tours Marina
  672. Coc_Red[2] = "POIJoel08" ; Graygarden
  673. Coc_Red[3] = "LexingtonExt06" ; Electrical Hobbyist's Club
  674. Coc_Red[4] = "POIMilitaryMC05" ; Lexington Ext 06
  675. Coc_Red[5] = "BigJohnsSalvageExt" ; Commonwealth (2, -12)
  676. Coc_Red[6] = "POISC04" ; Shaw High School
  677. Coc_Red[7] = "NeponsetParkExt03" ; Neponset Park
  678. Coc_Red[8] = "EasyCityDownsExt" ; Commonwealth (12, 4)
  679. Coc_Red[9] = "DiamondCityExt03" ; Commonwealth (-3, -9)
  680. Coc_Red[10] = "GlowingSeaPOIDB05" ; Glowing Sea
  681. Coc_Red[11] = "KendallHospitalExt" ; Commonwealth (-3, 2)
  682. Coc_Red[12] = "LexingtonExt02" ; Lexington Ext 02
  683. Coc_Red[13] = "AtomatoysFactoryExt" ; Wilson Atomatoys Factory
  684. Coc_Red[14] = "Nahant" ; Commonwealth (20, 8)
  685. Coc_Red[15] = "RedRocketExt" ; Red Rocket Settlement
  686. Coc_Red[16] = "AtomCatsGarageExt" ; Atom Cats Garage
  687. Coc_Red[17] = "BackBayCraterExt" ; Commonwealth (2, -10)
  688. Coc_Red[18] = "AtomatoysFactoryExt04" ; Commonwealth (5, -21)
  689. Coc_Red[19] = "Nahant" ; Nahant Red Rocket
  690. Coc_Red[20] = "DLC03POI33" ; DLC FH: Beaver Creek Red Rocket
  691. Coc_Red[21] = "DLC03POI51" ; DLC FH: Harbor North Red Rocket
  692. Coc_Red[22] = "DLC03POI58" ; DLC FH: Harbor Southwest Red Rocket
  693. Coc_Red[23] = "HubologistCampExt" ; DLC NW: Hubologist's Camp
  694. Coc_Red[24] = "DLC04NukaWorldWorkshop" ; DLC NW: Nuka-World Red Rocket
  695.  
  696. Coc_Vault = New String[10] ; Array of Vaults (CenterOnCell strings)
  697. Coc_Vault[0] = "SanctuaryExt02"
  698. Coc_Vault[1] = "VaultTecOfficeExt02"
  699. Coc_Vault[2] = "Vault75"
  700. Coc_Vault[3] = "Vault81Ext"
  701. Coc_Vault[4] = "Vault81Secret"
  702. Coc_Vault[5] = "DLC06VaultWorkshop"
  703. Coc_Vault[6] = "Vault95Ext"
  704. Coc_Vault[7] = "Vault111Ext"
  705. Coc_Vault[8] = "Vault114"
  706. Coc_Vault[9] = "DLC03Vault118"
  707.  
  708. ; ********************************************************************************************************
  709. ; Initialize the arrays that hold visited flags (for hitchhike tracking and granting rewards)
  710. ; ********************************************************************************************************
  711.  
  712. Visited_Bus = New Int[10] ; Declare size of arrays that hold visited flags
  713. Visited_Diner = New Int[30]
  714. Visited_Dive = New Int[13]
  715. Visited_Drive = New Int[12]
  716. Visited_Factory = New Int[12]
  717. Visited_Farm = New Int[12]
  718. Visited_Junkyard = New Int[20]
  719. Visited_Military = New Int[20]
  720. Visited_Monument = New Int[30]
  721. Visited_Power = New Int[15]
  722. Visited_Red = New Int[25]
  723. Visited_Vault = New Int[10]
  724.  
  725. Int x = 1
  726.  
  727. While x < 13
  728. Int[] ArrInit
  729.  
  730. If x == BUS_SHELTERS
  731. ArrInit = Visited_Bus ; Altering array copy changes copy AND the original!
  732. ElseIf x == DINERS
  733. ArrInit = Visited_Diner
  734. ElseIf x == DIVES
  735. ArrInit = Visited_Dive
  736. ElseIf x == DRIVE_INS
  737. ArrInit = Visited_Drive
  738. ElseIf x == FACTORIES
  739. ArrInit = Visited_Factory
  740. ElseIf x == FARMS
  741. ArrInit = Visited_Farm
  742. ElseIf x == JUNKYARDS
  743. ArrInit = Visited_Junkyard
  744. ElseIf x == MILITARY_BASES
  745. ArrInit = Visited_Military
  746. ElseIf x == MONUMENTS
  747. ArrInit = Visited_Monument
  748. ElseIf x == POWER_LIFTS
  749. ArrInit = Visited_Power
  750. ElseIf x == RED_ROCKETS
  751. ArrInit = Visited_Red
  752. Else
  753. ArrInit = Visited_Vault
  754. EndIf
  755.  
  756. Int y = 0
  757. Int ArrLen = ArrInit.Length
  758.  
  759. While y < ArrLen
  760. ArrInit[y] = 0 ; Initialize array element
  761. y += 1 ; and repeat for each element in array
  762. EndWhile
  763.  
  764. x += 1 ; Repeat for the next array in list
  765. EndWhile
  766.  
  767. EndEvent
  768.  
  769. ; ------------------------------------------------------------------------------------------------------------
  770. ; CUSTOM FUNCTION: HH START HITCHING
  771. ; ------------------------------------------------------------------------------------------------------------
  772.  
  773. Function HH_StartHitching()
  774. If HH_OptionDevTracking.GetValue() as Int == 1
  775. Debug.TraceAndBox("Hitchhiker: Started hitching...")
  776. EndIf
  777.  
  778. ; IMPORTANT: Player has no controls after spin if still in book/pip menus, so wait until Pip-Boy is closed
  779.  
  780. UnregisterForMenuOpenCloseEvent("PipboyMenu") ; Cancel any previous button spams
  781. Utility.WaitMenuMode(0.1) ; Give unregister a moment to work
  782. RegisterForMenuOpenCloseEvent("PipboyMenu") ; then handle time change in the event
  783. EndFunction
  784.  
  785. ; ------------------------------------------------------------------------------------------------------------
  786. ; EVENT: ON MENU OPEN CLOSE EVENT
  787. ; ------------------------------------------------------------------------------------------------------------
  788.  
  789. Event OnMenuOpenCloseEvent(string asMenuName, bool abOpening)
  790. UnregisterForMenuOpenCloseEvent("PipboyMenu") ; Cancel player button spams
  791.  
  792. If (asMenuName== "PipboyMenu") ; When the Pip-Boy
  793. If (!abOpening) ; closes,
  794. If HH_OptionTeleportSound.GetValue() as Int == 1 ; If player wants teleport sound,
  795. Int iInstanceID = DRSVertibirdFlightLoadOpen.Play(Player) ; play teleport start sound at player
  796. EndIf
  797.  
  798. ; Thanks to ehtyeci for Vault Boy list: https://forums.nexusmods.com/index.php?/topic/6271136-i-there-a-list-of-perks-in-their-swf-forms/
  799. ; See also: http://powback.com/public/Fallout/?mobile=true
  800.  
  801. If HH_OptionVaultBoy.GetValue() as Int == 1 ; If player wants Vault Boy animations, show thumbs up
  802. Game.ShowPerkVaultBoyOnHUD("Components\\VaultBoys\\Perks\\PerkClip_Default.swf")
  803. EndIf
  804.  
  805. Player.AddPerk(HH_TeleportNoFallDamage) ; IMPORTANT: Temp perk so teleport falls don't kill player!
  806.  
  807. If HH_OptionSpinGhost.GetValue() as Int == 1 ; If player wants no spin damage (default)
  808. If HH_OptionSpinCamera.GetValue() as Int == 1 ; If player wants spincam after teleport,
  809. Player.SetGhost() ; IMPORTANT: Player immune to all damage!
  810. EndIf ; *** Set ghost now BEFORE the spin! ***
  811.  
  812. If HH_OptionDevTracking.GetValue() as Int == 1 ; If player wants dev messages...
  813. If Player.IsGhost() ; If player is a ghost,
  814. Debug.Notification("Hitchhiker: Player is a ghost!") ; display dev message
  815. EndIf
  816. EndIf
  817. EndIf ; NOTE: Unghosting happens in HH_SpinCamera()
  818.  
  819. If HH_OptionVaultBoy.GetValue() as Int == 1 ; If player wants Vault Boy animations, show VANS ride
  820. Game.ShowPerkVaultBoyOnHUD("Components\\VaultBoys\\Perks\\PerkClip_207d1.swf")
  821. EndIf
  822.  
  823. If HH_OptionTeleportSound.GetValue() as Int == 1 ; If player wants teleport sound,
  824. Int iInstanceID = OBJHijackerTeleportOut2DA.Play(Player) ; play teleport end sound at player
  825. EndIf
  826.  
  827. ObjectReference DestinationMarker = Player.PlaceAtMe(pXMarker) ; Dynamically spawn xmarker at player
  828. Int Category = HH_Category.GetValue() as Int ; Retrieve Category from global
  829. Int TargetID = HH_TargetID.GetValue() as Int ; Retrieve TargetID from global
  830.  
  831. If HH_IsInFarHarbor(Category, TargetID) == 1
  832. Go_File = "DLCCoast.esm"
  833. ElseIf HH_IsInNukaWorld(Category, TargetID) == 1
  834. Go_File = "DLCNukaWorld.esm"
  835. ElseIf Category == VAULTS && TargetID == 5
  836. Go_File = "DLCworkshop03.esm"
  837. Else
  838. Go_File = "Fallout4.esm"
  839. EndIf
  840.  
  841. String Coc_Target ; Target placeholder array for COC
  842. ObjectReference TargetObject ; Destination target as ObjectReference
  843.  
  844. If Category == BUS_SHELTERS
  845. Coc_Target = Coc_Bus[TargetID]
  846. TargetObject = Game.GetFormFromFile(Go_Bus[TargetID], Go_File) as ObjectReference
  847. ElseIf Category == DINERS
  848. Coc_Target = Coc_Diner[TargetID]
  849. TargetObject = Game.GetFormFromFile(Go_Diner[TargetID], Go_File) as ObjectReference
  850. ElseIf Category == DIVES
  851. Coc_Target = Coc_Dive[TargetID]
  852. TargetObject = Game.GetFormFromFile(Go_Dive[TargetID], Go_File) as ObjectReference
  853. ElseIf Category == DRIVE_INS
  854. Coc_Target = Coc_Drive[TargetID]
  855. TargetObject = Game.GetFormFromFile(Go_Drive[TargetID], Go_File) as ObjectReference
  856. ElseIf Category == FACTORIES
  857. Coc_Target = Coc_Factory[TargetID]
  858. TargetObject = Game.GetFormFromFile(Go_Factory[TargetID], Go_File) as ObjectReference
  859. ElseIf Category == FARMS
  860. Coc_Target = Coc_Farm[TargetID]
  861. TargetObject = Game.GetFormFromFile(Go_Farm[TargetID], Go_File) as ObjectReference
  862. ElseIf Category == JUNKYARDS
  863. Coc_Target = Coc_Junkyard[TargetID]
  864. TargetObject = Game.GetFormFromFile(Go_Junkyard[TargetID], Go_File) as ObjectReference
  865. ElseIf Category == MILITARY_BASES
  866. Coc_Target = Coc_Military[TargetID]
  867. TargetObject = Game.GetFormFromFile(Go_Military[TargetID], Go_File) as ObjectReference
  868. ElseIf Category == MONUMENTS
  869. Coc_Target = Coc_Monument[TargetID]
  870. TargetObject = Game.GetFormFromFile(Go_Monument[TargetID], Go_File) as ObjectReference
  871. ElseIf Category == POWER_LIFTS
  872. Coc_Target = Coc_Power[TargetID]
  873. TargetObject = Game.GetFormFromFile(Go_Power[TargetID], Go_File) as ObjectReference
  874. ElseIf Category == RED_ROCKETS
  875. Coc_Target = Coc_Red[TargetID]
  876. TargetObject = Game.GetFormFromFile(Go_Red[TargetID], Go_File) as ObjectReference
  877. Else
  878. Coc_Target = Coc_Vault[TargetID]
  879. TargetObject = Game.GetFormFromFile(Go_Vault[TargetID], Go_File) as ObjectReference
  880. EndIf
  881.  
  882. DestinationMarker.MoveTo(TargetObject) ; Move X to target and prepare for player arrival
  883.  
  884. ; ************************************************************************************************
  885. ; Move the player in a manner that best utilizes player's gaming system and declared preferences!
  886. ; ************************************************************************************************
  887.  
  888. WorldSpace OriginWS = Player.GetWorldSpace() ; Check player worldspace
  889. WorldSpace TargetWS = TargetObject.GetWorldSpace() ; Check target worldspace
  890.  
  891. ; If (changing worldspaces AND player is on PC) OR if PC player chose "Always COC" in mod menu...
  892. If ((TargetWS != OriginWS) && (HH_PlayerHasPC.GetValue() as Int == 1)) || (HH_OptionAlwaysCOC.GetValue() as Int == 1)
  893.  
  894. Debug.CenterOnCell(Coc_Target) ; CenterOnCell to target destination
  895.  
  896. If HH_OptionDevTracking.GetValue() as Int == 1
  897. Debug.TraceAndBox("HITCHHIKER: CENTER ON CELL CALLED.")
  898. EndIf
  899.  
  900. Else ; ELSE DO THE USUAL MOVETO ATTEMPT!!!
  901.  
  902. STATIC TargetBase = TargetObject.GetBaseObject() as STATIC ; Check if target base object is an X/COC marker/heading
  903.  
  904. If TargetBase == pXMarker || TargetBase == pXMarkerHeading || TargetBase == pCOCMarkerHeading
  905.  
  906. ; Do not use XYZ offsets if destination is a marker, because teleport placed player directly on the X
  907.  
  908. Else ; else move marker to static ref with XYZ offsets
  909. Float OffsetX = HH_OptionOffsetX.GetValue() ; Player sets X (default 250)
  910. Float OffsetY = HH_OptionOffsetY.GetValue() ; Player sets Y (default 250)
  911. Float OffsetZ
  912.  
  913. If DestinationMarker.IsInInterior() ; If destination is indoors,
  914. OffsetZ = 50 ; don't land in the rafters
  915. Else
  916. OffsetZ = HH_OptionOffsetZ.GetValue() ; Else player sets Z (default 500)
  917. EndIf
  918.  
  919. Utility.Wait(0.1)
  920. DestinationMarker.MoveTo(DestinationMarker, OffsetX, OffsetY, OffsetZ) ; Move marker with XYZ offsets
  921. DestinationMarker.MoveToNearestNavmeshLocation() ; Then move marker to nearest navmesh
  922. EndIf
  923.  
  924. If HH_OptionFastTravel.GetValue() as Int == 1 ; If player wants loading screens,
  925. Game.FastTravel(DestinationMarker) ; move player to marker (with load screens?)
  926.  
  927. If HH_OptionDevTracking.GetValue() as Int == 1
  928. Debug.TraceAndBox("HITCHHIKER: FAST TRAVEL CALLED.")
  929. EndIf
  930. Else
  931. Player.MoveTo(DestinationMarker) ; else move player (with black screen)
  932.  
  933. If HH_OptionDevTracking.GetValue() as Int == 1
  934. Debug.TraceAndBox("HITCHHIKER: MOVETO CALLED.")
  935. EndIf
  936. EndIf
  937. EndIf
  938.  
  939. Utility.Wait(0.1)
  940.  
  941. ; "If TargetObject Is Furniture" caused illegal typecast compiler error, so I wrote a custom function
  942. HH_TryToUseFurniture(Player, TargetObject)
  943.  
  944. ; ********************************************************************************************************
  945. ; Optional automatic time change on teleport
  946. ; ********************************************************************************************************
  947. If HH_OptionSetTime.GetValue() as Int == 1 ; If player wants automatic time change (default is NO)
  948. Int PrefTime = HH_OptionSetTimePreference.GetValue() as Int ; get preferred time
  949. HH_ForceTime(PrefTime) ; and set it
  950. EndIf
  951.  
  952. ; ********************************************************************************************************
  953. ; Optional automatic weather change on teleport
  954. ; ********************************************************************************************************
  955. If !Player.IsInInterior() ; If destination is NOT indoors...
  956. If HH_OptionSetWeather.GetValue() as Int == 1 ; If player wants automatic weather change (default is NO)
  957. Int PrefWeather = HH_OptionSetWeatherPreference.GetValue() as Int ; get preferred weather
  958. HH_ForceWeather(PrefWeather) ; and set it
  959. EndIf
  960. EndIf
  961.  
  962. If HH_OptionSpinCamera.GetValue() as Int == 1 ; If player wants spincam after teleport,
  963. HH_SpinCamera() ; call the custom spin camera function
  964. EndIf
  965.  
  966. StartTimer(10, 2) ; Remove HH_TeleportNoFallDamage perk in 10 seconds
  967. EndIf
  968. EndIf
  969. EndEvent
  970.  
  971. ; ------------------------------------------------------------------------------------------------------------
  972. ; CUSTOM FUNCTION: HH SPIN CAMERA
  973. ; ------------------------------------------------------------------------------------------------------------
  974.  
  975. Function HH_SpinCamera()
  976. Int SpinSeconds
  977. Game.ForceFirstPerson() ; IMPORTANT: Must start/run spin in first person!
  978.  
  979. ; Thx steve40 for distance & setini code
  980. Float CamMinDistance = HH_OptionCamMinDistance.GetValue() ; Player chooses min distance (default: 100, vanilla: 0)
  981. Float CamMaxDistance = HH_OptionCamMaxDistance.GetValue() ; Player chooses max distance (default: 200, vanilla: 150)
  982. Utility.SetIniFloat("fVanityModeMinDist:Camera", CamMinDistance) ; Set min
  983. Utility.SetIniFloat("fVanityModeMaxDist:Camera", CamMaxDistance) ; Set max
  984.  
  985. Utility.Wait(1) ; Wait a moment
  986. Utility.SetINIBool("bForceAutoVanityMode:Camera", true) ; Spin the idle camera around player
  987.  
  988. HH_IsSpinning.SetValue(1) ; Flag player / camera as spinning
  989.  
  990. SpinSeconds = HH_OptionSpinDuration.GetValue() as Int ; Player chooses how long to spin (default: 20 seconds)
  991. StartTimer(SpinSeconds, 1) ; Wait SpinSeconds then call StopSpinning from OnTimer event
  992. EndFunction
  993.  
  994. ; -----------------------------------------------------------------------------------------------------------
  995. ; EVENT: ON TIMER
  996. ; -----------------------------------------------------------------------------------------------------------
  997.  
  998. Event OnTimer(int aiTimerID) ; Cancel timer
  999. If aiTimerID == 1
  1000. HH_StopSpinning() ; Call StopSpinning function
  1001. ElseIf aiTimerID == 2
  1002. Player.RemovePerk(HH_TeleportNoFallDamage) ; Temp perk removed after teleport is safely completed
  1003.  
  1004. If HH_OptionHeal.GetValue() as Int == 1 ; If player wants healed after teleport,
  1005. Player.ResetHealthAndLimbs() ; reset health and limbs
  1006. EndIf
  1007.  
  1008. Else
  1009. ; Placeholder for additional timers
  1010. EndIf
  1011. EndEvent
  1012.  
  1013. ; ------------------------------------------------------------------------------------------------------------
  1014. ; CUSTOM FUNCTION: HH STOP SPINNING
  1015. ; ------------------------------------------------------------------------------------------------------------
  1016.  
  1017. Function HH_StopSpinning()
  1018. CancelTimer(1) ; Cancel any lingering StopSpinning timers
  1019.  
  1020. If Player.IsGhost() ; If player is a ghost,
  1021. Player.SetGhost(false) ; IMPORTANT: Undo player's temporary invulnerability
  1022.  
  1023. If HH_OptionDevTracking.GetValue() as Int == 1 ; If player wants dev messages
  1024. If Player.IsGhost() == false ; If player is no longer a ghost,
  1025. Debug.Notification("Hitchhiker: Player is not a ghost.") ; display dev message
  1026. EndIf
  1027. EndIf
  1028. EndIf
  1029.  
  1030. If HH_IsSpinning.GetValue() as Int == 1 ; If player is spinning,
  1031. Utility.SetINIBool("bForceAutoVanityMode:Camera", false) ; stop spinning
  1032.  
  1033. Game.ForceFirstPerson() ; IMPORTANT: Call this or spin will last forever!
  1034.  
  1035. HH_IsSpinning.SetValue(0) ; Flag player / camera as no longer spinning
  1036.  
  1037. EndIf ; Done with optional spincam effect
  1038. EndFunction
  1039.  
  1040. ; ------------------------------------------------------------------------------------------------------------
  1041. ; CUSTOM FUNCTION: HH SET RANDOM DESTINATION
  1042. ; ------------------------------------------------------------------------------------------------------------
  1043.  
  1044. Function HH_SetRandomDestination(Int Category)
  1045. Int TargetCount
  1046. Int TargetID
  1047. Int ReRoll
  1048. Int ExcludeDLC = HH_OptionExcludeDLC.GetValue() as Int
  1049. Int ExcludeFH = HH_OptionExcludeFH.GetValue() as Int
  1050. Int ExcludeNW = HH_OptionExcludeNW.GetValue() as Int
  1051. Int ExcludeVT = HH_OptionExcludeVT.GetValue() as Int
  1052.  
  1053. If HH_PlayerHasFH.GetValue() as Int == 0
  1054. ExcludeFH = 1
  1055. EndIf
  1056.  
  1057. If HH_PlayerHasNW.GetValue() as Int == 0
  1058. ExcludeNW = 1
  1059. EndIf
  1060.  
  1061. If HH_PlayerHasVT.GetValue() as Int == 0
  1062. ExcludeVT = 1
  1063. EndIf
  1064.  
  1065. If Category == BUS_SHELTERS
  1066. TargetCount = Go_Bus.Length
  1067. ElseIf Category == DINERS
  1068. TargetCount = Go_Diner.Length
  1069. ElseIf Category == DIVES
  1070. TargetCount = Go_Dive.Length
  1071. ElseIf Category == DRIVE_INS
  1072. TargetCount = Go_Drive.Length
  1073. ElseIf Category == FACTORIES
  1074. TargetCount = Go_Factory.Length
  1075. ElseIf Category == FARMS
  1076. TargetCount = Go_Farm.Length
  1077. ElseIf Category == JUNKYARDS
  1078. TargetCount = Go_Junkyard.Length
  1079. ElseIf Category == MILITARY_BASES
  1080. TargetCount = Go_Military.Length
  1081. ElseIf Category == MONUMENTS
  1082. TargetCount = Go_Monument.Length
  1083. ElseIf Category == POWER_LIFTS
  1084. TargetCount = Go_Power.Length
  1085. ElseIf Category == RED_ROCKETS
  1086. TargetCount = Go_Red.Length
  1087. Else
  1088. Category = VAULTS
  1089. TargetCount = Go_Vault.Length
  1090. EndIf
  1091.  
  1092. If HH_OptionDevTracking.GetValue() as Int == 1
  1093. Debug.TraceAndBox("Hitchhiker: Category is " + Category + ".")
  1094. Debug.TraceAndBox("Hitchhiker: TargetCount is " + TargetCount +".")
  1095. EndIf
  1096.  
  1097. ; ********************************************************************************************************
  1098. ; Do-while functionality. Only loops if rolled destination is unwanted DLC.
  1099. ; ********************************************************************************************************
  1100.  
  1101. ReRoll = 1
  1102.  
  1103. While ReRoll == 1
  1104. ReRoll = 0
  1105. TargetID = Utility.RandomInt(0, (TargetCount - 1)) ; Roll random 0 through (count - 1)
  1106.  
  1107. If ExcludeDLC == 1 || ExcludeFH == 1
  1108. If HH_IsInFarHarbor(Category, TargetID) == 1
  1109. ReRoll = 1
  1110. If HH_OptionDevTracking.GetValue() as Int == 1
  1111. Debug.TraceAndBox("Hitchhiker: FH ReRoll.")
  1112. EndIf
  1113. EndIf
  1114. EndIf
  1115.  
  1116. If !ReRoll
  1117. If ExcludeDLC == 1 || ExcludeNW == 1
  1118. If HH_IsInNukaWorld(Category, TargetID) == 1
  1119. ReRoll = 1
  1120. If HH_OptionDevTracking.GetValue() as Int == 1
  1121. Debug.TraceAndBox("Hitchhiker: NW ReRoll.")
  1122. EndIf
  1123. EndIf
  1124. EndIf
  1125. EndIf
  1126.  
  1127. If !ReRoll
  1128. If ExcludeDLC == 1 || ExcludeVT == 1
  1129. If Category == VAULTS && TargetID == 5
  1130. ReRoll = 1
  1131. If HH_OptionDevTracking.GetValue() as Int == 1
  1132. Debug.TraceAndBox("Hitchhiker: VT ReRoll.")
  1133. EndIf
  1134. EndIf
  1135. EndIf
  1136. EndIf
  1137. EndWhile
  1138.  
  1139. HH_Category.SetValue(Category)
  1140. HH_TargetID.SetValue(TargetID)
  1141.  
  1142. If HH_OptionDevTracking.GetValue() as Int == 1
  1143. Debug.TraceAndBox("Hitchhiker: Category is " + Category + ".")
  1144. Debug.TraceAndBox("Hitchhiker: TargetID is " + TargetID +".")
  1145. EndIf
  1146. EndFunction
  1147.  
  1148. ; ------------------------------------------------------------------------------------------------------------
  1149. ; CUSTOM FUNCTION: HH IS IN FAR HARBOR
  1150. ; ------------------------------------------------------------------------------------------------------------
  1151.  
  1152. Int Function HH_IsInFarHarbor(Int Category, Int TargetID)
  1153. Int Located = 0
  1154.  
  1155. If HH_OptionDevTracking.GetValue() as Int == 1
  1156. Debug.TraceAndBox("Hitchhiker: Checking IsInFarHarbor.")
  1157. EndIf
  1158.  
  1159. If Category == BUS_SHELTERS
  1160. ; No FH bus shelters
  1161. ElseIf Category == DINERS
  1162. If TargetID == 3
  1163. Located = 1
  1164. EndIf
  1165. ElseIf Category == DIVES
  1166. If TargetID == 10
  1167. Located = 1
  1168. EndIf
  1169. ElseIf Category == DRIVE_INS
  1170. If TargetID == 5
  1171. Located = 1
  1172. EndIf
  1173. ElseIf Category == FACTORIES
  1174. If TargetID == 7 || TargetID == 10
  1175. Located = 1
  1176. EndIf
  1177. ElseIf Category == FARMS
  1178. ; No FH farms
  1179. ElseIf Category == JUNKYARDS
  1180. Int[] MyArray
  1181. MyArray.Add(1)
  1182. MyArray.Add(3)
  1183. MyArray.Add(4)
  1184. MyArray.Add(6)
  1185. MyArray.Add(8)
  1186. MyArray.Add(10)
  1187. MyArray.Add(12)
  1188. MyArray.Add(17)
  1189. If MyArray.Find(TargetID) >= 0
  1190. Located = 1
  1191. EndIf
  1192. ElseIf Category == MILITARY_BASES
  1193. If TargetID == 0 || TargetID == 18
  1194. Located = 1
  1195. EndIf
  1196. ElseIf Category == MONUMENTS
  1197. If TargetID == 2 || TargetID == 21 || TargetID == 26
  1198. Located = 1
  1199. EndIf
  1200. ElseIf Category == POWER_LIFTS
  1201. ; No FH power lifts
  1202. ElseIf Category == RED_ROCKETS
  1203. If TargetID == 20 || TargetID == 21 || TargetID == 22
  1204. Located = 1
  1205. EndIf
  1206. ElseIf Category == VAULTS
  1207. If TargetID == 9
  1208. Located = 1
  1209. EndIf
  1210. Else
  1211. Debug.TraceAndBox("HITCHHIKER: NULL IN FH CHECK!")
  1212. EndIf
  1213.  
  1214. Return Located
  1215. EndFunction
  1216.  
  1217. ; ------------------------------------------------------------------------------------------------------------
  1218. ; CUSTOM FUNCTION: HH IS IN NUKA WORLD
  1219. ; ------------------------------------------------------------------------------------------------------------
  1220.  
  1221. Int Function HH_IsInNukaWorld(Int Category, Int TargetID)
  1222. Int Located = 0
  1223.  
  1224. If HH_OptionDevTracking.GetValue() as Int == 1
  1225. Debug.TraceAndBox("Hitchhiker: Checking IsInNukaWorld.")
  1226. EndIf
  1227.  
  1228. If Category == BUS_SHELTERS
  1229. ; No NW bus shelters
  1230. ElseIf Category == DINERS
  1231. If TargetID == 2 || TargetID == 13
  1232. Located = 1
  1233. EndIf
  1234. ElseIf Category == DIVES
  1235. If TargetID == 2
  1236. Located = 1
  1237. EndIf
  1238. ElseIf Category == DRIVE_INS
  1239. If TargetID == 0 || TargetID == 3 || TargetID == 9 || TargetID == 10
  1240. Located = 1
  1241. EndIf
  1242. ElseIf Category == FACTORIES
  1243. If TargetID == 11
  1244. Located = 1
  1245. EndIf
  1246. ElseIf Category == FARMS
  1247. ; No NW farms
  1248. ElseIf Category == JUNKYARDS
  1249. If TargetID == 9
  1250. Located = 1
  1251. EndIf
  1252. ElseIf Category == MILITARY_BASES
  1253. If TargetID == 11 || TargetID == 12
  1254. Located = 1
  1255. EndIf
  1256. ElseIf Category == MONUMENTS
  1257. If TargetID == 4 || TargetID == 9 || TargetID == 23 || TargetID == 24
  1258. Located = 1
  1259. EndIf
  1260. ElseIf Category == POWER_LIFTS
  1261. If TargetID == 13 || TargetID == 14
  1262. Located = 1
  1263. EndIf
  1264. ElseIf Category == RED_ROCKETS
  1265. If TargetID == 23 || TargetID == 24
  1266. Located = 1
  1267. EndIf
  1268. ElseIf Category == VAULTS
  1269. ; No NW vaults
  1270. Else
  1271. Debug.TraceAndBox("HITCHHIKER: NULL IN NW CHECK!")
  1272. EndIf
  1273.  
  1274. Return Located
  1275. EndFunction
  1276.  
  1277. ; ------------------------------------------------------------------------------------------------------------
  1278. ; CUSTOM FUNCTION: IS FURNITURE
  1279. ; ------------------------------------------------------------------------------------------------------------
  1280.  
  1281. ; Declared in properties: FormList Property HH_IsFurniture Auto Const Mandatory
  1282. ; NESTED: Property is a formlist of formlists of furnitures. (Total = 302 NPC/Player furniture actions)
  1283. ; [0] IsFurnitureBed 34
  1284. ; [1] IsFurnitureBedWorkshop 20
  1285. ; [2] IsFurnitureBench 19
  1286. ; [3] IsFurnitureChair 57
  1287. ; [4] IsFurnitureCouch 24
  1288. ; [5] IsFurnitureInstitute 11
  1289. ; [6] IsFurnitureInv 6
  1290. ; [7] IsFurnitureKneel 6
  1291. ; [8] IsFurnitureMisc 104
  1292. ; [9] IsFurnitureStand 8
  1293. ; [10] IsFurnitureStool 13
  1294.  
  1295. Int Function IsFurniture(ObjectReference TargetToCheck)
  1296. Form TargetBaseObject = TargetToCheck.GetBaseObject()
  1297. FormList FurnList = HH_IsFurniture ; FormList declared in properties
  1298. FormList NestedList
  1299. Int FurnSize = FurnList.GetSize()
  1300. Int i = 0
  1301. Int Found = 0
  1302.  
  1303. While i < FurnSize && !Found ; Stop loop if form found in furniture
  1304. NestedList = FurnList.GetAt(i) as FormList ; Loop grabs next unchecked formlist
  1305.  
  1306. If NestedList.HasForm(TargetBaseObject) ; If found,
  1307. Found = 1 ; mark as found and break loop
  1308. Else
  1309. i += 1 ; else iterate and keep looking
  1310. EndIf
  1311. EndWhile
  1312.  
  1313. Return Found ; return found (1) or not found (0) to caller
  1314. EndFunction
  1315.  
  1316. ; ------------------------------------------------------------------------------------------------------------
  1317. ; CUSTOM FUNCTION: HH TRY TO USE FURNITURE
  1318. ; ------------------------------------------------------------------------------------------------------------
  1319.  
  1320. Int Function HH_TryToUseFurniture(Actor Person, ObjectReference TargetRef)
  1321. Int DidItWork = 0
  1322.  
  1323. If IsFurniture(TargetRef) == 1 ; If target can be used (chair, wall lean, etc)
  1324. If TargetRef.IsFurnitureInUse(True) == False ; and target is not in use right now (ignores reserved)
  1325. If Person.SnapIntoInteraction(TargetRef) ; then attempt to use the furniture
  1326. DidItWork = 1
  1327. If HH_OptionSpinCamera.GetValue() as Int == 0
  1328. Game.ForceFirstPerson() ; IMPORTANT: Prevents getting stuck in furniture if no spincam
  1329. EndIf
  1330. EndIf
  1331. EndIf
  1332. EndIf
  1333.  
  1334. Return DidItWork
  1335. EndFunction
  1336.  
  1337. ; ------------------------------------------------------------------------------------------------------------
  1338. ; CUSTOM FUNCTION: HH FORCE TIME
  1339. ; ------------------------------------------------------------------------------------------------------------
  1340.  
  1341. Function HH_ForceTime(Int TargetHour)
  1342. Int CurrentHour = pGameHour.GetValue() as Int ; Get current game hour
  1343. Int MyDuration ; and determine how long to wait
  1344.  
  1345. If TargetHour < 0 || TargetHour > 24
  1346. TargetHour = 9
  1347. EndIf
  1348.  
  1349. If CurrentHour < TargetHour ; If target is later in same day,
  1350. MyDuration = TargetHour - CurrentHour ; waiting period is easy to calculate
  1351. Else
  1352. Int Difference = CurrentHour - TargetHour
  1353. MyDuration = 24 - Difference ; else duration is difference subtracted from midnight
  1354. EndIf
  1355.  
  1356. If MyDuration > 0 && MyDuration < 24 ; If duration will result in a time change,
  1357. Game.PassTime(MyDuration) ; wait that duration
  1358. EndIf
  1359. EndFunction
  1360.  
  1361. ; ------------------------------------------------------------------------------------------------------------
  1362. ; CUSTOM FUNCTION: HH FORCE WEATHER
  1363. ; ------------------------------------------------------------------------------------------------------------
  1364.  
  1365. Function HH_ForceWeather(Int MyForecast)
  1366. If !Player.IsInInterior() ; If destination is NOT indoors...
  1367. Weather MyWeather
  1368.  
  1369. If MyForecast == 1
  1370. MyWeather = CommonwealthClear ; Clear
  1371. ElseIf MyForecast == 2
  1372. MyWeather = CommonwealthDusty ; Dusty
  1373. ElseIf MyForecast == 3
  1374. MyWeather = CommonwealthFoggy ; Foggy
  1375. ElseIf MyForecast == 4
  1376. MyWeather = CommonwealthMisty ; Misty
  1377. ElseIf MyForecast == 5
  1378. MyWeather = CommonwealthMistyRainy ; Misty Rainy
  1379. ElseIf MyForecast == 6
  1380. MyWeather = CommonwealthOvercast ; Overcast
  1381. ElseIf MyForecast == 7
  1382. MyWeather = CommonwealthGSRadstorm ; Radstorm
  1383. ElseIf MyForecast == 8
  1384. MyWeather = CommonwealthRain ; Rain
  1385. Else
  1386. MyWeather = DefaultWeather ; Default Weather (outdoors)
  1387. EndIf
  1388.  
  1389. MyWeather.ForceActive() ; Force weather change now
  1390. EndIf
  1391. EndFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement