./mm_m1_5.lua

  1. --[[ 
  2. 	mm_m1_5.lua 
  3. 	SR3 Mission Script 
  4. 	DATE: 12-05-10 
  5. 	AUTHOR:	John Karczewski 
  6. ]]-- 
  7.  
  8.  
  9. -- Debug flags -- 
  10.  
  11. -- Tweakable Parameters -- 
  12.  
  13. -- Groups -- 
  14.  
  15. 	MM_M1_5_group = { 
  16. 		--[[ = { 
  17. 			name = "name from editor", 
  18. 			members = { "optional", "list", "of", "members" }, 
  19. 		}, 
  20. 		 
  21. 		 = { 
  22. 			name = "next group name" 
  23. 		},]] 
  24. 	} 
  25.  
  26. -- Navpoints -- 
  27.  
  28. -- Triggers -- 
  29.  
  30. -- Characters -- 
  31.  
  32. -- Vehicles -- 
  33.  
  34. -- Mesh Movers -- 
  35.  
  36. -- Text -- 
  37.  
  38. -- Threads -- 
  39.  
  40. -- Checkpoints -- 
  41. 	CHECKPOINT_START = MISSION_START_CHECKPOINT			-- defined in ug_lib.lua 
  42. 	 
  43. -- Cutscenes -- 
  44. 	CUTSCENE_MISSION_INTRO = "" 
  45. 	CUTSCENE_MISSION_OUTRO = "" 
  46.  
  47. -- Conversations -- 
  48. 	MM_M1_5_convo = { 
  49. 		--[[ = { 
  50. 			name = "file_name without voice (_bm, _wm, _bf...", 
  51. 			handle = INVALID_CONVERSATION_HANDLE 
  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. -- mm_m1_5_checkpoint:	The checkpoint the mission should begin at 
  69. -- is_restart:					TRUE if the mission is restarting, FALSE otherwise 
  70. -- 
  71. function mm_m1_5_start(mm_m1_5_checkpoint, is_restart) 
  72. 	-- Check if this mission starting from the beginning 
  73. 	if (mm_m1_5_checkpoint == CHECKPOINT_START) 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) 
  80. 			end 
  81. 		end 
  82. 		fade_out(0) 
  83. 	end 
  84.  
  85. 	-- Handle mission initialization for the current checkpoint 
  86. 	mm_m1_5_initialize(mm_m1_5_checkpoint) 
  87.  
  88. 	-- Run the mission from the current checkpoint 
  89. 	mm_m1_5_run(mm_m1_5_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_m1_5_run(first_checkpoint) 
  98. 	customization_create_character() 
  99. 	while ( customization_screen_is_ready() == false ) do 
  100. 		thread_yield() 
  101. 	end 
  102. 	 
  103. 	--mission_start_fade_in() 
  104.    fade_in( START_FADE_IN_TIME ) 
  105. 	 
  106. 	while(customization_creation_is_open()) do 
  107. 		thread_yield() 
  108. 	end 
  109. 	-- Player customization complete, mark the mission complete, fail silently, then save 
  110. 	mission_end_silently() 
  111. 	mission_autosave() 
  112. 	 
  113. 	mission_set_next_mission("m02") 
  114. end 
  115.  
  116. -- This is the primary function responsible for cleaning up the entire mission 
  117. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++) 
  118. -- 
  119. function mm_m1_5_cleanup() 
  120.  
  121. end 
  122.  
  123. -- Called when the mission has ended with success 
  124. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++) 
  125. -- 
  126. function mm_m1_5_success() 
  127. 	 
  128. end 
  129.  
  130.  
  131. -- ************************* 
  132. -- 
  133. -- Local functions 
  134. -- 
  135. -- ************************* 
  136.  
  137. -- Initialize the mission for the specified checkpoint 
  138. -- 
  139. -- checkpoint:		Checkpoint to initialize the mission to 
  140. -- 
  141. function mm_m1_5_initialize(checkpoint) 
  142. 	-- Make sure the screen is completly faded out 
  143. 	--mission_start_fade_out(0.0) 
  144. 	fade_out( 0.0 ) 
  145.  
  146. 	-- Set the mission author 
  147. 	set_mission_author("John Karczewski") 
  148.  
  149. 	-- Common initialization 
  150. 	mm_m1_5_initialize_common() 
  151.  
  152. 	-- Checkpoint specific initialization 
  153. 	mm_m1_5_initialize_checkpoint(checkpoint) 
  154.  
  155. 	-- Start fading in  
  156. 	--mission_start_fade_in() 
  157. end 
  158.  
  159.  
  160. -- *************************************************** 
  161. -- mm_m1_5_run Helper Functions 
  162. -- *************************************************** 
  163.  
  164.  
  165. -- *************************************************** 
  166. -- mm_m1_5_initialize Helper Functions 
  167. -- *************************************************** 
  168.  
  169. -- Handle any common initialization 
  170. -- 
  171. function mm_m1_5_initialize_common() 
  172. 	--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]-- 
  173. 	 
  174. end 
  175.  
  176. -- Checkpoint specific initialization 
  177. -- 
  178. -- checkpoint:		The checkpoint to be initialized 
  179. function mm_m1_5_initialize_checkpoint(checkpoint) 
  180.  
  181. 	if (checkpoint == CHECKPOINT_START) then 
  182. 		--[[ INSERT ANY INITIALIZATION CODE FOR STARTING THE MISSION AT THE BEGINNING ]]-- 
  183.  
  184. 	end 
  185.  
  186. end 
  187.  
  188.  
  189. -- *************************************************** 
  190. -- Miscellaneous mm_m1_5 Helper Funcrtions 
  191. -- *************************************************** 
  192.  
  193.  
  194. -- ************************* 
  195. -- 
  196. -- Callback functions 
  197. -- 
  198. -- ************************* 
  199.  
  200.  
  201. -- ************************* 
  202. -- 
  203. -- Thread functions 
  204. -- 
  205. -- ************************* 
  206.