Advertisement
Guest User

revive_init.sqf

a guest
Apr 3rd, 2013
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.83 KB | None | 0 0
  1. // revive_init.sqf
  2. // APRIL 2013 - norrin
  3. // Version: 0.50 ArmA2 ported to ArmA3
  4. // =====================================================================================================================
  5. // DO NOT MODIFY THIS CODE
  6. // =====================================================================================================================
  7. // sickboy's code modified by _xeno
  8. T_INIT = false;
  9. T_Server = false;
  10. T_Client = false;
  11. T_JIP = false;
  12.  
  13. T_MP = (if (playersNumber east + playersNumber west + playersNumber resistance + playersNumber civilian > 0) then {true} else {false});
  14.  
  15. if (isServer) then
  16. {
  17. T_Server = true;
  18. if (!isNull player) then {T_Client = true};
  19. T_INIT = true;
  20. } else {
  21. T_Client = true;
  22. if (isNull player) then
  23. {
  24. T_JIP = true;
  25. [] spawn {waitUntil {!isNull player};T_INIT = true};
  26. } else {
  27. T_INIT = true;
  28. };
  29. };
  30. waitUntil {T_INIT};
  31.  
  32. diag_log "Starting norrin revive";
  33. diag_log format[" CFG_revive_missionend: %1",CFG_revive_missionend];
  34. diag_log format[" CFG_respawn_call_out: %1",CFG_respawn_call_out];
  35. diag_log format[" CFG_revive_life_counter: %1",CFG_revive_life_counter];
  36. diag_log format[" CFG_revive_timelimit_max: %1",CFG_revive_timelimit_max];
  37. diag_log format[" CFG_revive_injured_marker_enable: %1",CFG_revive_injured_marker_enable];
  38. diag_log format[" CFG_respawn_time: %1",CFG_respawn_time];
  39. diag_log format[" CFG_mobile_respawn_enable: %1",CFG_mobile_respawn_enable];
  40. diag_log format[" CFG_respawn_follow_cam: %1",CFG_respawn_follow_cam];
  41. diag_log format[" CFG_respawn_cam_team: %1",CFG_respawn_cam_team];
  42. // =====================================================================================================================
  43. // THE FOLLOWING CODE CAN BE MODIFIED
  44. // =====================================================================================================================
  45. // GENERAL REVIVE OPTIONS (Off = 0, On = 1)
  46. _mission_end_function = CFG_revive_missionend; //array no.0 - mission ends when all players are unconscious
  47. _call_out_function = CFG_respawn_call_out; //array no.6 - whether a unit calls out while unconscious
  48. _water_dialog = 1; //array no.45 - whether a dialog appears when a unit dies in water so that it can auto wash ashore
  49. _unconscious_drag = 1; //array no.39 - whether a unit can drag the bodies of unconscious players
  50. _load_wounded = 1; //array no.61 - allows you to load unconscious units on vehicles
  51. _altUnc_animation = 0; //array no.54 - use alternate revive animation
  52. _JIP_spawn_dialog = 1; //array no.2 - whether a dialog appears when a player JIP so that he can be transported to a spawn point near the action
  53. _time_b4_JIP_spawn_dialog = 10000; //array no.17 - time before the respawn dialog appears for JIP players
  54. _perpetual_server = 0; //array no.62 - NOT IMPLEMENTED
  55. _ACE_mod = 0; //array no.102 - NOT IMPLEMENTED - Currently a place holder for possible future functionality
  56. // ==================================================================
  57. // LIST OF PLAYABLE UNITS
  58. //NORRN_player_units = playableUNits;
  59. NORRN_player_units = [s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15];
  60. // ==================================================================
  61. // WELCOME SCREEN
  62. //titleText ["Joining the Revive Test Mission\n\n(Make sure you check the mission notes for details on how the scripts work\nand the revive_readMe in the attached pdf file for the full notes on implementing \nthe scripts in your own missions and the options available)", "BLACK FADED", 0.6]; // This next line can be commented out or removed if it interferes with intro movies
  63. // ==================================================================
  64. // REVIVE OPTIONS
  65. _max_respawns = CFG_revive_life_counter; //array no.38 - Number of lives per unit
  66. _JIP_respawns = [CFG_revive_life_counter,30]; //array no.63 - 0 - off or the number of lives players receive when they join in progress , JIP time after the mission starts
  67. _revive_timer = 1; //array no.7 - Whether you want to limit the amount of timer a player has while unconscious
  68. _revive_time_limit = CFG_revive_timelimit_max; //array no.27 - Amount of time a player remains unconscious before respawning or dying
  69. _revive_damage = 0; //array no.37 - Unit's level of damage following revive
  70. _unconscious_markers = CFG_revive_injured_marker_enable; //array no. 4 - Whether a marker appears on the game map at the location of the unconscious unit
  71. _caseVAC = [1, ["MASH"]]; //array no.64 - Allows units to be taken to a hospital etc to be revived
  72. _mediVAC = []; //array no.65 - NOT IMPLEMENTED
  73. _chance_ofDeath = [0,0]; //array no.66 - Two parameters in the array the first switches off/on (0/1) chance of death when shot, increases dues to hit location and number of times revived and the second parameter switches on/off the decreasing respawn timer based on how many times you have been revived, if using set respawn-time to at least 300 seconds.
  74. _dualTimer = 0; //array no.67 - NOT IMPLEMENTED - normal units can only revive for eg 30 seconds whereas medics can heal players up to 120 secs - array - [0/1 - off/on, revive timer for normal unit, timer for medic]
  75. _deadSpectator_cam = 1; //array no.92 - leave as 0 - whether a unit can spectate other friendly units when it has run out of lives
  76. // ==================================================================
  77. // RESPAWN OPTIONS
  78. _no_respawn_points = 2; //array no.12 - no of respawn points (Max number 4)
  79. _Base_1 = "Mobile"; //array no.13 - spawn position names
  80. _Base_2 = "Camp Tempest"; //array no.14
  81. _Base_3 = ""; //array no.15
  82. _Base_4 = ""; //array no.16
  83. _Base_free_respawn = [1,1,0,0]; //array no.36 - select whether to allow respawning at spawn points even if enemy troops are present (options OFF = 0, ON = 1)
  84. _respawn_at_base_addWeapons = 0; //array no.11 - unit respawns with weapons it commenced the mission with
  85. _respawn_at_base_assItems = []; //array no.34 - Array with respawn at base assigned items
  86. _respawn_at_base_allItems = []; //array no.35 - If respawn_at_base_addWeapons option = 1 then array format [_primWep,_handgun,_secWep,_unif,_unifI,_vest,_vestI,_bckpck,_bckpckI,_headgear,_goggles,_magsInfo];
  87. _respawn_position = 2; //array no.28 - 0 - respawn at base_1; 1 - the closest enemy free respawn point; 2 - players choice; and 3 - dies
  88. _respawnAtBaseWait = [1,CFG_respawn_time]; //array no.68 - Two parameters: 1st if = 1 makes players that respawn at base wait for (parameter 2) seconds before being able to see surroundings
  89. _objectiveBasedRP = []; //array no.69 - NOT IMPLEMENTED
  90. // Mobile Spawn Settings
  91. _mobile_spawn = CFG_mobile_respawn_enable; //array no.51 - set to 1 if you want to use mobile spawn
  92. //_mobile_base_start = "Insertion"; //array no.52 - NO LONGER NEEDED, REDUNDANT VARIABLE
  93. _mobile_base2_start = ""; //array no.70 - NOT IMPLEMENTED
  94. _mobile_type = 0; //array no.60 - set as 0 - for vehicle and 1 for man
  95. _mobile_man = mobile_respawn_west; //array no.53 - place name of unit here or if not used make sure set as objNull
  96. _mobile_man2 = objNull; //array no.71 - NOT IMPLEMENTED
  97. // ==================================================================
  98. // UNITS THAT CAN REVIVE/UNITS THAT CAN BE REVIVED
  99. _can_revive = "B_Soldier_base_F";//array no.18
  100. _can_revive_2 = ""; //array no.19
  101. _can_revive_3 = ""; //array no.72 - NOT IMPLEMENTED
  102. _can_revive_4 = ""; //array no.73 - NOT IMPLEMENTED
  103. _can_be_revived = "B_Soldier_base_F";//array no.20
  104. _can_be_revived_2 = ""; //array no.21
  105. _can_be_revived_3 = ""; //array no.74 - NOT IMPLEMENTED
  106. _can_be_revived_4 = ""; //array no.75 - NOT IMPLEMENTED
  107. _medic_1 = "B_medic_F"; //array no.76 - Used in conjunction with medpacks and bleeding
  108. _medic_2 = ""; //array no.77 - Used in conjunction with medpacks and bleeding
  109. _medic_3 = ""; //array no.78 - NOT IMPLEMENTED
  110. _medic_4 = ""; //array no.79 - NOT IMPLEMENTED
  111. //========================================================
  112. // MEDPACK AND BLEEDING OPTIONS
  113. _medpacks = 0; //array no.80 - Whether you want to give the units a limited number of revive kits 0/1 - no/yes
  114. _stabilisation = 0; //array no.81 - NOT IMPLEMENTED
  115. _bleeding = 1; //array no.82 - Make units bleed and require bandages
  116. _medic_medpacks = 5; //array no.83 - No of medpacks for units specified in the _medic variables - they are required for reviving units
  117. _unit_medpacks = 3; //array no.84 - No of medpacks for units specified in the _can_revive variables - they are required for reviving units
  118. _medic_bandages = 5; //array no.85 - Bandages stop bleeding
  119. _unit_bandages = 3; //array no.86 -
  120. _medic_stable = 0; //array no.100 - NOT IMPLEMENTED
  121. _unit_stable = 0; //array no.101 - NOT IMPLEMENTED
  122. _stabTime_tillDeath = 0; //array no.87 - NOT IMPLEMENTED //Time until death following revive without stabilisation
  123. // ==================================================================
  124. // ENEMY SIDE TO PLAYABLE UNITS
  125. _no_enemy_sides = 1; //array no.22 - No of Enemy sides (0, 1 or 2).
  126. _enemy_side_1 = "EAST"; //array no.23 - Enemy sides can be "EAST", "WEST", "GUER" etc
  127. _enemy_side_2 = ""; //array no.24
  128. _enemy_side_3 = ""; //array no.88 - NOT IMPLEMENTED
  129. _enemy_side_4 = ""; //array no.89 - NOT IMPLEMENTED
  130. // ==================================================================
  131. // FRIENDLY SIDE TO PLAYABLE UNITS
  132. _allied_side_1 = "WEST"; //array no.42 - Friendly sides can be "EAST", "WEST","RESISTANCE" etc.
  133. _allied_side_2 = "WEST"; //array no.43 - If all players are from the same side make sure you set the same side for both variables eg "WEST", "WEST"
  134. _allied_side_3 = ""; //array no.90 - NOT IMPLEMENTED
  135. _allied_side_4 = ""; //array no.91 - NOT IMPLEMENTED
  136. // ==================================================================
  137. // UNCONSCIOUS CAMERA OPTIONS
  138. _follow_cam = CFG_respawn_follow_cam; //array no.5 - option to allow viewing of friendly units while unconscious
  139. _follow_cam_distance = 250; //array no.32 - the range that unconscious players can spectate friendly units
  140. _follow_cam_team = CFG_respawn_cam_team; //array no.44 - set to 1 if you wish unconscious players only to spectate players within NORRN_player_units array
  141. _top_view_height = 70; //array no.55 - allows you to set the top down camera height
  142. _visible_timer = 1; //array no.41 - view a cound-down timer while unconscious
  143. _unconscious_music = 0; //array no.46 - music must appear as unc_theme in music.hpp
  144. // ==================================================================
  145. // RESPAWN DIALOG OPTIONS
  146. _nearest_teammate_dialog = 0; //array no.3 - whether a respawn dialog appears when there are no players within this distance
  147. _all_dead_dialog = 0; //array no.1 - whether a respawn dialog appears when all players are unconscious (_all_dead_player = 1)
  148. _respawn_button_timer = 0; //array no.25 - Time until respawn button appears (0 = approx. 12 seconds), NB: Set to a high number like 100000 seconds if you do not want
  149. _distance_to_friend = 250; //array no.26 - If the closest friendly unit is further than this distance away trigger respawn dialog
  150. _all_dead_player = 0; //array no.56
  151. _all_dead_distance = 10000; //array no.57 - whether a respawn dialog appears when all players within a specified distance are unconscious (_all_dead_player = 1)
  152. // ==================================================================
  153. // Bonus life for aiding team mates function
  154. _reward_function = 1; //array no.96 - specify whether a unit receives bonus lives for reviving other players
  155. _revives_required = 1; //array no.97 - Number of revives required before recieving a bonus life
  156. // ==================================================================
  157. // Team kill function
  158. _team_kill_function = 1; //array no.98 - specify whether a unit loses a life for killing team mates
  159. _no_team_kills = 1; //array no.99 - Number of teamkills before punishment
  160. // ==================================================================
  161. // CONFIGURABLE OPTIONS FOR HEAL YOURSELF FUNCTION
  162. _heal_yourself = 1; //array no.8 - whether a unit can heal damage to itself
  163. _no_of_heals = 1; //array no.29 - Number of heals that each player gets during a mission
  164. _lower_bound_heal = 0.1; //array no.30 - The damage level range between which the heal action becomes available
  165. _upper_bound_heal = 0.8; //array no.31
  166. // ==================================================================
  167. // AI REVIVE BEHAVIOUR OPTIONS
  168. _goto_revive = 0; //array no. 9 - closest AI automatically moves to revive a downed team mate
  169. _AI_smoke = 0; //array no. 40 - if available reviving AI throws smoke on downed AI position
  170. _AI_aware = 1; //array no. 49 - AI will clear an enemy units it is aware of before auto reviving
  171. _AI_cover = 1; //array no. 50 - second AI unit moves with AI reviver to give cover
  172. _AI_dismount = 0; //array no. 58 - toggles ability of reviving AI units to dismount vehicles (1 = dismount)
  173. _call_for_AI_help = 1; //array no. 59 - allows AI units to call for help
  174. _goto_revive_distance = 500; //array no. 33 - distance AI units will move to revive a downed team mate
  175.  
  176.  
  177. // ==================================================================
  178. // OPTIONS FOR PLAYER'S DEAD BODIES AND EQUIPMENT - Additional revive functions with many thanks to alef (0 - off, 1 - on except for _bury_timeout)
  179. _drop_weapons = 1; //array no.93 - should the respawned player drop his weapons where he died?
  180. _cadaver = 0; //array no.94 - should the respawned player's body remain there?
  181. _bury_timeout = 12; //array no.95 - if drop weapons OR player body, how long before the body is buried?
  182. // 0=maximum (1200s) , n=seconds up to 1200s (hard coded)
  183. // ==================================================================
  184. // USER CODE - eg. NORRNCustonexec1="execvm ""myscript.sqf"";hint ""myoutput"";"
  185. NORRNCustomExec1 =""; // Exec1 occurs following being revived
  186. NORRNCustomExec2 =""; // Exec2 occurs when you team kill
  187. NORRNCustomExec3 =""; // Exec3 occurs when you spawn at base
  188. NORRNCustomExec4 =""; // Exec4 occurs when you try and spawn at base but it is still occupied
  189. NORRNCustomExec5 =""; // Must use variables: MAP_r_rejoin (false - first time,
  190. // true - rejoining the server, and
  191. // MAP_r_no_lives - number of lives if you rejoin server)
  192. // =====================================================================================================================
  193. // DO NOT MODIFY THE FOLLOWING CODE
  194. // =====================================================================================================================
  195. NORRN_revive_array = [];
  196. NORRN_revive_array = [_mission_end_function,_all_dead_dialog,_JIP_spawn_dialog,_nearest_teammate_dialog,_unconscious_markers,_follow_cam,_call_out_function,_revive_timer,
  197. _heal_yourself,_goto_revive,_unconscious_invincibility,_respawn_at_base_addWeapons,_no_respawn_points,_Base_1,_Base_2,_Base_3,_Base_4,_time_b4_JIP_spawn_dialog,
  198. _can_revive,_can_revive_2,_can_be_revived,_can_be_revived_2,_no_enemy_sides,_enemy_side_1,_enemy_side_2,_respawn_button_timer,_distance_to_friend,
  199. _revive_time_limit,_respawn_position,_no_of_heals,_lower_bound_heal,_upper_bound_heal,_follow_cam_distance,_goto_revive_distance,_respawn_at_base_assItems,
  200. _respawn_at_base_allItems, _Base_free_respawn, _revive_damage, _max_respawns, _unconscious_drag,_AI_smoke,_visible_timer,_allied_side_1,_allied_side_2,_follow_cam_team,
  201. _water_dialog, _unconscious_music, _enemy_units_1, _enemy_units_2, _AI_aware,_AI_cover,_mobile_spawn,_mobile_base_start,_mobile_man,_altUnc_animation,_top_view_height,
  202. _all_dead_player,_all_dead_distance,_AI_dismount,_call_for_AI_help,_mobile_type,_load_wounded,_perpetual_server,_JIP_respawns,_caseVAC,_mediVAC,_chance_ofDeath,_dualTimer,
  203. _respawnAtBaseWait,_objectiveBasedRP,_mobile_base2_start,_mobile_man2,_can_revive_3,_can_revive_4,_can_be_revived_3,_can_be_revived_4,_medic_1,_medic_2,_medic_3,_medic_4,
  204. _medpacks,_stabilisation,_bleeding,_medic_medpacks,_unit_medpacks,_medic_bandages,_unit_bandages,_stabTime_tillDeath,_enemy_side_3,_enemy_side_4,
  205. _allied_side_3,_allied_side_4,_deadSpectator_cam,_drop_weapons,_cadaver,_bury_timeout,_reward_function,_revives_required,_team_kill_function,_no_team_kills,_medic_stable, _unit_stable,
  206. _ACE_mod];
  207.  
  208. // start related revive functions
  209. [] execVM "revive_sqf\init_related_scripts.sqf";
  210. //Last edited 02/04/2013
  211.  
  212. //if (_name == player) then {[_name] execVM 'revive_sqf\rPrn.sqf'}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement