Advertisement
ThoraldGM

HH_QuestScript 20180109

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