./mm_k_02.lua

  1.  
  2. --[[ 
  3. 	MM_K_02.lua 
  4. 	SR3 Mission Script 
  5. 	DATE: 10-29-2010 
  6. 	AUTHOR:	Jimmy Cross 
  7. ]]-- 
  8.  
  9.  
  10. -- Debug flags -- 
  11.  
  12. -- Tweakable Parameters -- 
  13.  
  14.  
  15. -- Groups -- 
  16. 	MM_K_02_group = { 
  17.  
  18. 	} 
  19.  
  20. -- Navpoints -- 
  21.  
  22. -- Triggers -- 
  23. 	 
  24. -- Characters -- 
  25.  
  26. -- Vehicles -- 
  27.  
  28. -- Mesh Movers -- 
  29.  
  30. -- Text -- 
  31.  
  32. -- Threads -- 
  33.  
  34. -- Checkpoints -- 
  35. 	MM_K_02_checkpoint = { 
  36. 		start = { 
  37. 			name = MISSION_START_CHECKPOINT, 
  38. 			nav1 = "start_nav 001", 
  39. 			nav2 = "start_nav 002" 
  40. 		} 
  41. 	} 
  42. 	 
  43. -- Cutscenes -- 
  44. 	CUTSCENE_MISSION_INTRO = "" 
  45. 	CUTSCENE_MISSION_OUTRO = "" 
  46.  
  47. -- Conversations -- 
  48. 	MM_K_02_convo = { 
  49. 		--[[mission_start = { 
  50. 			name = "MM_K_02_convo_1", 
  51. 			handle = INVALID_CONVERSATION_HANDLE 
  52. 		} 
  53. 		]]-- 
  54. 	} 
  55. 		 
  56. -- Other -- 
  57.  
  58.  
  59. -- ************************* 
  60. -- 
  61. -- Standard functions 
  62. -- 
  63. -- ************************* 
  64.  
  65. -- This is the primary entry point for the mission, and is responsible for starting up the mission 
  66. -- at the specified checkpoint. 
  67. -- CALLED FROM CODE 
  68. -- 
  69. -- checkpoint:	The checkpoint the mission should begin at 
  70. -- is_restart:					TRUE if the mission is restarting, FALSE otherwise 
  71. -- 
  72. function MM_K_02_start(checkpoint, is_restart) 
  73. 	-- Check if this mission starting from the beginning 
  74. 	if (checkpoint == MM_K_02_checkpoint.start.name) then 
  75. 		if (is_restart == false) then 
  76. 			-- First time playing mission 
  77. 			 
  78. 			-- Play an intro cutscene??? 
  79. 			if (CUTSCENE_MISSION_INTRO ~= "") then 
  80. 				cutscene_play(CUTSCENE_MISSION_INTRO) 
  81. 			end 
  82.  
  83. 			fade_out(0) 
  84. 			fade_out_block() 
  85. 			mission_end_to_activity("MM_K_02", "_A_MH_NW_01") 
  86. 		end 
  87. 	end 
  88.  
  89.  
  90. 	-- Handle mission initialization for the current checkpoint 
  91. 	--MM_K_02_initialize(checkpoint) 
  92.  
  93. 	-- Run the mission from the current checkpoint 
  94. 	--MM_K_02_run(checkpoint) 
  95. 	 
  96. end 
  97.  
  98. -- This is the primary function responsible for running the entire mission from start to finish. 
  99. -- 
  100. -- first_checkpoint:	The first checkpoint to begin running the mission at 
  101. -- 
  102. function MM_K_02_run(first_checkpoint) 
  103. 	local current_checkpoint = first_checkpoint 
  104.  
  105. 	-- Run the mission from the beginning 
  106. 	if( current_checkpoint == MM_K_02_checkpoint.start.name  ) then 
  107. 		--[[ INSERT PROCESSING FOR THE FIRST CHECKPOINT HERE ]]-- 
  108. 		 
  109.  
  110. 	end 
  111. end 
  112.  
  113. -- This is the primary function responsible for cleaning up the entire mission 
  114. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++) 
  115. -- 
  116. function MM_K_02_cleanup() 
  117. 	--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]-- 
  118.  
  119. end 
  120.  
  121. -- Called when the mission has ended with success 
  122. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++) 
  123. -- 
  124. function MM_K_02_success() 
  125. 	--[[ INSERT ANY MISSION SPECIFIC SUCCESS STUFF ]]-- 
  126. 	 
  127. end 
  128.  
  129.  
  130. -- ************************* 
  131. -- 
  132. -- Local functions 
  133. -- 
  134. -- ************************* 
  135.  
  136. -- Initialize the mission for the specified checkpoint 
  137. -- 
  138. -- checkpoint:		Checkpoint to initialize the mission to 
  139. -- 
  140. function MM_K_02_initialize(checkpoint) 
  141. 	-- Make sure the screen is completly faded out 
  142. 	mission_start_fade_out(0.0) 
  143.  
  144. 	-- Set the mission author 
  145. 	set_mission_author("Jimmy Cross") 
  146.  
  147. 	-- Common initialization 
  148. 	MM_K_02_initialize_common() 
  149.  
  150. 	-- Checkpoint specific initialization 
  151. 	MM_K_02_initialize_checkpoint(checkpoint) 
  152.  
  153. 	-- Start fading in  
  154. 	mission_start_fade_in() 
  155.  
  156. end 
  157.  
  158.  
  159. -- *************************************************** 
  160. -- MM_K_02_run Helper Functions 
  161. -- *************************************************** 
  162.  
  163.  
  164. -- *************************************************** 
  165. -- MM_K_02_initialize Helper Functions 
  166. -- *************************************************** 
  167.  
  168. -- Handle any common initialization 
  169. -- 
  170. function MM_K_02_initialize_common() 
  171. 	--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]-- 
  172. 	 
  173. end 
  174.  
  175. -- Checkpoint specific initialization 
  176. -- 
  177. -- checkpoint:		The checkpoint to be initialized 
  178. function MM_K_02_initialize_checkpoint(checkpoint) 
  179.  
  180. 	if (checkpoint == MM_K_02_checkpoint.start.name) then 
  181. 		--[[ INSERT ANY INITIALIZATION CODE FOR STARTING THE MISSION AT THE BEGINNING ]]-- 
  182.  
  183. 	end 
  184.  
  185. end 
  186.  
  187.  
  188. -- *************************************************** 
  189. -- Miscellaneous MM_K_02 Helper Funcrtions 
  190. -- *************************************************** 
  191. function MM_K_02_clear_trigger(trigger) 
  192. 	on_trigger( "", trigger ) 
  193. 	trigger_enable( trigger, false ) 
  194. 	marker_remove_trigger( trigger, SYNC_ALL ) 
  195. end 
  196.  
  197. -- ************************* 
  198. -- 
  199. -- Callback functions 
  200. -- 
  201. -- ************************* 
  202.  
  203. -- Trigger callback, used to handle the start of the activity and silent failing of the mission 
  204. -- 
  205. --  
  206.  
  207.  
  208. -- ************************* 
  209. -- 
  210. -- Thread functions 
  211. -- 
  212. -- ************************* 
  213.  
  214.