./mm_a_03.lua

  1.  
  2. --[[ 
  3. 	MM_A_03.lua 
  4. 	SR3 Mission Script 
  5. 	DATE: 10-28-2010 
  6. 	AUTHOR:	Jimmy Cross 
  7. ]]-- 
  8.  
  9.  
  10. -- Debug flags -- 
  11.  
  12. -- Tweakable Parameters -- 
  13.  
  14. -- Groups -- 
  15. 	MM_A_03_group = { 
  16.  
  17. 	} 
  18.  
  19. -- Navpoints -- 
  20.  
  21. -- Triggers -- 
  22. 	MM_A_03_trigger = { 
  23.  
  24. 	} 
  25. 				 
  26. -- Characters -- 
  27.  
  28. -- Vehicles -- 
  29.  
  30. -- Mesh Movers -- 
  31.  
  32. -- Text -- 
  33.  
  34. -- Threads -- 
  35.  
  36. -- Checkpoints -- 
  37. 	MM_A_03_checkpoint = { 
  38. 		start = { 
  39. 			name = MISSION_START_CHECKPOINT, 
  40. 		} 
  41. 	} 
  42. 	 
  43. -- Cutscenes -- 
  44. 	CUTSCENE_MISSION_INTRO = "" 
  45. 	CUTSCENE_MISSION_OUTRO = "" 
  46.  
  47. -- Conversations -- 
  48. 	MM_A_03_convo = { 
  49. 		--[[mission_start = { 
  50. 			name = "MM_A_03_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_A_03_start(checkpoint, is_restart) 
  73. 	-- Check if this mission starting from the beginning 
  74. 	if (checkpoint == MM_A_03_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. 		end 
  83.  
  84. 		fade_out(0) 
  85. 		fade_out_block() 
  86. 		mission_end_to_activity("MM_A_03", "_A_ES_SW01") 
  87. 	end 
  88.  
  89.  
  90. 	-- Handle mission initialization for the current checkpoint 
  91. 	--MM_A_03_initialize(checkpoint) 
  92.  
  93. 	-- Run the mission from the current checkpoint 
  94. 	--MM_A_03_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_A_03_run(first_checkpoint) 
  103. 	local current_checkpoint = first_checkpoint 
  104.  
  105. 	-- Run the mission from the beginning 
  106. 	if( current_checkpoint == MM_A_03_checkpoint.start.name  ) then 
  107. 		--[[ INSERT PROCESSING FOR THE FIRST CHECKPOINT HERE ]]-- 
  108. 		 
  109. 	end 
  110. end 
  111.  
  112. -- This is the primary function responsible for cleaning up the entire mission 
  113. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++) 
  114. -- 
  115. function MM_A_03_cleanup() 
  116. 	--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]-- 
  117.  
  118. end 
  119.  
  120. -- Called when the mission has ended with success 
  121. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++) 
  122. -- 
  123. function MM_A_03_success() 
  124. 	--[[ INSERT ANY MISSION SPECIFIC SUCCESS STUFF ]]-- 
  125. 	 
  126. end 
  127.  
  128.  
  129. -- ************************* 
  130. -- 
  131. -- Local functions 
  132. -- 
  133. -- ************************* 
  134.  
  135. -- Initialize the mission for the specified checkpoint 
  136. -- 
  137. -- checkpoint:		Checkpoint to initialize the mission to 
  138. -- 
  139. function MM_A_03_initialize(checkpoint) 
  140. 	-- Make sure the screen is completly faded out 
  141. 	mission_start_fade_out(0.0) 
  142.  
  143. 	-- Set the mission author 
  144. 	set_mission_author("Jimmy Cross") 
  145.  
  146. 	-- Common initialization 
  147. 	MM_A_03_initialize_common() 
  148.  
  149. 	-- Checkpoint specific initialization 
  150. 	MM_A_03_initialize_checkpoint(checkpoint) 
  151.  
  152. 	-- Start fading in  
  153. 	mission_start_fade_in() 
  154.  
  155. end 
  156.  
  157.  
  158. -- *************************************************** 
  159. -- MM_A_03_run Helper Functions 
  160. -- *************************************************** 
  161.  
  162.  
  163. -- *************************************************** 
  164. -- MM_A_03_initialize Helper Functions 
  165. -- *************************************************** 
  166.  
  167. -- Handle any common initialization 
  168. -- 
  169. function MM_A_03_initialize_common() 
  170. 	--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]-- 
  171. 	 
  172. end 
  173.  
  174. -- Checkpoint specific initialization 
  175. -- 
  176. -- checkpoint:		The checkpoint to be initialized 
  177. function MM_A_03_initialize_checkpoint(checkpoint) 
  178.  
  179. 	if (checkpoint == MM_A_03_checkpoint.start.name) then 
  180. 		--[[ INSERT ANY INITIALIZATION CODE FOR STARTING THE MISSION AT THE BEGINNING ]]-- 
  181.  
  182. 	end 
  183.  
  184. end 
  185.  
  186.  
  187. -- *************************************************** 
  188. -- Miscellaneous MM_A_03 Helper Funcrtions 
  189. -- *************************************************** 
  190. function MM_A_03_clear_trigger(trigger) 
  191. 	on_trigger( "", trigger ) 
  192. 	trigger_enable( trigger, false ) 
  193. 	marker_remove_trigger( trigger, SYNC_ALL ) 
  194. end 
  195.  
  196. -- ************************* 
  197. -- 
  198. -- Callback functions 
  199. -- 
  200. -- ************************* 
  201.  
  202. -- ************************* 
  203. -- 
  204. -- Thread functions 
  205. -- 
  206. -- ************************* 
  207.  
  208.