Thread Rating:
  • 3 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release UltimateEnvironment
#1
Rainbow 
So yeah this kinda is part of my new mod which I am secretly working on,
But I thought this was so awesome you guys should check it out and might find it very useful as well.
This script uses 2 functions to be commanded, setEnvironment(type) and resetEnvironment()
As you can see you can set a Environment, but reset it as to the normal state as well



This mod (well yeah mod, not exactly a mod) includes 4 types of environments:
  • Night
  • Sunset
  • Nova
  • (bonus)Disco

Night
It's completely dark, You can't even see the sky
can be called with self setEnvironment("night");

Sunset
Beautiful nice sunset.
can be called with self setEnvironment("sunset");

Nova
The world's filled with nova gas, Try to not choke!
can be called with self setEnvironment("nova");

Disco
Burn baby burn! Disco inferno!
can be called with self setEnvironment("disco");


DOWNLOAD

ultimate_environment.gsc
C++ Code
  1. //UltimateEnvironment
  2. //Created by JariZ.nl
  3.  
  4. #include maps\mp\_utility;
  5. #include common_scripts\utility;
  6. #include maps\mp\gametypes\_hud_util;
  7.  
  8.  
  9. setEnvironment(type)
  10. {
  11. resetEnvironment();
  12. level.envType = type;
  13. if(type == "sunset")
  14. {
  15. self setClientDvar("r_lightTweakSunColor", 1);
  16. self setClientDvar("r_skycolorTemp", 1650);
  17. }
  18. else if (type == "nova")
  19. {
  20. self setFog(1);
  21. self nova();
  22. }
  23. else if(type == "night")
  24. {
  25. self setFog(1);
  26. setExpFog(200, 320, 0, 0, 0, 0);
  27. }
  28. //feature added 4thelulz
  29. else if (type == "disco")
  30. {
  31. self setFog(1);
  32. self thread disco();
  33. }
  34. }
  35.  
  36. resetEnvironment()
  37. {
  38. if(level.envType == "sunset")
  39. {
  40. self setClientDvar( "r_lightTweakSunColor", "0.991101 0.947308 0.760525");
  41. self setClientDvar("r_skycolorTemp", 6500);
  42. }
  43. else if (level.envType == "nova")
  44. {
  45. self setClientDvar( "r_lightGridEnableTweaks", 0 );
  46. self setClientDvar( "r_skyTransition", 0 );
  47. self setFog(0);
  48. }
  49. else if (level.envType == "disco")
  50. {
  51. self notify("disco_stop");
  52. self setFog(0);
  53. }
  54. else if (level.envType == "night")
  55. {
  56. self setFog(0);
  57. }
  58.  
  59. }
  60.  
  61. setFog(f)
  62. {
  63. self setClientDvar("r_fog", f);
  64. }
  65.  
  66. disco()
  67. {
  68. self endon("disco_stop");
  69. self endon("disconnect");
  70. while(1)
  71. {
  72. SetExpFog(256, 512, 1, 0, 0, 0);
  73. wait .1;
  74. SetExpFog(256, 512, 0, 1, 0, 0);
  75. wait .1;
  76. SetExpFog(256, 512, 0, 0, 1, 0);
  77. wait .1;
  78. SetExpFog(256, 512, 0.4, 1, 0.8, 0);
  79. wait .1;
  80. SetExpFog(256, 512, 0.8, 0, 0.6, 0);
  81. wait .1;
  82. SetExpFog(256, 512, 1, 1, 0.6, 0);
  83. wait .1;
  84. SetExpFog(256, 512, 1, 1, 1, 0);
  85. wait .1;
  86. SetExpFog(256, 512, 0, 0, 0.8, 0);
  87. wait .1;
  88. SetExpFog(256, 512, 0.2, 1, 0.8, 0);
  89. wait .1;
  90. SetExpFog(256, 512, 0.4, 0.4, 1, 0);
  91. wait .1;
  92. SetExpFog(256, 512, 0, 0, 0, 0);
  93. wait .1;
  94. SetExpFog(256, 512, 0.4, 0.2, 0.2, 0);
  95. wait .1;
  96. SetExpFog(256, 512, 0.4, 1, 1, 0);
  97. wait .1;
  98. SetExpFog(256, 512, 0.6, 0, 0.4, 0);
  99. wait .1;
  100. SetExpFog(256, 512, 1, 0, 0.8, 0);
  101. wait .1;
  102. SetExpFog(256, 512, 1, 1, 0, 0);
  103. wait .1;
  104. SetExpFog(256, 512, 0.6, 1, 0.6, 0);
  105. wait .1;
  106. SetExpFog(256, 512, 1, 0, 0, 0);
  107. wait .1;
  108. SetExpFog(256, 512, 0, 1, 0, 0);
  109. wait .1;
  110. SetExpFog(256, 512, 0, 0, 1, 0);
  111. wait .1;
  112. SetExpFog(256, 512, 0.4, 1, 0.8, 0);
  113. wait .1;
  114. SetExpFog(256, 512, 0.8, 0, 0.6, 0);
  115. wait .1;
  116. SetExpFog(256, 512, 1, 1, 0.6, 0);
  117. wait .1;
  118. SetExpFog(256, 512, 1, 1, 1, 0);
  119. wait .1;
  120. SetExpFog(256, 512, 0, 0, 0.8, 0);
  121. wait .1;
  122. SetExpFog(256, 512, 0.2, 1, 0.8, 0);
  123. wait .1;
  124. SetExpFog(256, 512, 0.4, 0.4, 1, 0);
  125. wait .1;
  126. SetExpFog(256, 512, 0, 0, 0, 0);
  127. wait .1;
  128. SetExpFog(256, 512, 0.4, 0.2, 0.2, 0);
  129. wait .1;
  130. SetExpFog(256, 512, 0.4, 1, 1, 0);
  131. wait .1;
  132. SetExpFog(256, 512, 0.6, 0, 0.4, 0);
  133. wait .1;
  134. SetExpFog(256, 512, 1, 0, 0.8, 0);
  135. wait .1;
  136. SetExpFog(256, 512, 1, 1, 0, 0);
  137. wait .1;
  138. SetExpFog(256, 512, 0.6, 1, 0.6, 0);
  139. }
  140. }
  141.  
  142. nova(half_dist, fog_scale)
  143. {
  144. trans_time = 1;
  145.  
  146. start_dist = 0;
  147.  
  148. if( !IsDefined( half_dist ) )
  149. {
  150. half_dist = getFogSetting();
  151. }
  152.  
  153. fog_r = 0.529412;
  154. fog_g = 0.454902;
  155. fog_b = 0.203922;
  156.  
  157. if( !IsDefined( fog_scale ) )
  158. {
  159. fog_scale = 1.39892;
  160. }
  161.  
  162. if( canUseVolFog() )
  163. {
  164. half_height = 128;
  165. base_height = 512;
  166. sun_col_r = 1;
  167. sun_col_g = 0.407843;
  168. sun_col_b = 0.27451;
  169. sun_dir_x = 0.304335;
  170. sun_dir_y = 0.15607;
  171. sun_dir_z = -0.939693;
  172. sun_start_ang = 0;
  173. sun_stop_ang = 0;
  174. time = trans_time;
  175. max_fog_opacity = 1;
  176.  
  177.  
  178. SetVolFog( start_dist, half_dist, half_height, base_height, fog_r, fog_g, fog_b, fog_scale,
  179. sun_col_r, sun_col_g, sun_col_b, sun_dir_x, sun_dir_y, sun_dir_z, sun_start_ang,
  180. sun_stop_ang, time, max_fog_opacity );
  181. }
  182. else
  183. {
  184. SetExpFog( start_dist, half_dist, fog_r, fog_g, fog_b, fog_scale );
  185. }
  186.  
  187. SetDvar( "r_lightGridEnableTweaks", 1 );
  188. SetDvar( "r_lightGridIntensity", 1.6 );
  189. SetDvar( "r_lightGridContrast", .05 );
  190.  
  191. SetDvar( "r_skyTransition", 1 );
  192.  
  193. VisionSetNaked( "mp_projectnova", 0 );
  194. }
  195.  
  196. canUseVolFog()
  197. {
  198. canUseVolFog = true;
  199. mapname = ToLower( GetDvar( #"mapname" ) );
  200.  
  201. switch( mapname )
  202. {
  203. case "mp_array":
  204. case "mp_mountain":
  205. case "mp_outskirts":
  206. {
  207. canUseVolFog = false;
  208. } break;
  209. }
  210.  
  211. return canUseVolFog;
  212. }
  213.  
  214. getFogSetting()
  215. {
  216. gametype = ToLower( GetDvar( #"g_gametype" ) );
  217. mapname = ToLower( GetDvar( #"mapname" ) );
  218. half_dist = 4096;
  219.  
  220. switch( mapname )
  221. {
  222. case "mp_array":
  223. {
  224. half_dist = 320;
  225. } break;
  226. case "mp_berlinwall2":
  227. {
  228. half_dist = 2048;
  229. } break;
  230. case "mp_cairo":
  231. {
  232. half_dist = 4096;
  233. } break;
  234. case "mp_cosmodrome":
  235. {
  236. half_dist = 5120;
  237. } break;
  238. case "mp_cracked":
  239. {
  240. half_dist = 5120;
  241. } break;
  242. case "mp_crisis":
  243. {
  244. half_dist = 2684;
  245. } break;
  246. case "mp_discovery":
  247. {
  248. half_dist = 2684;
  249. } break;
  250. case "mp_duga":
  251. {
  252. half_dist = 2684;
  253. } break;
  254. case "mp_firingrange":
  255. {
  256. half_dist = 3708;
  257. } break;
  258. case "mp_gridlock":
  259. {
  260. half_dist = 3708;
  261. } break;
  262. case "mp_hanoi":
  263. {
  264. half_dist = 7168;
  265. } break;
  266. case "mp_havoc":
  267. {
  268. half_dist = 2048;
  269. } break;
  270. case "mp_hotel":
  271. {
  272. half_dist = 3708;
  273. } break;
  274. case "mp_kowloon":
  275. {
  276. half_dist = 6656;
  277. } break;
  278. case "mp_mountain":
  279. {
  280. half_dist = 256;
  281. } break;
  282. case "mp_nuked":
  283. {
  284. half_dist = 3072;
  285. } break;
  286. case "mp_outskirts":
  287. {
  288. half_dist = 512;
  289. } break;
  290. case "mp_radiation":
  291. {
  292. half_dist = 2048;
  293. } break;
  294. case "mp_russianbase":
  295. {
  296. half_dist = 2048;
  297. } break;
  298. case "mp_stadium":
  299. {
  300. half_dist = 3072;
  301. } break;
  302. case "mp_villa":
  303. {
  304. half_dist = 1024;
  305. } break;
  306. case "mp_zoo":
  307. {
  308. half_dist = 5120;
  309. } break;
  310. }
  311.  
  312. return half_dist;
  313. }


Using it in your mod
Using it in your mod couldn't be easier,
Just save the file (ultimate_environment.gsc) in the root of your mod,
and add #include ultimate_environment; to your includes of your main script.
When you want to change the environment, simply call (for example) self setEnvironment("nova");

But jari? how do I test it?
- Use my key loop used in this video,
Weather can be controlled with keys 4, 5, 6, 7
Resetted with F
You need to save ultimate_environment.gsc in the root of your mod folder and follow these instructions:

C++ Code
  1. //add this to your includes
  2. #include ultimate_environment;
  3.  
  4. //Place "self thread Key()" in the onPlayerSpawned function in your mod, after for( ;; )
  5.  
  6. //add this function to your mod
  7. Key()
  8. {
  9. self endon( "disconnect" );
  10. self endon( "killed_player" );
  11. self endon( "death" );
  12. level endon( "game_ended" );
  13. while(1)
  14. {
  15. wait ( 0.05 );
  16. if( self SecondaryOffhandButtonPressed()) //4
  17. {
  18. self iprintlnbold("night activated");
  19. self setEnvironment("night");
  20. }
  21. if( self ActionSlotThreeButtonPressed() ) //5
  22. {
  23. self iprintlnbold("nova activated");
  24. self setEnvironment("nova");
  25. }
  26. if( self ActionSlotFourButtonPressed() ) //6
  27. {
  28. self iprintlnbold("sunset activated");
  29. self setEnvironment("sunset");
  30. }
  31. if( self ActionSlotTwoButtonPressed() ) //7
  32. {
  33. self iprintlnbold("disco activated");
  34. self setEnvironment("disco");
  35. }
  36. if( self UseButtonPressed() ) // F
  37. {
  38. self iprintlnbold("Environment has been reset");
  39. self resetEnvironment();
  40. }
  41. }
  42. }


Credits:
- @SparkyMcSparks - Project Nova
- @AZUMIKKEL / @Eekhoorn - RtD
- @Scripts18 - Awesome dude

it's 6:30 in the morning right now, i'm going to bed Awesome

BUG: Maps that use fog *cough*summit
Can look uglier because of the fog that has been killed due to resetting of the environment
Reply

#2
nice work man Smile
Reply

#3
How to install BTW, Can't Download!
Reply

#4
(08-17-2011, 06:54)JLTV Wrote: How to install BTW, Can't Download!

its not a download its a code for a mod
+rep'd you!!!
[Image: m9ljxv.jpg]
Reply

#5
(08-17-2011, 07:05)skata3000 Wrote:
(08-17-2011, 06:54)JLTV Wrote: How to install BTW, Can't Download!

its not a download its a code for a mod
+rep'd you!!!

Could Teach me How to install???

Reply

#6
(08-17-2011, 07:13)JLTV Wrote:
(08-17-2011, 07:05)skata3000 Wrote:
(08-17-2011, 06:54)JLTV Wrote: How to install BTW, Can't Download!

its not a download its a code for a mod
+rep'd you!!!

Could Teach me How to install???

look in tutorials it has all you need to learn (: + rep me if i helped and thank me (: lol
@JLTV i would help you but im in the middle of working on my hackintosh (:
[Image: m9ljxv.jpg]
Reply

#7
GJ jariz Wink
Black Ops Mods:

RPG(rocket launcher) mod
Get the Specials

Old aliasses:

eliteCVDelite
CVD

Reply

#8
nice disco epileptic flash Wink
Reply

#9
Looking good! Maybe a limbodance pole and a dancefloor? Saterday night Fever Tongue
Reply

#10
pretty sweet
--
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.