Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.39 KB | None | 0 0
  1. /*
  2. Fog script v1.62
  3. Made by Rockhount[BAfH] (visit us on http://www.bafh.eu/ )
  4.  
  5. Install:
  6. Open the editor, create a new unit/object and put the example into the init of the unit, after that save the mission.
  7. Then open the folder .../Dokuments/ArmA 2 Other Profiles/Nickname/missions/misisonsname and copy the script into the folder.
  8.  
  9. example: null=[l1,100,11,10,3,7,-0.3,0.1,0.5,1,1,1,13,12,15,true,2,2.1,0.1,4,6,0,3.5,17.5] execFSM "Fog.fsm";
  10. l1 = name of unit (use "" for markers and when you on a multiplayer session only want to set the fog around the player: run the script once! with 'Player' (not 'this' and not 'name of the unit/object'!!!), example: null=[Player,200,10,... )
  11. If the unit/building was destroyed/died or the marker was deleted, the script will exit automatically!
  12. 100 = Maximumdistance
  13. 11 = Minimumdistance
  14. 10 = Count of clouds
  15. 3 = Minimumsize of clouds
  16. 7 = Maximumsize of clouds
  17. -0.3 = Height of clouds (must be a bit below the ground to look realistic)
  18. 0.1 = Respawntime of clouds
  19. 0.5 = Transparency
  20. 1,1,1 = Color of clouds
  21. 13 = Remove-speed of clouds
  22. 12 = Minimumlifetime of clouds
  23. 15 = Maximumlifetime of clouds
  24. true = The fog will be effected by wind (for no wind effect: false)
  25. 2 = Windstrength (acts only when the wind effect is 'true')
  26. 2.1 = Random-direction-period(in seconds) (acts only when the wind effect is 'true')
  27. 0.1 = Random-direction-intensity (acts only when the wind effect is 'true')
  28. 4,6,0 = Move-direction-speed (x,y,z) - same effect as wind, but constant and adjustable(acts only when the wind effect is 'false')
  29. 3.5 = Stardaytime (the fog will spawn when the ingametime is 03:30)
  30. 17.5 = Enddaytime (the fog will spawn when the ingametime is 17:30)
  31. RandomDirectionPeriod 2.1 with RandomDirectionIntensity 0.1 means that 0.1 will be added to the direction-speed (x,y,z-randomized) of a moving-cloud every 2.1 seconds.
  32.  
  33. An example for norrins revive-script:
  34. revive_init.sqf:
  35. NORRNCustomExec1 ="null=[Player,100,11,10,3,7,-0.3,0.1,0.5,1,1,1,13,12,15,true,1,2.1,0.1,4,6,0,0,24] execFSM ""Fog.fsm"";"; // Exec1 occurs following being revived
  36. NORRNCustomExec3 ="null=[Player,100,11,10,3,7,-0.3,0.1,0.5,1,1,1,13,12,15,true,1,2.1,0.1,4,6,0,0,24] execFSM ""Fog.fsm"";"; // Exec3 occurs when you spawn at base
  37. */
  38. class FSM
  39. {
  40. fsmName = "Fog";
  41. class States
  42. {
  43. class Start
  44. {
  45. name = "Start";
  46. init = "private [""_Center"",""_xdistanz"",""_mdistanz"",""_dichte"",""_msize"",""_xsize"",""_height"",""_zeit"",""_transparency"",""_col1"",""_col2"",""_col3"",""_mlifetime"",""_xlifetime"",""_spawn"",""_wind"",""_windstrength"",""_forward2"",""_right2"",""_up"",""_dirPeroid"",""_dirIntensity"",""_mtime"",""_xtime""];" \n
  47. "_Center = _this select 0;" \n
  48. "_xdistanz = if (count _this > 1) then {_this select 1} else {80};" \n
  49. "_mdistanz = if (count _this > 2) then {_this select 2} else {10};" \n
  50. "_dichte = if (count _this > 3) then {_this select 3} else {10};" \n
  51. "_msize = if (count _this > 4) then {_this select 4} else {3};" \n
  52. "_xsize = if (count _this > 5) then {_this select 5} else {7};" \n
  53. "_height = if (count _this > 6) then {_this select 6} else {-0.3};" \n
  54. "_zeit = if (count _this > 7) then {_this select 7} else {0.1};" \n
  55. "_transparency = if (count _this > 8) then {_this select 8} else {0.5};" \n
  56. "_col1 = if (count _this > 9) then {_this select 9} else {1};" \n
  57. "_col2 = if (count _this > 10) then {_this select 10} else {1};" \n
  58. "_col3 = if (count _this > 11) then {_this select 11} else {1};" \n
  59. "_spawn = if (count _this > 12) then {_this select 12} else {15 + (random 1)};" \n
  60. "_mlifetime = if (count _this > 13) then {_this select 13} else {8 + (random 1)};" \n
  61. "_xlifetime = if (count _this > 14) then {_this select 14} else {15 + (random 1)};" \n
  62. "_wind = if (count _this > 15) then {_this select 15} else {true};" \n
  63. "_windstrength = if ((count _this > 16) && _wind) then {_this select 16} else {1};" \n
  64. "_dirPeroid = if ((count _this > 17) && _wind) then {_this select 17} else {0};" \n
  65. "_dirIntensity = if ((count _this > 18) && _wind) then {_this select 18} else {0};" \n
  66. "_forward2 = if ((count _this > 19) && (!(_wind))) then {_this select 19} else {0};" \n
  67. "_right2 = if ((count _this > 20) && (!(_wind))) then {_this select 20} else {0};" \n
  68. "_up = if ((count _this > 21) && (!(_wind))) then {_this select 21} else {0};" \n
  69. "_mtime = if (count _this > 22) then {_this select 22} else {0};" \n
  70. "_xtime = if (count _this > 23) then {_this select 23} else {24};";
  71. precondition = "";
  72. class Links
  73. {
  74. class isDedicated
  75. {
  76. priority = 0.000000;
  77. to="End";
  78. precondition = "";
  79. condition="isDedicated";
  80. action="";
  81. };
  82. class not_isDedicated
  83. {
  84. priority = 0.000000;
  85. to="Fog";
  86. precondition = "";
  87. condition="!(isDedicated)";
  88. action="";
  89. };
  90. };
  91. };
  92. class Fog
  93. {
  94. name = "Fog";
  95. init = "private [""_time"",""_zeit"",""_x"",""_height"",""_radius"",""_size"",""_msize"",""_xsize"",""_randomdir"",""_CC"",""_Center"",""_xdistanz"",""_mdistanz"",""_dichte"",""_transparency"",""_col1"",""_col2"",""_col3"",""_Pos"",""_lifetime"",""_mlifetime"",""_xlifetime"",""_spawn"",""_wind"",""_windstrength"",""_right"",""_forward"",""_up"",""_forward2"",""_right2"",""_dirPeroid"",""_dirIntensity"",""_mtime"",""_xtime""];" \n
  96. "_time = time + _zeit;" \n
  97. "if (typename _Center == typename """") then {_Pos = getMarkerpos _Center} else {_Pos = getPos _Center};" \n
  98. "if (_wind) then {_right = (wind select 0) * _windstrength;_forward = (wind select 1) * _windstrength} else {_right = _right2;_forward = _forward2};" \n
  99. "if ((daytime > _mtime) && (daytime < _xtime)) then {" \n
  100. "for [{_x=1},{_x<=_dichte},{_x=_x+1}] do {" \n
  101. "_radius= _mdistanz + random (_xdistanz - _mdistanz);" \n
  102. "_CC = [_col1,_col2,_col3,.3*_transparency];" \n
  103. "_size = _msize + random (_xsize - _msize);" \n
  104. "_randomdir = random 360;" \n
  105. "_lifetime = _mlifetime + random (_xlifetime - _mlifetime);" \n
  106. "drop [""\A3\data_f\cl_basic"","""",""Billboard"",_spawn, _lifetime,[(_Pos select 0)+_radius*sin _randomdir,(_Pos select 1)+_radius*cos _randomdir,_height],[_right,_forward,_up],5,0.2,0.1568,0,[_size],[[_col1,_col2,_col3,0],_CC,_CC,_CC,_CC,_CC,_CC,[_col1,_col2,_col3,0]],[0],_dirPeroid,_dirIntensity,"""", """",""""];" \n
  107. "};" \n
  108. "} else { " \n
  109. "_time = time + 5;" \n
  110. "};";
  111. precondition = "";
  112. class Links
  113. {
  114. class if_object
  115. {
  116. priority = 0.000000;
  117. to="dummy";
  118. precondition = "";
  119. condition="!(typename _Center == typename """")";
  120. action="";
  121. };
  122. class if_marker
  123. {
  124. priority = 0.000000;
  125. to="dummy_1";
  126. precondition = "";
  127. condition="typename _Center == typename """"";
  128. action="";
  129. };
  130. };
  131. };
  132. class End
  133. {
  134. name = "End";
  135. init = "";
  136. precondition = "";
  137. class Links
  138. {
  139. };
  140. };
  141. class dummy
  142. {
  143. name = "dummy";
  144. init = "";
  145. precondition = "";
  146. class Links
  147. {
  148. class wait
  149. {
  150. priority = 0.000000;
  151. to="Fog";
  152. precondition = "";
  153. condition="time > _time";
  154. action="";
  155. };
  156. class if_object_or_unit
  157. {
  158. priority = 0.000000;
  159. to="End";
  160. precondition = "";
  161. condition="!(alive _Center)";
  162. action="";
  163. };
  164. };
  165. };
  166. class dummy_1
  167. {
  168. name = "dummy_1";
  169. init = "";
  170. precondition = "";
  171. class Links
  172. {
  173. class wait
  174. {
  175. priority = 0.000000;
  176. to="Fog";
  177. precondition = "";
  178. condition="time > _time";
  179. action="";
  180. };
  181. class if_marker_not_ex
  182. {
  183. priority = 0.000000;
  184. to="End";
  185. precondition = "";
  186. condition="((getMarkerPos _Center select 0) == 0) && ((getMarkerPos _Center select 1) == 0)";
  187. action="";
  188. };
  189. };
  190. };
  191. };
  192. initState="Start";
  193. finalStates[] =
  194. {
  195. "End",
  196. };
  197. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement