./mm_z_03.lua

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