./mm_z_01.lua

  1.  
  2. --[[ 
  3. 	MM_Z_01.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. -- Groups -- 
  15. 	MM_Z_01_group = { 
  16. 		npcs = { 
  17. 			name = "MM_Z_01_NPC", 
  18. 			zimos = "MM_Z_01_NPC_Zimos" 
  19. 		} 
  20. 	} 
  21.  
  22. -- Navpoints -- 
  23. 	MM_Z_01_navs = {		 
  24. 		cp_start = { 
  25. 			player_local = "local_player", 
  26. 			player_remote = "remote_player" 
  27. 			} 
  28. 	} 
  29. 	 
  30. -- Triggers -- 
  31. 	MM_Z_01_trigger = { 
  32.  
  33. 	} 
  34. 				 
  35. -- Characters -- 
  36.  
  37. -- Vehicles -- 
  38.  
  39. -- Mesh Movers -- 
  40.  
  41. -- Text -- 
  42.  
  43. -- Threads -- 
  44.  
  45. -- Checkpoints -- 
  46. 	MM_Z_01_checkpoint = { 
  47. 		start = { 
  48. 			name = MISSION_START_CHECKPOINT, 
  49. 			nav1 = "start_nav 001", 
  50. 			nav2 = "start_nav 002" 
  51. 		} 
  52. 	} 
  53. 	 
  54. -- Cutscenes -- 
  55. MM_Z_01_cutscene = { 
  56. 	zimos_intro = "Z_Z01" 
  57. 	--zimos_intro = "" 
  58. } 
  59. 	CUTSCENE_MISSION_INTRO = "" 
  60. 	CUTSCENE_MISSION_OUTRO = "" 
  61.  
  62. -- Conversations -- 
  63. 	MM_Z_01_convo = { 
  64. 		--[[mission_start = { 
  65. 			name = "MM_Z_01_convo_1", 
  66. 			handle = INVALID_CONVERSATION_HANDLE 
  67. 		} 
  68. 		]]-- 
  69. 	} 
  70. 		 
  71. -- Other -- 
  72.  
  73.  
  74. -- ************************* 
  75. -- 
  76. -- Standard functions 
  77. -- 
  78. -- ************************* 
  79.  
  80. -- This is the primary entry point for the mission, and is responsible for starting up the mission 
  81. -- at the specified checkpoint. 
  82. -- CALLED FROM CODE 
  83. -- 
  84. -- checkpoint:	The checkpoint the mission should begin at 
  85. -- is_restart:					TRUE if the mission is restarting, FALSE otherwise 
  86. -- 
  87. function MM_Z_01_start(checkpoint, is_restart) 
  88. 	-- Check if this mission starting from the beginning 
  89. 	if (checkpoint == MM_Z_01_checkpoint.start.name) then 
  90. 		if (is_restart == false) then 
  91. 			-- First time playing mission 
  92. 			 
  93. 			if( MM_Z_01_cutscene.zimos_intro ~= "" ) then 
  94. 			--cutscene_in() 
  95. 				zscene_prep( MM_Z_01_cutscene.zimos_intro ) 
  96. 				while( not zscene_is_loaded(MM_Z_01_cutscene.zimos_intro) ) do 
  97. 					thread_yield() 
  98. 				end 
  99.  
  100. 				cutscene_play( MM_Z_01_cutscene.zimos_intro, nil, nil, false ) 
  101. 			--group_create( MM_Z_01_group.npcs.name, true ) --create the NPC group 
  102. 			--teleport_coop( MM_Z_01_navs.cp_start.player_local, MM_Z_01_navs.cp_start.player_remote, true ) 
  103. 			--bink_play( MM_Z_01_cutscene.zimos_intro ) 
  104. 			--fade_in( 0.5 ) 
  105. 			--fade_in_block() 
  106. 			--cutscene_out() 
  107. 			else 
  108. 				fade_out( 0.5 ) 
  109. 				fade_out_block() 
  110. 				 
  111. 				--group_create( MM_Z_01_group.npcs.name, true ) --create the NPC group 
  112. 				delay( 1.5 ) 
  113. 				 
  114. 				fade_in( 0.5 ) 
  115. 				fade_in_block() 
  116. 			end 
  117. 		end 
  118. 		--fade_out(0) 
  119. 	end 
  120.  
  121. 	-- Handle mission initialization for the current checkpoint 
  122. 	MM_Z_01_initialize(checkpoint) 
  123.  
  124. 	-- Run the mission from the current checkpoint 
  125. 	MM_Z_01_run(checkpoint) 
  126. 	 
  127. end 
  128.  
  129. -- This is the primary function responsible for running the entire mission from start to finish. 
  130. -- 
  131. -- first_checkpoint:	The first checkpoint to begin running the mission at 
  132. -- 
  133. function MM_Z_01_run(first_checkpoint) 
  134. 	local current_checkpoint = first_checkpoint 
  135.  
  136. 	-- Run the mission from the beginning 
  137. 	if( current_checkpoint == MM_Z_01_checkpoint.start.name  ) then 
  138. 		fade_out(0) 
  139. 		fade_out_block() 
  140. 		mission_end_to_activity("MM_Z_01", "_A_SN_NE_01") 
  141. 	end 
  142. end 
  143.  
  144. -- This is the primary function responsible for cleaning up the entire mission 
  145. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++) 
  146. -- 
  147. function MM_Z_01_cleanup() 
  148. 	--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]-- 
  149.  
  150. end 
  151.  
  152. -- Called when the mission has ended with success 
  153. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++) 
  154. -- 
  155. function MM_Z_01_success() 
  156. 	--[[ INSERT ANY MISSION SPECIFIC SUCCESS STUFF ]]-- 
  157. 	 
  158. end 
  159.  
  160.  
  161. -- ************************* 
  162. -- 
  163. -- Local functions 
  164. -- 
  165. -- ************************* 
  166.  
  167. -- Initialize the mission for the specified checkpoint 
  168. -- 
  169. -- checkpoint:		Checkpoint to initialize the mission to 
  170. -- 
  171. function MM_Z_01_initialize(checkpoint) 
  172. 	-- Make sure the screen is completly faded out 
  173. 	mission_start_fade_out(0.0) 
  174.  
  175. 	-- Set the mission author 
  176. 	set_mission_author("Jimmy Cross") 
  177.  
  178. 	-- Common initialization 
  179. 	MM_Z_01_initialize_common() 
  180.  
  181. 	-- Checkpoint specific initialization 
  182. 	MM_Z_01_initialize_checkpoint(checkpoint) 
  183.  
  184. 	-- Don't bother fading in, this mission is only a cutscene 
  185. 	--mission_start_fade_in() 
  186.  
  187. end 
  188.  
  189.  
  190. -- *************************************************** 
  191. -- MM_Z_01_run Helper Functions 
  192. -- *************************************************** 
  193.  
  194.  
  195. -- *************************************************** 
  196. -- MM_Z_01_initialize Helper Functions 
  197. -- *************************************************** 
  198.  
  199. -- Handle any common initialization 
  200. -- 
  201. function MM_Z_01_initialize_common() 
  202. 	--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]-- 
  203. 	 
  204. end 
  205.  
  206. -- Checkpoint specific initialization 
  207. -- 
  208. -- checkpoint:		The checkpoint to be initialized 
  209. function MM_Z_01_initialize_checkpoint(checkpoint) 
  210.  
  211. 	if (checkpoint == MM_Z_01_checkpoint.start.name) then 
  212. 		--[[ INSERT ANY INITIALIZATION CODE FOR STARTING THE MISSION AT THE BEGINNING ]]-- 
  213.  
  214. 	end 
  215.  
  216. end 
  217.  
  218.  
  219. -- *************************************************** 
  220. -- Miscellaneous MM_Z_01 Helper Funcrtions 
  221. -- *************************************************** 
  222. function MM_Z_01_clear_trigger(trigger) 
  223.  
  224. end 
  225.  
  226. -- ************************* 
  227. -- 
  228. -- Callback functions 
  229. -- 
  230. -- ************************* 
  231.  
  232. -- ************************* 
  233. -- 
  234. -- Thread functions 
  235. -- 
  236. -- ************************* 
  237.  
  238.