./dlc1_mm_01.lua

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