Advertisement
Guest User

ProjectReality Weather Script

a guest
May 20th, 2013
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.96 KB | None | 0 0
  1. scn F3NVWeatherscript
  2.  
  3.  
  4. short DoOnce
  5. short rndperc
  6. short rndweather
  7. short chgWT
  8. short lastDay
  9. short lastDayVar
  10. short currentDay
  11. short currentDayVar
  12. float Time
  13.  
  14.  
  15. begin gamemode
  16.  
  17. set Time to GetCurrentTime
  18.  
  19. If DoOnce == 0
  20.  
  21. player.additem F3NVPRobj 1
  22.  
  23.  
  24. set DoOnce to 1
  25. set NewHour to (gamehour + 3)
  26. set lastday to gamedayspassed
  27. PlaySound F3NVWelcomeSound
  28. ShowMessage F3NVWelcome
  29. set IsPleasantEnabled to 1
  30. set IsCloudyEnabled to 1
  31. set IsRainyEnabled to 1
  32. set IsFoggyEnabled to 1
  33. set IsWindyEnabled to 1
  34. set IsNuclearEnabled to 1
  35. set EyeAdapt to 0
  36. set HHSwitch to 1
  37. set RadSwitch to 0
  38. set DNightsSwitch to 0
  39. set NightSetting to 1
  40. setweather Pleasant01 1
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. endif
  49.  
  50.  
  51. set currentDay to gamedayspassed
  52. set currentDayVar to gamedayspassed
  53.  
  54. if (currentDay - lastDay) >= 1
  55. set NewHour to (gamehour + 3)
  56. set currentweatherpercent to (NewHour - gamehour)
  57. set lastday to currentDay
  58. endif
  59.  
  60. if (currentDayVar - lastDayVar) >= 1
  61. set chgWT to (gamehour + 6)
  62. set lastDayVar to currentDay
  63. endif
  64.  
  65. if (NewHour - gamehour) > 3
  66. set NewHour to (gamehour +3)
  67. endif
  68.  
  69. set currentweatherpercent to (NewHour - gamehour)
  70.  
  71. if getiscurrentweather Rainy05 == 1
  72. set IsHeavyRaining to 1
  73. set IsLightSnowing to 0
  74. set IsHeavySnowing to 0
  75. set IsHot to 0
  76. set IsFoggy to 0
  77. set IsSandstorm to 0
  78. set RadStorm to 0
  79. set sHRSoundREF to 0
  80. set sHRThSoundREF to 1
  81. set sThSoundREF to 0
  82. set sSandINT to 0
  83. set SirenINT to 0
  84. elseif getiscurrentweather Nuke01 == 1
  85. set IsLightSnowing to 0
  86. set IsHeavyRaining to 0
  87. set IsHeavySnowing to 1
  88. set IsHot to 0
  89. set IsFoggy to 0
  90. set IsSandstorm to 0
  91. set RadStorm to 0
  92. set sHRSoundREF to 0
  93. set sHRThSoundREF to 0
  94. set sThSoundREF to 1
  95. set sSandINT to 0
  96. set SirenINT to 0
  97. elseif getiscurrentweather NukeWind == 1
  98. set IsLightSnowing to 0
  99. set IsHeavyRaining to 0
  100. set IsHeavySnowing to 0
  101. set IsHot to 0
  102. set IsFoggy to 1
  103. set IsSandstorm to 1
  104. set RadStorm to 0
  105. set sHRSoundREF to 0
  106. set sHRThSoundREF to 0
  107. set sThSoundREF to 0
  108. set sSandINT to 1
  109. set SirenINT to 0
  110. elseif getiscurrentweather RadStormA == 1 && RadSwitch == 1
  111. set IsLightSnowing to 0
  112. set IsHeavyRaining to 0
  113. set IsHeavySnowing to 0
  114. set IsHot to 0
  115. set IsFoggy to 0
  116. set IsSandstorm to 0
  117. set RadStorm to 1
  118. set sHRSoundREF to 0
  119. set sHRThSoundREF to 0
  120. set sThSoundREF to 0
  121. set sSandINT to 0
  122. set SirenINT to 0
  123. elseif getiscurrentweather RadStormC == 1 && RadSwitch == 1
  124. set IsLightSnowing to 0
  125. set IsHeavyRaining to 1
  126. set IsHeavySnowing to 0
  127. set IsHot to 0
  128. set IsFoggy to 0
  129. set IsSandstorm to 0
  130. set RadStorm to 1
  131. set sHRSoundREF to 0
  132. set sHRThSoundREF to 1
  133. set sThSoundREF to 0
  134. set sSandINT to 0
  135. set SirenINT to 0
  136. elseif getiscurrentweather RadStormB == 1 && RadSwitch == 1
  137. set IsHeavySnowing to 0
  138. set IsHeavyRaining to 0
  139. set IsLightSnowing to 0
  140. set IsHot to 0
  141. set IsFoggy to 0
  142. set IsSandstorm to 0
  143. set RadStorm to 1
  144. set sHRSoundREF to 0
  145. set sHRThSoundREF to 0
  146. set sThSoundREF to 1
  147. set sSandINT to 0
  148. set SirenINT to 1
  149. elseif getiscurrentweather Rainy02 == 1
  150. set IsHeavySnowing to 0
  151. set IsHeavyRaining to 1
  152. set IsLightSnowing to 0
  153. set IsHot to 0
  154. set IsFoggy to 0
  155. set IsSandstorm to 0
  156. set RadStorm to 0
  157. set sHRSoundREF to 0
  158. set sHRThSoundREF to 0
  159. set sThSoundREF to 0
  160. set sSandINT to 0
  161. set SirenINT to 0
  162. elseif getiscurrentweather Rainy03 == 1
  163. set IsHeavySnowing to 0
  164. set IsHeavyRaining to 1
  165. set IsLightSnowing to 0
  166. set IsHot to 0
  167. set IsFoggy to 0
  168. set IsSandstorm to 0
  169. set RadStorm to 0
  170. set sHRSoundREF to 1
  171. set sHRThSoundREF to 0
  172. set sThSoundREF to 0
  173. set sSandINT to 0
  174. set SirenINT to 0
  175. elseif getiscurrentweather Rainy04 == 1
  176. set IsHeavySnowing to 0
  177. set IsHeavyRaining to 1
  178. set IsLightSnowing to 0
  179. set IsHot to 0
  180. set IsFoggy to 0
  181. set IsSandstorm to 0
  182. set RadStorm to 0
  183. set sHRSoundREF to 0
  184. set sHRThSoundREF to 0
  185. set sThSoundREF to 1
  186. set sSandINT to 0
  187. set SirenINT to 0
  188. elseif getiscurrentweather Rainy06 == 1
  189. set IsHeavySnowing to 0
  190. set IsHeavyRaining to 1
  191. set IsLightSnowing to 0
  192. set IsHot to 0
  193. set IsFoggy to 0
  194. set IsSandstorm to 0
  195. set RadStorm to 0
  196. set sHRSoundREF to 1
  197. set sHRThSoundREF to 0
  198. set sThSoundREF to 0
  199. set sSandINT to 0
  200. set SirenINT to 0
  201. elseif getiscurrentweather Rainy08 == 1
  202. set IsHeavySnowing to 0
  203. set IsHeavyRaining to 1
  204. set IsLightSnowing to 0
  205. set IsHot to 0
  206. set IsFoggy to 0
  207. set IsSandstorm to 0
  208. set RadStorm to 0
  209. set sHRSoundREF to 1
  210. set sHRThSoundREF to 0
  211. set sThSoundREF to 0
  212. set sSandINT to 0
  213. set SirenINT to 0
  214. elseif getiscurrentweather Rainy01 == 1
  215. set IsHeavySnowing to 0
  216. set IsHeavyRaining to 0
  217. set IsLightSnowing to 0
  218. set IsHot to 0
  219. set IsFoggy to 0
  220. set IsSandstorm to 0
  221. set RadStorm to 0
  222. set sHRSoundREF to 0
  223. set sHRThSoundREF to 0
  224. set sThSoundREF to 1
  225. set sSandINT to 0
  226. set SirenINT to 0
  227. elseif getiscurrentweather Pleasant01 == 1 && HHSwitch == 1
  228. if Time >= 13.00 && Time < 19.45
  229. set IsHot to 1
  230. else
  231. set IsHot to 0
  232. endif
  233. set IsHeavySnowing to 0
  234. set IsHeavyRaining to 0
  235. set IsLightSnowing to 0
  236. set IsFoggy to 0
  237. set IsSandstorm to 0
  238. set RadStorm to 0
  239. set sHRSoundREF to 0
  240. set sHRThSoundREF to 0
  241. set sThSoundREF to 0
  242. set sSandINT to 0
  243. set SirenINT to 0
  244. elseif getiscurrentweather Pleasant03 == 1 && HHSwitch == 1
  245. if Time >= 13.00 && Time < 19.45
  246. set IsHot to 1
  247. else
  248. set IsHot to 0
  249. endif
  250. set IsHeavySnowing to 0
  251. set IsHeavyRaining to 0
  252. set IsLightSnowing to 0
  253. set IsFoggy to 0
  254. set IsSandstorm to 0
  255. set RadStorm to 0
  256. set sHRSoundREF to 0
  257. set sHRThSoundREF to 0
  258. set sThSoundREF to 0
  259. set sSandINT to 0
  260. set SirenINT to 0
  261. elseif getiscurrentweather Pleasant06 == 1 && HHSwitch == 1
  262. if Time >= 13.00 && Time < 19.45
  263. set IsHot to 1
  264. else
  265. set IsHot to 0
  266. endif
  267. set IsHeavySnowing to 0
  268. set IsHeavyRaining to 0
  269. set IsLightSnowing to 0
  270. set IsFoggy to 0
  271. set IsSandstorm to 0
  272. set RadStorm to 0
  273. set sHRSoundREF to 0
  274. set sHRThSoundREF to 0
  275. set sThSoundREF to 0
  276. set sSandINT to 0
  277. set SirenINT to 0
  278. elseif getiscurrentweather Pleasant07 == 1 && HHSwitch == 1
  279. if Time >= 13.00 && Time < 19.45
  280. set IsHot to 1
  281. else
  282. set IsHot to 0
  283. endif
  284. set IsHeavySnowing to 0
  285. set IsHeavyRaining to 0
  286. set IsLightSnowing to 0
  287. set IsFoggy to 0
  288. set IsSandstorm to 0
  289. set RadStorm to 0
  290. set sHRSoundREF to 0
  291. set sHRThSoundREF to 0
  292. set sThSoundREF to 0
  293. set sSandINT to 0
  294. set SirenINT to 0
  295. elseif getiscurrentweather Pleasant08 == 1 && HHSwitch == 1
  296. if Time >= 13.00 && Time < 19.45
  297. set IsHot to 1
  298. else
  299. set IsHot to 0
  300. endif
  301. set IsHeavySnowing to 0
  302. set IsHeavyRaining to 0
  303. set IsLightSnowing to 0
  304. set IsFoggy to 0
  305. set IsSandstorm to 0
  306. set RadStorm to 0
  307. set sHRSoundREF to 0
  308. set sHRThSoundREF to 0
  309. set sThSoundREF to 0
  310. set sSandINT to 0
  311. set SirenINT to 0
  312. elseif getiscurrentweather Pleasant09 == 1 && HHSwitch == 1
  313. if Time >= 13.00 && Time < 19.45
  314. set IsHot to 1
  315. else
  316. set IsHot to 0
  317. endif
  318. set IsHeavySnowing to 0
  319. set IsHeavyRaining to 0
  320. set IsLightSnowing to 0
  321. set IsFoggy to 0
  322. set IsSandstorm to 0
  323. set RadStorm to 0
  324. set sHRSoundREF to 0
  325. set sHRThSoundREF to 0
  326. set sThSoundREF to 0
  327. set sSandINT to 0
  328. set SirenINT to 0
  329. elseif getiscurrentweather Pleasant10 == 1 && HHSwitch == 1
  330. if Time >= 13.00 && Time < 19.45
  331. set IsHot to 1
  332. else
  333. set IsHot to 0
  334. endif
  335. set IsHeavySnowing to 0
  336. set IsHeavyRaining to 0
  337. set IsLightSnowing to 0
  338. set IsFoggy to 0
  339. set IsSandstorm to 0
  340. set RadStorm to 0
  341. set sHRSoundREF to 0
  342. set sHRThSoundREF to 0
  343. set sThSoundREF to 0
  344. set sSandINT to 0
  345. set SirenINT to 0
  346. elseif getiscurrentweather Foggy01 == 1
  347. set IsFoggy to 1
  348. set IsHeavySnowing to 0
  349. set IsHeavyRaining to 0
  350. set IsLightSnowing to 0
  351. set IsHot to 0
  352. set IsSandstorm to 0
  353. set RadStorm to 0
  354. set sHRSoundREF to 0
  355. set sHRThSoundREF to 0
  356. set sThSoundREF to 0
  357. set sSandINT to 0
  358. set SirenINT to 0
  359.  
  360. else
  361. set IsLightRaining to 0
  362. set IsHeavyRaining to 0
  363. set IsHeavySnowing to 0
  364. set IsHot to 0
  365. set IsFoggy to 0
  366. set IsSandstorm to 0
  367. set RadStorm to 0
  368. set sHRSoundREF to 0
  369. set sHRThSoundREF to 0
  370. set sThSoundREF to 0
  371. set sSandINT to 0
  372. set SirenINT to 0
  373. endif
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380. if chgWT < gamehour
  381.  
  382. set rndperc to getrandompercent
  383.  
  384. if rndperc < 25 && IsPleasantEnabled == 1
  385. set weathertype to 1
  386. elseif rndperc >= 25 && rndperc < 50 && IsCloudyEnabled == 1
  387. set weathertype to 2
  388. elseif rndperc >= 50 && rndperc < 75 && IsRainyEnabled == 1
  389. set weathertype to 3
  390. elseif rndperc >= 75 && rndperc < 76 && IsFoggyEnabled == 1
  391. set weathertype to 4
  392. elseif rndperc >=76 && rndperc < 99 && IsNuclearEnabled == 1
  393. set weathertype to 5
  394. elseif IsWindyEnabled == 1
  395.  
  396. set weathertype to 6
  397. endif
  398.  
  399. endif
  400.  
  401.  
  402.  
  403. If NewHour < gamehour
  404.  
  405. set rndweather to getrandompercent
  406.  
  407.  
  408. if weathertype == 1
  409. if rndweather < 10
  410. setweather Pleasant01 1
  411. elseif rndweather >= 10 && rndweather < 20
  412. setweather Pleasant02 1
  413. elseif rndweather >= 20 && rndweather < 30
  414. setweather Pleasant03 1
  415. elseif rndweather >= 30 && rndweather < 40
  416. setweather Pleasant04 1
  417. elseif rndweather >= 40 && rndweather < 50
  418. setweather Pleasant05 1
  419. elseif rndweather >= 50 && rndweather < 60
  420. setweather Pleasant06 1
  421. elseif rndweather >= 60 && rndweather < 70
  422. setweather Pleasant07 1
  423. elseif rndweather >= 70 && rndweather < 80
  424. setweather Pleasant08 1
  425. elseif rndweather >= 80 && rndweather < 90
  426. setweather Pleasant09 1
  427.  
  428.  
  429. else
  430. setweather Pleasant10 1
  431. endif
  432. set NewHour to (gamehour + 9)
  433.  
  434. endif
  435.  
  436. if weathertype == 2
  437.  
  438.  
  439.  
  440. if rndweather < 10
  441. setweather Cloudy01 1
  442. elseif rndweather >= 10 && rndweather < 20
  443. setweather Cloudy02 1
  444. elseif rndweather >= 20 && rndweather < 30
  445. setweather Cloudy03 1
  446. elseif rndweather >= 30 && rndweather < 40
  447. setweather Cloudy04 1
  448. elseif rndweather >= 40 && rndweather < 50
  449. setweather Cloudy05 1
  450. elseif rndweather >= 50 && rndweather < 60
  451. setweather Cloudy06 1
  452. elseif rndweather >= 60 && rndweather < 70
  453. setweather Cloudy07 1
  454. elseif rndweather >= 70 && rndweather < 80
  455. setweather Cloudy08 1
  456. elseif rndweather >= 80 && rndweather < 90
  457. setweather Cloudy09 1
  458.  
  459. else
  460. setweather Cloudy10 1
  461. endif
  462. set NewHour to (gamehour + 9)
  463.  
  464. endif
  465.  
  466. if weathertype == 3
  467. if rndweather < 15
  468. setweather Rainy01 1
  469. elseif rndweather >= 15 && rndweather < 30
  470. setweather Rainy02 1
  471. elseif rndweather >= 30 && rndweather < 45
  472. setweather Rainy03 1
  473. elseif rndweather >= 45 && rndweather < 60
  474. setweather Rainy06 1
  475. elseif rndweather >= 60 && rndweather < 70
  476. setweather Rainy07 1
  477. elseif rndweather >= 70 && rndweather < 80
  478. setweather Rainy08 1
  479. elseif rndweather >= 90 && rndweather < 90
  480. setweather RadStormA 1
  481.  
  482. else
  483. if RadSwitch == 1
  484. setweather RadStormB 1
  485. else
  486. setweather Rainy01 1
  487. endif
  488. endif
  489. set NewHour to (gamehour + 3)
  490.  
  491. endif
  492.  
  493. if weathertype == 4
  494. setweather Foggy01 1
  495.  
  496. set NewHour to (gamehour + 18)
  497.  
  498. endif
  499.  
  500. if weathertype == 5
  501.  
  502. setweather Nuke01 1
  503. set NewHour to (gamehour + 6)
  504.  
  505. endif
  506.  
  507. if weathertype == 6
  508.  
  509. setweather NukeWind 1
  510. set NewHour to (gamehour + 18)
  511.  
  512. endif
  513.  
  514.  
  515. endif
  516.  
  517.  
  518. if getiscurrentweather Rainy01 == 1 && Time >= 0.10 && Time < 3.00
  519. set IsHeavyRaining to 1
  520. setweather Rainy04 1
  521. elseif getiscurrentweather Rainy03 == 1 && Time >= 0.10 && Time < 3.00
  522. setweather Rainy05 1
  523. endif
  524.  
  525.  
  526. if getiscurrentweather Rainy04 == 1 && Time >= 3.00 && Time < 5.00
  527. setweather Rainy01 1
  528. set NewHour to (gamehour + 3)
  529.  
  530. elseif getiscurrentweather Rainy05 == 1 && Time >= 3.00 && Time < 5.00
  531. setweather Rainy03 1
  532. set NewHour to (gamehour + 3)
  533.  
  534. endif
  535.  
  536. if getiscurrentweather Rainy04 == 1 && Time >= 5.00 && Time < 23.59
  537. fw Rainy01 1
  538. set NewHour to (gamehour + 3)
  539.  
  540. elseif getiscurrentweather Rainy05 == 1 && Time >= 5.00 && Time < 23.59
  541. fw Rainy03 1
  542. set NewHour to (gamehour + 3)
  543.  
  544. endif
  545.  
  546.  
  547.  
  548. if RadSwitch == 0
  549. EnableFastTravel 1
  550. endif
  551.  
  552.  
  553. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement