./mintro.lua

  1.  
  2. --[[  
  3.             _____       _              
  4.            |_   _|     | |             
  5.   _ __ ___   | |  _ __ | |_ _ __ ___   
  6.  | '_ ` _ \  | | | '_ \| __| '__/ _ \  
  7.  | | | | | |_| |_| | | | |_| | | (_) | 
  8.  |_| |_| |_|_____|_| |_|\__|_|  \___/  
  9.                                        
  10.                                        
  11.  
  12.  
  13. ]]-- 
  14.  
  15. --[[ 
  16. 	mIntro.lua 
  17. 	SR3 Mission Script 
  18. 	DATE: 2013-12-09 
  19. 	AUTHOR:	Kevin Tyska 
  20. ]]-- 
  21.  
  22.  
  23. -- Debug flags -- 
  24.  
  25. -- Tweakable Parameters -- 
  26.  
  27. -------------------------------------------------------------------------------------------------- 
  28. --[[   
  29.  
  30.    _____                            
  31.   / ____|                           
  32.  | |  __ _ __ ___  _   _ _ __  ___  
  33.  | | |_ | '__/ _ \| | | | '_ \/ __| 
  34.  | |__| | | | (_) | |_| | |_) \__ \ 
  35.   \_____|_|  \___/ \__,_| .__/|___/ 
  36. 						| |         
  37. 						|_|    
  38.  
  39. ]]-- 
  40. -------------------------------------------------------------------------------------------------- 
  41. 	mIntro_group = { 
  42.  
  43. 		kinzie_npc_start = { 
  44. 			name = "homies_group", 
  45. 			npcs = { "npc_Kinzie_start" }, 
  46. 			kinzie = "npc_Kinzie_start", 
  47. 		}, 
  48.  
  49. 		start_car = { 
  50. 			name = "start_vehicle_group", 
  51. 		}, 
  52.  
  53. 		dane_npc = { 
  54. 			name = "SAM_Dane_group", 
  55. 			npcs = { "SAM_Dane<001>" }, 
  56. 			dane = "SAM_Dane<001>", 
  57. 		}, 
  58.  
  59. 	} 
  60. 	 
  61. 	mIntro_saints = { 
  62. 		--Will be filled in when the mission starts 
  63. 	} 
  64.  
  65. --------------------------------------------------------------------------------------------------																				 
  66. --[[ 
  67.  
  68.   _______ _                        _      
  69.  |__   __| |                      | |     
  70. 	| |  | |__  _ __ ___  __ _  __| |___  
  71. 	| |  | '_ \| '__/ _ \/ _` |/ _` / __| 
  72. 	| |  | | | | | |  __/ (_| | (_| \__ \ 
  73. 	|_|  |_| |_|_|  \___|\__,_|\__,_|___/ 
  74. 										  
  75. 	 
  76. ]]-- 
  77. -------------------------------------------------------------------------------------------------- 
  78. 	mIntro_thread = { 
  79.  
  80. 	} 
  81.  
  82. -------------------------------------------------------------------------------------------------- 
  83. --[[  
  84.  
  85.    _____ _               _                _       _        
  86.   / ____| |             | |              (_)     | |       
  87.  | |    | |__   ___  ___| | ___ __   ___  _ _ __ | |_ ___  
  88.  | |    | '_ \ / _ \/ __| |/ / '_ \ / _ \| | '_ \| __/ __| 
  89.  | |____| | | |  __/ (__|   <| |_) | (_) | | | | | |_\__ \ 
  90.   \_____|_| |_|\___|\___|_|\_\ .__/ \___/|_|_| |_|\__|___/ 
  91. 							 | |                           
  92. 							 |_|                           
  93. ]]-- 
  94. -------------------------------------------------------------------------------------------------- 
  95. 	mIntro_checkpoint = { 
  96. 		{ 
  97. 			name = MISSION_START_CHECKPOINT,		-- First Checkpoint - go to ultor (gtu) 
  98. 			init = "mIntro_gtu_init",				-- init(bool mission_restart) 
  99. 			run = "mIntro_gtu_run",					-- run() 
  100. 			cleanup = "mIntro_gtu_cleanup",			-- cleanup(bool mission_exit) (+++MUST RETURN IMMEDIATELY+++) 
  101. 			next_checkpoint = nil, 
  102. 			host_start = "Player_Start_Nav_Host", 
  103. 			client_start = "Player_Start_Nav_Client", 
  104. 			p1_car_nav = "", 
  105. 			p2_car_nav = "", 
  106. 			start_groups = { mIntro_group.start_car }, 
  107. 			cp_only_groups = { }, 
  108. 		}, 
  109. 	} 
  110. 	 
  111. -------------------------------------------------------------------------------------------------- 
  112. --[[  
  113.  
  114.    _____      _                                 
  115.   / ____|    | |                                
  116.  | |    _   _| |_ ___  ___ ___ _ __   ___  ___  
  117.  | |   | | | | __/ __|/ __/ _ \ '_ \ / _ \/ __| 
  118.  | |___| |_| | |_\__ \ (_|  __/ | | |  __/\__ \ 
  119.   \_____\__,_|\__|___/\___\___|_| |_|\___||___/ 
  120. 											    
  121. 	 
  122. ]]-- 
  123. -------------------------------------------------------------------------------------------------- 
  124. 	mIntro_scene = { 
  125. 		intro = "intro", 
  126. 		outro = "Bink_MeetDane" 
  127. 	} 
  128. 	 
  129. -------------------------------------------------------------------------------------------------- 
  130. --[[   
  131.    _____                                    _   _                  
  132.   / ____|                                  | | (_)                 
  133.  | |     ___  _ ____   _____ _ __ ___  __ _| |_ _  ___  _ __  ___  
  134.  | |    / _ \| '_ \ \ / / _ \ '__/ __|/ _` | __| |/ _ \| '_ \/ __| 
  135.  | |___| (_) | | | \ V /  __/ |  \__ \ (_| | |_| | (_) | | | \__ \ 
  136.   \_____\___/|_| |_|\_/ \___|_|  |___/\__,_|\__|_|\___/|_| |_|___/ 
  137. 	 
  138. ]]-- 
  139. -------------------------------------------------------------------------------------------------- 
  140.  
  141. 	mIntro_persona = {  
  142. 		Johnny = { 
  143. 			persona_name = "Johnny_Gat", 
  144. 			persona_id = INVALID_PERSONA_HANDLE 
  145. 		}, 
  146. 		Kinzie = { 
  147. 			persona_name = "Kinzie", 
  148. 			persona_id = INVALID_PERSONA_HANDLE 
  149. 		}, 
  150. 		Dane = { 
  151. 			persona_name = "Dane", 
  152. 			persona_id = INVALID_PERSONA_HANDLE 
  153. 		}, 
  154. 	} 
  155. 	 
  156. 	mIntro_convo = { 
  157. 		--[[ = { 
  158. 			name = "file_name without voice (_bm, _wm, _bf...", 
  159. 			player_talks = true or false, 
  160. 			handle = INVALID_CONVERSATION_HANDLE, 
  161. 			convo_thread = INVALID_THREAD_HANDLE, 
  162. 			max_wait_seconds = 60,	-- if the conversation doesn't complete before this time, kill it 
  163. 			timer_thread = INVALID_THREAD_HANDLE, 
  164. 			priority = CONVO_PRIORITY_HIGH or CONVO_PRIORITY_NORMAL or CONVO_PRIORITY_OPTIONAL 
  165. 			(optional) persona_line = true,	-- this is a single line 
  166. 			(required if persona_line) speaker_name = "name of speaker",	-- single line speaker (might be set before call to play is made?) 
  167. 			(optional)phone_call = true,  -- this is a phone conversation (phone persona must be preloaded) 
  168. 			(required if phone_call) receiving_call = true or false  -- auto-answer is always true in missions (until proven otherwise) 
  169. 			 
  170. 		},]] 
  171.  
  172. 		get_dane = { 
  173. 			name = "mIntro_Get_Dane",  
  174. 			player_talks = false, 
  175. 			handle = INVALID_CONVERSATION_HANDLE, 
  176. 			convo_thread = INVALID_THREAD_HANDLE, 
  177. 			max_wait_seconds = 60, 
  178. 			timer_thread = INVALID_THREAD_HANDLE, 
  179. 			priority = CONVO_PRIORITY_NORMAL, 
  180. 		}, 
  181.  
  182. 		con_nudge_a = { 
  183. 			name = "mIntro_Nudge_A",  
  184. 			player_talks = false, 
  185. 			handle = INVALID_CONVERSATION_HANDLE, 
  186. 			convo_thread = INVALID_THREAD_HANDLE, 
  187. 			max_wait_seconds = 60, 
  188. 			timer_thread = INVALID_THREAD_HANDLE, 
  189. 			priority = CONVO_PRIORITY_NORMAL, 
  190. 		}, 
  191.  
  192. 		con_nudge_b = { 
  193. 			name = "mIntro_Nudge_B",  
  194. 			player_talks = false, 
  195. 			handle = INVALID_CONVERSATION_HANDLE, 
  196. 			convo_thread = INVALID_THREAD_HANDLE, 
  197. 			max_wait_seconds = 60, 
  198. 			timer_thread = INVALID_THREAD_HANDLE, 
  199. 			priority = CONVO_PRIORITY_NORMAL, 
  200. 		}, 
  201.  
  202. 		notoriety = { 
  203. 			name = "mIntro_First_Notoriety",  
  204. 			player_talks = false, 
  205. 			handle = INVALID_CONVERSATION_HANDLE, 
  206. 			convo_thread = INVALID_THREAD_HANDLE, 
  207. 			max_wait_seconds = 60, 
  208. 			timer_thread = INVALID_THREAD_HANDLE, 
  209. 			priority = CONVO_PRIORITY_NORMAL, 
  210. 		}, 
  211.  
  212. 		con_car = { 
  213. 			name = "mIntro_Car",  
  214. 			player_talks = false, 
  215. 			handle = INVALID_CONVERSATION_HANDLE, 
  216. 			convo_thread = INVALID_THREAD_HANDLE, 
  217. 			max_wait_seconds = 60, 
  218. 			timer_thread = INVALID_THREAD_HANDLE, 
  219. 			priority = CONVO_PRIORITY_NORMAL, 
  220. 		}, 
  221.  
  222. 		transit_talk = { 
  223. 			name = "mIntro_New_Intro_Drive",  
  224. 			player_talks = false, 
  225. 			handle = INVALID_CONVERSATION_HANDLE, 
  226. 			convo_thread = INVALID_THREAD_HANDLE, 
  227. 			max_wait_seconds = 60, 
  228. 			timer_thread = INVALID_THREAD_HANDLE, 
  229. 			priority = CONVO_PRIORITY_NORMAL, 
  230. 		}, 
  231. 		hell_talk = { 
  232. 			name = "mIntro_Hell",  
  233. 			player_talks = false, 
  234. 			handle = INVALID_CONVERSATION_HANDLE, 
  235. 			convo_thread = INVALID_THREAD_HANDLE, 
  236. 			max_wait_seconds = 60, 
  237. 			timer_thread = INVALID_THREAD_HANDLE, 
  238. 			priority = CONVO_PRIORITY_NORMAL, 
  239. 		}, 
  240. 	} 
  241. 	 
  242. 	mIntro_convo_queue = { 
  243. 		--[[start_drive_queue = {  
  244. 			{ delay = 2.0, convo = mIntro_convo.goto_first_checkpoint_nav }, 
  245. 			{ delay = 4.0, convo = mIntro_convo.goto_first_checkpoint_nav2 }, 
  246. 			{ delay = 3.0, convo = mIntro_convo.goto_first_checkpoint_nav3 }, 
  247. 			{ delay = 5.0, convo = mIntro_convo.goto_first_checkpoint_nav4 } 
  248. 		}, 
  249. 		]]-- 
  250. 	} 
  251. 	 
  252. -------------------------------------------------------------------------------------------------- 
  253. --[[  
  254.  
  255.   _______   _                            
  256.  |__   __| (_)                           
  257. 	| |_ __ _  __ _  __ _  ___ _ __ ___  
  258. 	| | '__| |/ _` |/ _` |/ _ \ '__/ __| 
  259. 	| | |  | | (_| | (_| |  __/ |  \__ \ 
  260. 	|_|_|  |_|\__, |\__, |\___|_|  |___/ 
  261. 			   __/ | __/ |               
  262. 			  |___/ |___/                
  263.  
  264.  
  265. ]]-- 
  266. -------------------------------------------------------------------------------------------------- 
  267. 	mIntro_trigger = { 
  268. 		-- = { 
  269. 		--	name = "_trigger", 
  270. 		--	hit = false, 
  271. 		-- 	last_hit_by = nil, -- 	last_hit_human = nil (set to the last human to enter the trigger in the default trigger callback) 
  272. 		--  (optional)callback = "mIntro_function_name_cb" 
  273. 		--	(optional)marker = TRIGGER_LOCATION or TRIGGER_USE or custom or don't include for no marker 
  274. 		--  (optional)waypoint = true, 
  275. 		--  (optional)teleport_to = { 
  276. 		--						host = "host_nav", 
  277. 		--						client = "client_nav"  
  278. 		--					},		 
  279. 		--	(optional)conversation = mIntro_convo.convo_name  -- play a conversation 
  280. 		--	(optional)next_trigger = "next_trigger_name" sets up next trigger when triggered (breadcrumbs) 
  281. 		--}, 
  282. 		 
  283. 									--[[ first_checkpoint_nav TRIGGERS ]]-- 
  284.  
  285. 		ultor_trigger = { 
  286. 			name = "goto_ultor_trig", 
  287. 			hit = false, 
  288. 			--marker = TRIGGER_LOCATION, 
  289. 			waypoint = false, 
  290. 		}, 
  291.  
  292. 		car_chat = { 
  293. 				name = "car_talk", 
  294. 				hit = false, 
  295. 				conversation = mIntro_convo.transit_talk, 
  296. 				--callback = "mIntro_car_talk_cb", 
  297. 				--marker = TRIGGER_LOCATION, 
  298. 				--waypoint = true, 
  299. 			}, 
  300. 		hell_chat = { 
  301. 				name = "hell_talk", 
  302. 				hit = false, 
  303. 				conversation = mIntro_convo.hell_talk, 
  304. 				--callback = "mIntro_hell_talk_cb", 
  305. 				--marker = TRIGGER_LOCATION, 
  306. 				--waypoint = true, 
  307. 			}, 
  308.  
  309. 		plan_chat = { 
  310. 				name = "plan_trigger", 
  311. 				hit = false, 
  312. 				conversation = mIntro_convo.con_nudge_a, 
  313. 				--callback = "mIntro_plan_talk_cb", 
  314. 				--marker = TRIGGER_LOCATION, 
  315. 				--waypoint = true, 
  316. 			}, 
  317. 	} 
  318. 	 
  319. -------------------------------------------------------------------------------------------------- 
  320. 																	  --[[ INTERROGATION DATA ]]-- 
  321. -------------------------------------------------------------------------------------------------- 
  322. 	--mIntro_interrogate = { 
  323. 	--	leader = { 
  324. 	--		target = mIntro_group.friendly_fire.owner, 
  325. 	--		persona = "Interrogation", 
  326. 	--		objective = "mIntro_INTERROGATE_OWNER", 
  327. 	--	--	(optional)conversation = mIntro_convo.convo_name  -- play a conversation while interrogating 
  328. 	--	}, 
  329. 	--} 
  330.  
  331. -------------------------------------------------------------------------------------------------- 
  332. 																				--[[ VFX ]]-- 
  333. --------------------------------------------------------------------------------------------------	 
  334. mIntro_vfx = { 
  335.  
  336. } 
  337.  
  338. 		 
  339. -------------------------------------------------------------------------------------------------- 
  340. --[[   
  341.  
  342.    ____  _   _                
  343.   / __ \| | | |               
  344.  | |  | | |_| |__   ___ _ __  
  345.  | |  | | __| '_ \ / _ \ '__| 
  346.  | |__| | |_| | | |  __/ |    
  347.   \____/ \__|_| |_|\___|_|    
  348. 						 
  349.  
  350. ]]-- 
  351. -------------------------------------------------------------------------------------------------- 
  352.  
  353. mIntro_homie = { 
  354. 	kinzie = "", 
  355. } 
  356.  
  357.  
  358.  
  359. mIntro_runtime = { 
  360. 	intro_land_complete = false, 
  361. 	dane_intro_complete = false, 
  362. 	mission_end_complete = false, 
  363. } 
  364.  
  365.  
  366.  
  367. mIntro_players = {} 
  368.  
  369. MM_1_2_tutorials = { 
  370. 	veh_ent = { 
  371. 		name = "vehicle entry", 
  372. 		delay = 2000, 
  373. 	}, 
  374. } 
  375.  
  376. MM_1_1_steal_a_car = { 
  377. 	{ 
  378. 		finished = false, 
  379. 	}, 
  380. 	{ 
  381. 		finished = false, 
  382. 	}, 
  383. } 
  384.  
  385. MM_1_1_set_gps_waypoint = { 
  386. 	{ 
  387. 		set = false, 
  388. 		finished = false, 
  389. 	}, 
  390. 	{ 
  391. 		set = true, 
  392. 		finished = true, 
  393. 	}, 
  394. } 
  395.  
  396. MM_1_1_go_shopping = { 
  397. 	{ 
  398. 		weapon = false, 
  399. 		upgrade = false, 
  400. 		finished = false, 
  401. 	}, 
  402. 	{ 
  403. 		weapon = true, 
  404. 		upgrade = true, 
  405. 		finished = true, 
  406. 	}, 
  407. } 
  408.  
  409.  
  410. function add_pistol() 
  411. 	local weapon_name = "Pistol-Gang" 
  412. 	local count = 120 
  413. 	local unlimited = false 
  414. 	local equip_now = true 
  415. 	--HVS_JPM - this call flags the weapon as temporary, so the next time we do a remove temporary weapon call (like in the next mission) this will go as well 
  416. 	-- using inv_item_add to make sure the player keeps this pistol 
  417. 	--inv_weapon_add_temporary(LOCAL_PLAYER, weapon_name, count, unlimited, equip_now) 
  418. 	inv_item_add(weapon_name, count, LOCAL_PLAYER, equip_now) 
  419.  
  420. 	 if (coop_is_active() == true) then 
  421. 			--inv_weapon_add_temporary(REMOTE_PLAYER, weapon_name, count, unlimited, equip_now) 
  422. 			inv_item_add(weapon_name, count, REMOTE_PLAYER, equip_now) 
  423. 	 end 
  424.  
  425. end 
  426.  
  427. function add_uzi() 
  428. 	local weapon_name = "SMG-Brimstone_Uzi" 
  429. 	local count = 1 
  430. 	local unlimited = true 
  431. 	local equip_now = true 
  432. 	inv_weapon_add_temporary(LOCAL_PLAYER, weapon_name, count, unlimited, equip_now) 
  433. 	weapon_apply_upgrade(LOCAL_PLAYER, "SMG-Brimstone_Uzi", 4) 
  434. 	weapon_apply_upgrade(LOCAL_PLAYER, "SMG-Brimstone_Uzi", 9) 
  435. 	weapon_apply_upgrade(LOCAL_PLAYER, "SMG-Brimstone_Uzi", 14) 
  436. 	weapon_apply_upgrade(LOCAL_PLAYER, "SMG-Brimstone_Uzi", 15) 
  437.  
  438. 	 if (coop_is_active() == true) then 
  439. 			inv_weapon_add_temporary(REMOTE_PLAYER, weapon_name, count, unlimited, equip_now) 
  440. 			weapon_apply_upgrade(REMOTE_PLAYER, "SMG-Brimstone_Uzi", 4) 
  441. 	 end 
  442.  
  443. end 
  444.  
  445. function add_bolter() 
  446. 	local weapon_name = "Rifle-LavaBolter" 
  447. 	local count = 1 
  448. 	local unlimited = true 
  449. 	local equip_now = false 
  450. 	inv_weapon_add_temporary(LOCAL_PLAYER, weapon_name, count, unlimited, equip_now) 
  451.  
  452. 	 if (coop_is_active() == true) then 
  453. 			inv_weapon_add_temporary(REMOTE_PLAYER, weapon_name, count, unlimited, equip_now) 
  454. 	 end 
  455.  
  456. end 
  457.  
  458. function add_rpg() 
  459. 	local weapon_name = "Explosive-RocketLauncher" 
  460. 	local count = 1 
  461. 	local unlimited = true 
  462. 	local equip_now = false 
  463. 	inv_weapon_add_temporary(LOCAL_PLAYER, weapon_name, count, unlimited, equip_now) 
  464.  
  465. 	 if (coop_is_active() == true) then 
  466. 			inv_weapon_add_temporary(REMOTE_PLAYER, weapon_name, count, unlimited, equip_now) 
  467. 	 end 
  468.  
  469. end 
  470.  
  471.  
  472. -------------------------------------------------------------------------------------------------- 
  473. --[[ 
  474.  
  475.    _____ _                  _               _   ______                _   _                  
  476.   / ____| |                | |             | | |  ____|              | | (_)                 
  477.  | (___ | |_ __ _ _ __   __| | __ _ _ __ __| | | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
  478.   \___ \| __/ _` | '_ \ / _` |/ _` | '__/ _` | |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
  479.   ____) | || (_| | | | | (_| | (_| | | | (_| | | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
  480.  |_____/ \__\__,_|_| |_|\__,_|\__,_|_|  \__,_| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
  481. 																							 
  482. 																							 
  483. ]]-- 
  484.  
  485. -- This is the primary entry point for the mission, and is responsible for starting up the mission 
  486. -- at the specified checkpoint. 
  487. -- CALLED FROM CODE 
  488. -- 
  489. -- start_checkpoint_name:	(string) The checkpoint the mission should begin at 
  490. -- is_restart:					(bool) TRUE if the mission is restarting, FALSE otherwise 
  491. -- 
  492. function mIntro_start(start_checkpoint_name, is_restart) 
  493. 	 
  494. 	-- HVS_BDF 4/14/14: The conventional way of handling fades when starting a mission is to use 
  495. 	-- the mission_start_fade_out() and mission_start_fade_in() functions.  These functions do a 
  496. 	-- few different things (one does the inverse of the other) including the disabling of player 
  497. 	-- controls. 
  498. 	-- In cases where we don't start the mission with a SAM, this is a good thing. 
  499. 	-- However, if we want to fade in directly into a SAM that's already in progress,  
  500. 	-- DO NOT call mission_start_fade_in() because this could re-enable the player controls 
  501. 	-- that were disabled when the SAM started.  Instead, use the standard fade_in() function 
  502. 	-- and let the SAM take care of re-enabling the player controls when it is finished. 
  503. 	mission_start_fade_out() 
  504. 	 
  505.  
  506. 	hvUnlockLoadout("mIntro") 
  507. 	 
  508. 	-- HVS_BDF: we don't necessarily want to call load_persona() because this creates a 2D 
  509. 	-- version, which can prevent actual in-game characters from lip syncing their VO if 
  510. 	-- the 2D persona was loaded prior to their character being spawned. 
  511. 	-- In the case of PC characters, they are present in the world  
  512. 	-- and their characters should lip sync their VO.  Same with Dane. 
  513. 	--load_persona(mIntro_persona.Johnny) 
  514. 	--load_persona(mIntro_persona.Kinzie) 
  515. 	--load_persona(mIntro_persona.Dane) 
  516. 	 
  517. 	-- HVS_JPM - Why are we calling this? There isn't any gameplay before this mission anyway so why would we restore their inventories back to nothing? 
  518. 	--player_inventory_restore_on_mission_exit(LOCAL_PLAYER) 
  519. 	--player_inventory_restore_on_mission_exit(REMOTE_PLAYER) 
  520. 	 
  521. 	--add_pistol() 
  522.  
  523. 	 
  524. 	 
  525. 	while (player_customization_is_finalized( LOCAL_PLAYER ) == false) do 
  526. 		delay(0.25) 
  527. 	end 
  528. 	 
  529. 	--notoriety_force_no_spawn(true) 
  530.  
  531. 	-- initialize systems 
  532. 	mission_startup(mIntro_trigger, mIntro_convo) -- mIntro_checkpoint 
  533. 	-- if using interrogations 
  534. 	--interrogate_startup(mIntro_interrogate) 
  535. 	 
  536. 	local start_cp = get_table_by_name(mIntro_checkpoint, MISSION_START_CHECKPOINT) 
  537.  
  538. 	-- Check if this mission starting from the beginning 
  539. 	if (start_checkpoint_name == start_cp.name) then 
  540. 		if (is_restart == false and mIntro_scene.intro ~= "") then 
  541. 			-- First time playing mission 
  542. 			local fade_in_after = false 
  543. 			cutscene_play(mIntro_scene.intro, nil, {start_cp.host_start, start_cp.client_start}, fade_in_after) 
  544. 		else 
  545. 			teleport_coop(start_cp.host_start, start_cp.client_start, true) 
  546. 		end 
  547. 		fade_out(0) 
  548. 	end 
  549. 	 
  550. 	inv_item_remove_all(LOCAL_PLAYER) 
  551. 	inv_item_remove_all(REMOTE_PLAYER) 
  552.  
  553. 	--HVS_BAS - there was some odd saving in coop, start single player game bs with this, so we need to make sure that we are using GAT 
  554. 	--or else we get some hellish gat body, kinzie face, and no one wants that. 
  555. 	if not coop_is_active() and not player_is_default_character() then 
  556. 		player_swap_character() 
  557. 	end 
  558.  
  559. 	-- HVS_JPM - we cleared their inventory and didn't add the pistol back... 
  560. 	add_pistol() 
  561.  
  562. 	local add_to_wardrobe = false 
  563. 	local clear_facewear = false 
  564. 	customization_item_wear( "cm_PCGatJSuit", "PC_Gat_Jsuit.cmeshx", "default", add_to_wardrobe, SYNC_LOCAL, clear_facewear ) 
  565. 	if(coop_is_active()) then 
  566. 		customization_item_wear( "cf_PCKinzieJSuit", "cf_pckinziejsuit.cmeshx", "default", add_to_wardrobe, SYNC_REMOTE, not clear_facewear ) 
  567. 	end 
  568. 	-- Handle mission initialization for the current checkpoint 
  569. 	mIntro_initialize(start_checkpoint_name) 
  570.  
  571. 	-- Run the mission from the current checkpoint 
  572. 	checkpoint_run_mission(mIntro_checkpoint, start_checkpoint_name) 
  573.  
  574. 	if(mIntro_runtime.mission_end_complete == false) then 
  575. 		mission_end_success("mIntro", mIntro_scene.outro) 
  576. 	end	 
  577. 		 
  578. 	--mission_end_success("mIntro", mIntro_scene.outro) --, {, }) 
  579.  
  580. end 
  581.  
  582. -- This is the primary function responsible for cleaning up the entire mission 
  583. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
  584. -- 
  585. function mIntro_cleanup() 
  586. 	--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]-- 
  587. 	-- cleanup all threads 
  588. 	cleanup_threads(mIntro_thread) 
  589. 	 
  590. 	-- run checkpoint cleanups (move into mission_shutdown?) 
  591. 	checkpoint_cleanup_mission(mIntro_checkpoint) 
  592. 	 
  593. 	-- cleanup triggers, convos, kill_list and interrogations 
  594. 	mission_shutdown() 
  595. 	 
  596. 	-- cleanup all groups 
  597. 	cleanup_groups(mIntro_group) 
  598.  
  599. 	-- allow superpowers 
  600. 	player_super_attacks_enable(true) 
  601. 	player_super_movement_enable(true) 
  602.  
  603. 	tutorial_stop(MM_1_2_tutorials.veh_ent.name) 
  604.  
  605. 	-- remove unlimited ammo temp weapons 
  606. 	--inv_weapon_remove_temporary(LOCAL_PLAYER,"Pistol-Gang") 
  607. 	--inv_weapon_remove_temporary(LOCAL_PLAYER,"SMG-Brimstone_Uzi") 
  608. 	--inv_weapon_remove_temporary(LOCAL_PLAYER,"Rifle-LavaBolter") 
  609.  
  610. 	-- if (coop_is_active() == true) then 
  611. 		--inv_weapon_remove_temporary(REMOTE_PLAYER,"Pistol-Gang") 
  612. 		--inv_weapon_remove_temporary(REMOTE_PLAYER,"SMG-Brimstone_Uzi") 
  613. 		--inv_weapon_remove_temporary(REMOTE_PLAYER,"Rifle-LavaBolter") 
  614. 	-- end 
  615.  
  616. 	--turn on soul clusters 
  617. 	collectible_hide_orbs(false) 
  618.  
  619. 	on_placed_waypoint("") 
  620. 	 
  621. 	on_purchase("") 
  622.  
  623. 	on_notoriety_event("") 
  624.  
  625. 	pause_map_tutorial_mode(false) 
  626. 	 
  627. 	store_weapon_tutorial_mode(false) 
  628. 	spawning_vehicles(true)  
  629.  
  630.     on_seamless_animated_moment_end("") 
  631.     seamless_animated_moment_cleanup() 
  632.  
  633. end 
  634.  
  635. -- Called when the mission has ended with success 
  636. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
  637. -- 
  638. function mIntro_success() 
  639. 	--[[ INSERT ANY MISSION SPECIFIC SUCCESS STUFF ]]-- 
  640. 	 
  641. end 
  642.  
  643. -------------------------------------------------------------------------------------------------- 
  644. --[[ 
  645.  
  646.  
  647.   _____       _ _   _       _ _           ______                _   _                  
  648.  |_   _|     (_) | (_)     | (_)         |  ____|              | | (_)                 
  649.    | |  _ __  _| |_ _  __ _| |_ _______  | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
  650.    | | | '_ \| | __| |/ _` | | |_  / _ \ |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
  651.   _| |_| | | | | |_| | (_| | | |/ /  __/ | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
  652.  |_____|_| |_|_|\__|_|\__,_|_|_/___\___| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
  653. 																					   
  654. 																					   
  655. ]]-- 
  656. -- Initialize the mission for the specified checkpoint 
  657. -- 
  658. -- checkpoint_name:		(string) Checkpoint to initialize the mission to 
  659. -- 
  660. function mIntro_initialize(checkpoint_name) 
  661. 	-- Common initialization 
  662. 	mIntro_initialize_common() 
  663. 	 
  664. 	-- Checkpoint specific initialization 
  665. 	checkpoint_init(mIntro_checkpoint, checkpoint_name) 
  666.  
  667. 	-- Get the player names 
  668. 	mIntro_players = player_names_get_all() 
  669.  
  670. 	-- Remove any present subtitles 
  671. 	message_remove_all() 
  672.  
  673. 	-- Start fading in  
  674. 	mission_start_fade_in() 
  675. end 
  676.  
  677. -- Handle any common initialization 
  678. -- 
  679. function mIntro_initialize_common() 
  680. 	--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]-- 
  681.  
  682. 	--Turn off any and all super powers 
  683. 	player_super_attacks_enable(false) 
  684. 	player_super_movement_enable(false) 
  685.  
  686. 	collectible_hide_orbs(true) 
  687. 	 
  688. 	add_pistol() 
  689.  
  690. end 
  691.  
  692. -- function mIntro_setup_homies( ) 
  693. 	-- if mIntro_groups.homies.kinzie ~= nil and coop_is_active()==false and mIntro_groups.homies.kinzie ~= "" then 
  694. 		 
  695. 		-- if (add_to_party == true) then 
  696. 			-- party_add(mIntro_groups.homies.kinzie, LOCAL_PLAYER) 
  697. 		-- end 
  698. 		 
  699. 		-- on_death("mIntro_failure_kinzie_died_cb", mImpfest_homie.kinzie) 
  700. 		-- on_dismiss("mIntro_failure_dismissed_cb", mImpfest_homie.kinzie) 
  701. 	-- end 
  702.  
  703. 	-- -- the co-op check here to get rid of her 
  704. 	-- if (coop_is_active() == true) then 
  705. 		-- mIntro_cleanup_homies() 
  706. 		-- group_destroy(mIntro_groups.homies.kinzie) 
  707. 	-- end 
  708. -- end 
  709.  
  710. -- -- remove callbacks for homies 
  711. -- -- 
  712. -- function mIntro_cleanup_homies() 
  713. 	-- if mIntro_groups.homies.kinzie ~= nil and coop_is_active()==false then 
  714. 		-- on_death("", mIntro_groups.homies.kinzie) 
  715. 		-- on_dismiss("", mIntro_groups.homies.kinzie) 
  716. 	-- end 
  717. -- end 
  718.  
  719. -------------------------------------------------------------------------------------------------- 
  720. --[[ 
  721.  
  722.  
  723.    _____ _               _                _       _     ______                _   _                  
  724.   / ____| |             | |              (_)     | |   |  ____|              | | (_)                 
  725.  | |    | |__   ___  ___| | ___ __   ___  _ _ __ | |_  | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
  726.  | |    | '_ \ / _ \/ __| |/ / '_ \ / _ \| | '_ \| __| |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
  727.  | |____| | | |  __/ (__|   <| |_) | (_) | | | | | |_  | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
  728.   \_____|_| |_|\___|\___|_|\_\ .__/ \___/|_|_| |_|\__| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
  729. 							 | |                                                                     
  730. 							 |_|                                                                     
  731.  
  732. ]]-- 
  733. -------------------------------------------------------------------------------------------------- 
  734. --[[  
  735.  
  736.    _____         _          _    _ _ _              
  737.   / ____|       | |        | |  | | | |             
  738.  | |  __  ___   | |_ ___   | |  | | | |_ ___  _ __  
  739.  | | |_ |/ _ \  | __/ _ \  | |  | | | __/ _ \| '__| 
  740.  | |__| | (_) | | || (_) | | |__| | | || (_) | |    
  741.   \_____|\___/   \__\___/   \____/|_|\__\___/|_|    
  742.                                                     
  743.  
  744. ]]-- 
  745. -------------------------------------------------------------------------------------------------- 
  746.  
  747. -- Initialize this checkpoint. 
  748. -- 
  749. -- mission_start: (bool) Whether we're initializing from a mission (re)start or from 
  750. --					a natural play-through. 
  751. -- 
  752. function mIntro_gtu_init(mission_start) 
  753.  
  754. 	--set up single player only homie Kinzie 
  755. 	if (coop_is_active() == false) then 
  756. 		local block = true 
  757. 		group_create( mIntro_group.kinzie_npc_start.name, block ) 
  758. 		mIntro_setup_homies ( mIntro_group.kinzie_npc_start ) 
  759. 	end 
  760.  
  761. 	local sam_land_kinzie = mIntro_homie.kinzie 
  762.  
  763. 	if (coop_is_active() == true) then 
  764. 		sam_land_kinzie = REMOTE_PLAYER 
  765. 	end 
  766.  
  767. 	-- Start the SAM for land introduction 
  768. 	local actor_list = { sam_land_kinzie, LOCAL_PLAYER } 
  769. 	seamless_animated_moment_prep("sam_intro_land", actor_list) 
  770. 	on_seamless_animated_moment_end("sam_intro_land_complete") 
  771.  
  772. 	-- HVS_BDF 4/14/14: The conventional way of handling fades when starting a mission is to use 
  773. 	-- the mission_start_fade_out() and mission_start_fade_in() functions.  These functions do a 
  774. 	-- few different things (one does the inverse of the other) including the disabling of player 
  775. 	-- controls. 
  776. 	-- In cases where we don't start the mission with a SAM, this is a good thing. 
  777. 	-- However, if we want to fade in directly to a SAM that's already in progress,  
  778. 	-- DO NOT call mission_start_fade_in() because this could re-enable the player controls 
  779. 	-- that were disabled when the SAM started.  Instead, use the standard fade_in() function 
  780. 	-- and let the SAM take care of re-enabling the player controls when it is finished. 
  781. 	seamless_animated_moment_start("sam_intro_land", actor_list) 
  782. 	fade_in(0.2) 
  783.  
  784. 	--Wait until the SAM has completed 
  785.     while(mIntro_runtime.intro_land_complete == false) do 
  786.          thread_yield() 
  787. 	end 
  788. 	 
  789. 	on_seamless_animated_moment_end("") 
  790.  
  791.  
  792. end 
  793.  
  794. -- The first objective 
  795. -- 
  796. function mIntro_gtu_run() 
  797. 	  
  798. 	--HVS_RCK - Just in case there's still a kinzie lurking around and we're now in coop, ditch her. 
  799. 	if (coop_is_active() == true) then 
  800. 		mIntro_cleanup_homies() 
  801. 		group_destroy(mIntro_group.kinzie_npc_start) 
  802. 	end 
  803.  
  804. 	on_respawn("handle_player_respawn", LOCAL_PLAYER) 
  805.  
  806. 	notoriety_set_max("police", 2) 
  807. 		  
  808. 	--tutorial_start("sprint_normal", 1000, true) 
  809.  
  810.  
  811. 	group_create( mIntro_group.dane_npc.name, true ) 
  812. 	npc_leash_to_nav(mIntro_group.dane_npc.npcs[1],"dane_mark<001>",0.0) 
  813. 	turn_invulnerable(mIntro_group.dane_npc.npcs[1]) 
  814. 	character_allow_ragdoll(mIntro_group.dane_npc.npcs[1], false) 
  815. 	character_prevent_flinching(mIntro_group.dane_npc.npcs[1], true) 
  816.  
  817. 	trigger_setup(mIntro_trigger.car_chat) 
  818. 	trigger_setup(mIntro_trigger.hell_chat) 
  819. 	trigger_setup(mIntro_trigger.plan_chat) 
  820. 	objective_text(0, "MM_1_1_OBJ_STEAL_A_CAR", nil, nil, SYNC_ALL, OI_ASSET_USE)	 
  821. 	--set_ignore_ai_flag(mIntro_group.dane_npc.npcs[1], true) 
  822. 	--set_animation_group(mIntro_group.dane_npc.npcs[1], "stand" ) 
  823. 	--set_animation_state(mIntro_group.dane_npc.npcs[1], "stand") 
  824. 	--character_set_animation_overrides(mIntro_group.dane_npc.npcs[1],"stand") 
  825. 	set_animation_set(mIntro_group.dane_npc.npcs[1], "Dane")	 
  826. 	set_script_animation_state(mIntro_group.dane_npc.npcs[1],"stand")	 
  827.  
  828. 	tutorial_start("sprint_normal", 150, true) 
  829.  
  830. 	convo_start(mIntro_convo.get_dane) 
  831. 	convo_wait_for_end() 
  832. 	 
  833. 	if character_is_in_vehicle(LOCAL_PLAYER) == false then 
  834. 		convo_start(mIntro_convo.con_car) 
  835. 		convo_wait_for_end() 
  836. 	end	 
  837.  
  838. 	objective_text_clear(0) 
  839. 	 
  840. 	-- Have player(s) steal a car, if needed (local/remote separate) 
  841. 	local vehicle_entry_tutorial = true 
  842. 	if not character_is_in_vehicle(LOCAL_PLAYER) then 
  843. 		objective_text(0, "MM_1_1_OBJ_STEAL_A_CAR", nil, nil, SYNC_LOCAL, OI_ASSET_USE) 
  844. 		--vehicle_entry_tutorial = true 
  845. 	end 
  846. 	if coop_is_active() then 
  847. 		if not character_is_in_vehicle(REMOTE_PLAYER) then 
  848. 			MM_1_1_steal_a_car[SYNC_REMOTE].finished = false 
  849. 			objective_text(1, "MM_1_1_OBJ_STEAL_A_CAR", nil, nil, SYNC_REMOTE, OI_ASSET_USE) 
  850. 			--vehicle_entry_tutorial = true 
  851. 		end 
  852. 	end 
  853. 	 
  854. 	-- Start Vehicle Entry tutorial (infinite), if needed 
  855. 	if (vehicle_entry_tutorial == true) then 
  856. 		tutorial_start(MM_1_2_tutorials.veh_ent.name, MM_1_2_tutorials.veh_ent.delay, true, true, true) 
  857. 	end 
  858.  
  859. 		 
  860. 	-- Wait for player(s) to steal a car (local/remote separate) 
  861. 	while ((MM_1_1_steal_a_car[SYNC_LOCAL].finished == false) 
  862. 	and (MM_1_1_steal_a_car[SYNC_REMOTE].finished == false)) do 
  863. 	 
  864. 		-- Check if local player is in a vehicle 
  865. 		if character_is_in_vehicle(LOCAL_PLAYER) then 
  866. 		 
  867. 			-- If local player just finished, have them wait for remote player, if needed 
  868. 			-- Hacked so coop won't mess up progression..KT_HVS 
  869. 			if (MM_1_1_steal_a_car[SYNC_LOCAL].finished == false) then 
  870. 				--if (MM_1_1_steal_a_car[SYNC_REMOTE].finished == false) then 
  871. 					--objective_text(0, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_LOCAL, OI_ASSET_LOCATION) 
  872. 				--end 
  873. 				MM_1_1_steal_a_car[SYNC_LOCAL].finished = true 
  874. 				MM_1_1_steal_a_car[SYNC_REMOTE].finished = true 
  875. 				vehicle_entry_tutorial = false 
  876. 			end 
  877. 			 
  878. 		end 
  879. 		 
  880. 		-- Check if remote player is in a vehicle 
  881. 		if character_is_in_vehicle(REMOTE_PLAYER) then 
  882. 		 
  883. 			-- If remote player just finished, have them wait for local player, if needed 
  884. 			if (MM_1_1_steal_a_car[SYNC_REMOTE].finished == false) then 
  885. 				--if (MM_1_1_steal_a_car[SYNC_LOCAL].finished == false) then 
  886. 					--objective_text(1, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_REMOTE, OI_ASSET_LOCATION) 
  887. 				--end 
  888. 				MM_1_1_steal_a_car[SYNC_LOCAL].finished = true 
  889. 				MM_1_1_steal_a_car[SYNC_REMOTE].finished = true 
  890. 				vehicle_entry_tutorial = false 
  891. 			end 
  892. 			 
  893. 		end 
  894. 				 
  895. 		-- Let other threads run 
  896. 		thread_yield() 
  897. 		 
  898. 	end 
  899. 	 
  900. 	-- Clear objective text (local/remote separate) 
  901. 	objective_text_clear(0) 
  902. 	if coop_is_active() then 
  903. 		objective_text_clear(1) 
  904. 	end 
  905.  
  906. 	-- Stop Vehicle Entry tutorial 
  907. 	tutorial_stop(MM_1_2_tutorials.veh_ent.name) 
  908.  
  909. 	player_vehicle = get_char_vehicle_name(LOCAL_PLAYER) 
  910. 	radio_set_station(player_vehicle, 1) 
  911.  
  912.  
  913. 	objective_text(0,"","GM_INTRO_ULTOR_01","",SYNC_ALL,OI_ASSET_LOCATION) 
  914. 	trigger_setup(mIntro_trigger.ultor_trigger)	 
  915. 	--delay(8.0) 
  916. 	--tutorial_start("jump_climb", 600, true) 
  917.  
  918. 	--delay(8.0) 
  919. 	--tutorial_start("crouch", 600, true) 
  920. 	--tutorial_vehicle_controls_enabled(true) 
  921.  
  922. 	-- Wait for Kinzie to call out HUB 
  923.  
  924.  
  925. 	 
  926. 	tutorial_stop_current() 
  927. 	if character_is_in_vehicle(LOCAL_PLAYER) == false then 
  928. 	tutorial_start("combat_weapons", 0, true) 
  929. 	end	 
  930. 	 
  931.  
  932. 	 
  933. 	convo_start(mIntro_convo.con_nudge_b)	 
  934. 	convo_wait_for_end()	 
  935. 	 
  936.  
  937. 	delay(2) 
  938.  
  939. 	-- Unlock cellphone, if needed 
  940. 	--if (mm_1_1_phone_lock == true) then 
  941. 		--cellphone_lock(false) 
  942. 		--mm_1_1_phone_lock = false 
  943. 	--end 
  944. 	 
  945. 	-- Setup callback to track if GPS waypoint was set 
  946. 	on_placed_waypoint("mm_1_1_gps_set_cb") 
  947. 	 
  948. 	on_purchase("mm_1_1_item_purchased_cb") 
  949.  
  950. 	on_notoriety_event("mIntro_combat_tutorial") 
  951. 	 
  952. 	-- Setup HUB map tutorial mode 
  953. 	pause_map_tutorial_mode(true) 
  954. 	 
  955. 	store_weapon_tutorial_mode(true) 
  956. 	 
  957. 	-- Have player(s) set GPS waypoint to Friendly Fire (local/remote separate) 
  958. 	--objective_text(0, "MM_1_1_OBJ_ACCESS_HUB", nil, nil, SYNC_LOCAL, OI_ASSET_USE) 
  959. 	hud_prompt(LOCAL_PLAYER, "MM_1_1_ACT_ACCESS_HUB", "mm_1_1_hud_prompt_cb") 
  960. 	if coop_is_active() then 
  961. 		MM_1_1_set_gps_waypoint[SYNC_REMOTE].set = false 
  962. 		MM_1_1_set_gps_waypoint[SYNC_REMOTE].finished = false 
  963. 		--objective_text(1, "MM_1_1_OBJ_ACCESS_HUB", nil, nil, SYNC_REMOTE, OI_ASSET_USE) 
  964. 		hud_prompt(REMOTE_PLAYER, "MM_1_1_ACT_ACCESS_HUB", "mm_1_1_hud_prompt_cb") 
  965. 	end 
  966. 	 
  967. 	-- Wait for player(s) to set GPS waypoint to Friendly Fire (local/remote separate) 
  968. 	while ((MM_1_1_set_gps_waypoint[SYNC_LOCAL].finished == false)  
  969. 	or (MM_1_1_set_gps_waypoint[SYNC_REMOTE].finished == false)) do 
  970. 	 
  971. 		-- Check if local player set GPS waypoint 
  972. 		if (MM_1_1_set_gps_waypoint[SYNC_LOCAL].set == true) then 
  973. 		 
  974. 			-- If local player just finished, have them wait for remote player, if needed 
  975. 			if (MM_1_1_set_gps_waypoint[SYNC_LOCAL].finished == false) then 
  976. 				if (MM_1_1_set_gps_waypoint[SYNC_REMOTE].finished == false) then 
  977. 					--objective_text(0, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_LOCAL, OI_ASSET_LOCATION) 
  978. 					hud_prompt_clear(LOCAL_PLAYER) 
  979. 				end 
  980. 				MM_1_1_set_gps_waypoint[SYNC_LOCAL].finished = true 
  981. 			end 
  982. 			 
  983. 		end 
  984. 		 
  985. 		-- Check if remote player set GPS waypoint 
  986. 		if (MM_1_1_set_gps_waypoint[SYNC_REMOTE].set == true) then 
  987. 		 
  988. 			-- If remote player just finished, have them wait for local player, if needed 
  989. 			if (MM_1_1_set_gps_waypoint[SYNC_REMOTE].finished == false) then 
  990. 				if (MM_1_1_set_gps_waypoint[SYNC_LOCAL].finished == false) then 
  991. 					--objective_text(1, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_REMOTE, OI_ASSET_LOCATION) 
  992. 					hud_prompt_clear(REMOTE_PLAYER) 
  993. 				end 
  994. 				MM_1_1_set_gps_waypoint[SYNC_REMOTE].finished = true 
  995. 			end 
  996. 			 
  997. 		end 
  998. 		 
  999. 		if (MM_1_1_go_shopping[SYNC_LOCAL].upgrade == true) and (MM_1_1_go_shopping[SYNC_REMOTE].upgrade == true) then 
  1000. 			store_weapon_tutorial_mode(false) 
  1001. 		end 
  1002. 		 
  1003. 		if mIntro_trigger.ultor_trigger.hit then 
  1004. 			break 
  1005. 		end 
  1006. 		-- Let other threads run 
  1007. 		thread_yield() 
  1008. 		 
  1009. 	end 
  1010. 	 
  1011. 	if not mIntro_trigger.ultor_trigger.hit then 
  1012. 		while (MM_1_1_go_shopping[SYNC_LOCAL].upgrade == false) or (MM_1_1_go_shopping[SYNC_REMOTE].upgrade == false) do 
  1013. 			if (MM_1_1_go_shopping[SYNC_LOCAL].upgrade == true) and (MM_1_1_go_shopping[SYNC_REMOTE].upgrade == true) then 
  1014. 				store_weapon_tutorial_mode(false) 
  1015. 			end 
  1016. 			 
  1017. 			if mIntro_trigger.ultor_trigger.hit then 
  1018. 				break 
  1019. 			end 
  1020. 			thread_yield() 
  1021. 		end 
  1022. 	end 
  1023. 	 
  1024. 	on_purchase("") 
  1025. 	 
  1026. 	-- Clear waypoint callback 
  1027. 	on_placed_waypoint("") 
  1028. 	 
  1029. 	-- Clear HUB map tutorial mode 
  1030. 	pause_map_tutorial_mode(false) 
  1031. 	 
  1032. 	store_weapon_tutorial_mode(false) 
  1033. 	 
  1034. 	-- Clear objective text (local/remote separate) 
  1035. 	objective_text_clear(0) 
  1036. 	hud_prompt_clear(LOCAL_PLAYER) 
  1037. 	if coop_is_active() then 
  1038. 		objective_text_clear(1) 
  1039. 		hud_prompt_clear(REMOTE_PLAYER) 
  1040. 	end 
  1041. 	 
  1042. 	--this needs to be coop_safe, or else odd stuff happens 
  1043. 	--if (coop_is_active() == true) then 
  1044. 		--local inside = false 
  1045. 		--local radius = trigger_get_radius(mIntro_trigger.ultor_trigger.name) 
  1046. 		--local k_in = false 
  1047. 		--local g_in = false 
  1048. 		--while not inside do 
  1049. 			 
  1050. 			--local gat_inside = false 
  1051. 			--local kinzie_inside = false 
  1052. 			--if(get_dist(LOCAL_PLAYER, mIntro_trigger.ultor_trigger.name) < radius) then 
  1053.  
  1054. 				--gat_inside = true 
  1055. 				--if(gat_inside ~= g_in) then 
  1056. 					--objective_text( 0, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_LOCAL, OI_ASSET_LOCATION ) 
  1057. 				--end 
  1058. 				--g_in = true 
  1059. 			--end 
  1060.  
  1061. 		 
  1062. 			--if(get_dist(REMOTE_PLAYER, mIntro_trigger.ultor_trigger.name) < radius) then 
  1063. 				--kinzie_inside = true 
  1064. 				--only show this once 
  1065. 				--if(kinzie_inside ~= k_in) then 
  1066. 					--objective_text( 0, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_REMOTE, OI_ASSET_LOCATION ) 
  1067. 				--end 
  1068. 				--k_in = true 
  1069. 				 
  1070. 			--end 
  1071.  
  1072. 			--if gat_inside and kinzie_inside then 
  1073. 				--inside = true 
  1074. 			--end 
  1075. 			--thread_yield() 
  1076. 		--end 
  1077. 	--else 
  1078. 		--while not mIntro_trigger.ultor_trigger.hit do 
  1079. 			--thread_yield() 
  1080. 		--end 
  1081. 	--end	 
  1082.  
  1083. 	while not mIntro_trigger.ultor_trigger.hit do 
  1084. 		thread_yield() 
  1085. 	end 
  1086.  
  1087. 	objective_text_clear(0) 
  1088.  
  1089. 	notoriety_reset("police") 
  1090. 	notoriety_set("police", 0) 
  1091. 		 
  1092. 	if (character_has_human_shield(LOCAL_PLAYER) == true) then 
  1093. 		player_release_human_shield(LOCAL_PLAYER, false, true) 
  1094. 	end 
  1095.  
  1096. 	if (coop_is_active() == true) then 
  1097. 		if (character_has_human_shield(REMOTE_PLAYER) == true) then 
  1098. 			player_release_human_shield(REMOTE_PLAYER, false, true) 
  1099. 		end 
  1100. 	end 
  1101.  
  1102. 	character_evacuate_from_all_vehicles(LOCAL_PLAYER, false, true) 
  1103.  
  1104. 	 if (coop_is_active() == false) then 
  1105. 		character_evacuate_from_all_vehicles(mIntro_homie.kinzie, false, true) 
  1106. 	 else 
  1107. 		character_evacuate_from_all_vehicles(REMOTE_PLAYER, false, true) 
  1108. 	 end 
  1109.  
  1110. 	group_hide(mIntro_group.start_car) 
  1111.  
  1112. 	--world_despawn_all_vehicles() 
  1113. 	spawning_vehicles(false)  
  1114. 	teleport_player_vehicles("carpoint_01", "carpoint_02") 
  1115.  
  1116. 	delay(0.2) 
  1117.  
  1118. -- Teleport co-op player into place as well 
  1119. 	if (coop_is_active() == true) then 
  1120. 		local teleport_player = REMOTE_PLAYER 
  1121. 		local teleport_sync = SYNC_REMOTE 
  1122. 		 
  1123. 		if (mIntro_trigger.ultor_trigger.last_hit_by == REMOTE_PLAYER) then 
  1124. 				teleport_player = LOCAL_PLAYER 
  1125. 				teleport_sync = SYNC_LOCAL 
  1126. 		end 
  1127. 		 
  1128. 		fade_out(1.0, 0, teleport_sync) 
  1129. 		 
  1130. 		teleport(teleport_player, "player_2_telenav") 
  1131. 		while teleport_check_done(teleport_player) == false do 
  1132. 			thread_yield() 
  1133. 		end	 
  1134. 		 
  1135. 		fade_in(1.0, 0, teleport_sync) 
  1136. 	end  
  1137.  
  1138. 	trigger_clear(mIntro_trigger.car_chat.name) 
  1139. 	trigger_clear(mIntro_trigger.hell_chat.name) 
  1140. 	trigger_clear(mIntro_trigger.plan_chat.name) 
  1141. 	local sam_dane_kinzie = mIntro_homie.kinzie 
  1142.  
  1143.  
  1144. 	--character_set_animation_overrides(mIntro_group.dane_npc.npcs[1],"") 
  1145. 	--clear_animation_state(mIntro_group.dane_npc.npcs[1]) 
  1146. 	 	 	  
  1147. 	 audio_object_post_event( "Play_IntroSequence_Music_Stop" ) 
  1148. 	 audio_object_post_event( "Play_DaneIntro" ) 
  1149. 	 audio_object_post_event( "Play_MKing_Dane_Intro" ) 
  1150.  
  1151. 	 if (coop_is_active() == true) then 
  1152. 			sam_dane_kinzie = REMOTE_PLAYER 
  1153. 	 end 
  1154.  
  1155.  
  1156. 	--Dane SAM 
  1157. 	local actor_list = { mIntro_group.dane_npc.dane, LOCAL_PLAYER, sam_dane_kinzie } 
  1158. 	seamless_animated_moment_prep("sam_dane_intro", actor_list) 
  1159.  
  1160.  
  1161.  
  1162. 	on_seamless_animated_moment_end("SAM_dane_intro_complete") 
  1163. 	seamless_animated_moment_start("sam_dane_intro", actor_list) 
  1164.  
  1165. 	-- register a callback function to be called at the end 
  1166. 	on_anim_trigger( "mIntro_SAM_fade_out", mIntro_group.dane_npc.dane ) 
  1167.  
  1168. 	--Wait until the SAM has completed 
  1169.     while(mIntro_runtime.dane_intro_complete == false) do 
  1170.          thread_yield() 
  1171. 	end 
  1172. 	 
  1173. 	on_seamless_animated_moment_end("") 
  1174. 	 
  1175. end 
  1176.  
  1177. -- Do any cleanup for this checkpoint. 
  1178. -- 
  1179. -- (+++THIS IS CALLED FROM MISSION CLEANUP, MUST RETURN IMMEDIATELY+++) 
  1180. -- 
  1181. -- mission_exit: (bool) Whether we're exiting the mission entirely, or just 
  1182. --					moving on to the next checkpoint. 
  1183. -- 
  1184. function mIntro_gtu_cleanup(mission_exit) 
  1185.  
  1186. 	seamless_animated_moment_cleanup() 
  1187. 	 
  1188. 	on_respawn("", LOCAL_PLAYER) 
  1189. 	on_respawn("", REMOTE_PLAYER) 
  1190.  
  1191. 	on_seamless_animated_moment_end("") 
  1192.  
  1193. 	on_placed_waypoint("") 
  1194.  
  1195. 	on_purchase("") 
  1196.  
  1197. 	on_notoriety_event("") 
  1198. 	 
  1199. 	pause_map_tutorial_mode(false) 
  1200. 	 
  1201. 	waypoint_remove( SYNC_ALL, true ) 
  1202.  
  1203. 	store_weapon_tutorial_mode(false) 
  1204.  
  1205. 	spawning_vehicles(true)  
  1206.  
  1207. 	on_anim_trigger( "", mIntro_group.dane_npc.dane ) 
  1208.  
  1209. 	trigger_clear(mIntro_trigger.car_chat.name) 
  1210. 	trigger_clear(mIntro_trigger.hell_chat.name) 
  1211. 	trigger_clear(mIntro_trigger.plan_chat.name) 
  1212. 	if mission_exit then	 
  1213. 		mIntro_cleanup_homies() 
  1214. 	end 
  1215.  
  1216. end 
  1217.  
  1218. ------------------------------------ 
  1219. -- 
  1220. -- Checkpoint helper functions 
  1221. -- 
  1222. ------------------------------------ 
  1223.  
  1224. ------------------------------------ 
  1225. -- 
  1226. -- Checkpoint callback functions 
  1227. -- 
  1228. ------------------------------------ 
  1229.  
  1230. function mIntro_SAM_fade_out() 
  1231.  
  1232. 	--seamless_animated_moment_cleanup()	-- HVS_BDF: we don't want this here because it causes the camera to pan back during the fade-out 
  1233. 	mission_end_success("mIntro", mIntro_scene.outro) --, {, }) 
  1234. 	mIntro_runtime.mission_end_complete = true; 
  1235.  
  1236.  
  1237.  
  1238. end 
  1239.  
  1240. function sam_intro_land_complete() 
  1241. 	mIntro_runtime.intro_land_complete = true 
  1242. end 
  1243.  
  1244. function SAM_dane_intro_complete() 
  1245. 	mIntro_runtime.dane_intro_complete = true 
  1246. end 
  1247.  
  1248. function handle_player_respawn() 
  1249. 	-- HVS_BDF: we only need to do this in co-op, otherwise we get errors in Debug 
  1250. 	if (coop_is_active() == false) then 
  1251. 		mIntro_setup_homies ( mIntro_group.kinzie_npc_start ) 
  1252. 	end 
  1253. end 
  1254.  
  1255. function mm_1_1_gps_set_cb(player_name, gps_set) 
  1256.  
  1257. 	-- If GPS waypoint wasn't set, don't bother 
  1258. 	if (gps_set == false) then 
  1259. 		return 
  1260. 	end 
  1261. 	 
  1262. 	-- Track which player-set GPS waypoint 
  1263. 	if (player_name == LOCAL_PLAYER) then 
  1264. 		MM_1_1_set_gps_waypoint[SYNC_LOCAL].set = true 
  1265. 	else 
  1266. 		MM_1_1_set_gps_waypoint[SYNC_REMOTE].set = true 
  1267. 	end 
  1268.  
  1269. 	if character_is_in_vehicle(LOCAL_PLAYER) == false then 
  1270. 		on_placed_waypoint("") 
  1271. 	else 
  1272. 		--convo_end_all()	 
  1273. 		on_placed_waypoint("") 
  1274. 	end	 
  1275.  
  1276. end 
  1277.  
  1278. function mm_1_1_item_purchased_cb(item_type, player_name) 
  1279.  
  1280. 	-- Track if player is local/remote 
  1281. 	local sync_type 
  1282. 	if (player_name == LOCAL_PLAYER) then 
  1283. 		sync_type = SYNC_LOCAL 
  1284. 	else 
  1285. 		sync_type = SYNC_REMOTE 
  1286. 	end 
  1287. 	 
  1288. 	-- Track which type of item was purchased by which player 
  1289. 	if (item_type == "weapon-upgrade") then 
  1290. 		MM_1_1_go_shopping[sync_type].upgrade = true 
  1291. 	end 
  1292. 	convo_start(mIntro_convo.con_nudge_a) 
  1293. 		 
  1294. end 
  1295.  
  1296. -- TODO: Is this really needed? 
  1297. function mm_1_1_hud_prompt_cb() 
  1298. end 
  1299.  
  1300. function mIntro_combat_tutorial() 
  1301.  
  1302. 	if character_is_in_vehicle(LOCAL_PLAYER) == false then 
  1303. 		on_notoriety_event("") 
  1304. 		convo_start(mIntro_convo.notoriety) 
  1305. 		convo_wait_for_end() 
  1306. 		tutorial_start("combat_basics", 2000, true) 
  1307. 		delay(5.0) 
  1308. 		tutorial_start("combat_weapons_1", 2000, true) 
  1309. 		delay(5.0) 
  1310. 		tutorial_start("combat_fineaim", 2000, true) 
  1311. 		delay(5.0) 
  1312. 	end	 
  1313.  
  1314. end 
  1315.  
  1316. function mIntro_car_talk_cb() 
  1317. 	--convo_start(mIntro_convo.transit_talk) 
  1318. 	--convo_wait_for_end() 
  1319. 	--trigger_clear(mIntro_trigger.car_chat.name) 
  1320. 	--convo_end_all() 
  1321. end 
  1322.  
  1323. function mIntro_hell_talk_cb() 
  1324. 	--convo_start(mIntro_convo.hell_talk) 
  1325. 	--convo_wait_for_end() 
  1326. 	--trigger_clear(mIntro_trigger.hell_chat.name) 
  1327. 	--convo_end_all() 
  1328. end 
  1329.  
  1330. function mIntro_plan_talk_cb() 
  1331. 	--convo_start(mIntro_convo.con_nudge_a) 
  1332. 	--convo_wait_for_end() 
  1333. 	--trigger_clear(mIntro_trigger.plan_chat.name) 
  1334. 	--convo_end_all() 
  1335. end 
  1336.  
  1337.  
  1338. ------------------------------------ 
  1339. -- 
  1340. -- Checkpoint thread functions 
  1341. -- 
  1342. ------------------------------------ 
  1343.  
  1344. -------------------------------------------------------------------------------------------------- 
  1345. --[[ 
  1346.  
  1347.    _____                                        ______                _   _                  
  1348.   / ____|                                      |  ____|              | | (_)                 
  1349.  | |     ___  _ __ ___  _ __ ___   ___  _ __   | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
  1350.  | |    / _ \| '_ ` _ \| '_ ` _ \ / _ \| '_ \  |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
  1351.  | |___| (_) | | | | | | | | | | | (_) | | | | | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
  1352.   \_____\___/|_| |_| |_|_| |_| |_|\___/|_| |_| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
  1353. 																							 
  1354. 																							 
  1355. ]]-- 
  1356. 								 
  1357. function mIntro_setup_homies ( homie_group ) 
  1358. 	if homie_group.kinzie ~= nil and homie_group.kinzie ~= "" then 
  1359. 		mIntro_homie.kinzie = homie_group.kinzie 
  1360. 		party_add(mIntro_homie.kinzie, LOCAL_PLAYER) 
  1361. 		follower_set_can_abandon( mIntro_homie.kinzie, false ) 
  1362. 		--to prevent from losing this mission 
  1363. 		turn_invulnerable(mIntro_homie.kinzie) 
  1364. 		npc_never_die(mIntro_homie.kinzie, true) 
  1365. 		on_death ( "", mIntro_homie.kinzie ) 
  1366. 		on_dismiss ( "mIntro_failure_dismissed_cb", mIntro_homie.kinzie ) 
  1367. 		party_set_dismissable(false) 
  1368. 	end 
  1369. 	 
  1370. end 
  1371.  
  1372. function mIntro_cleanup_homies() 
  1373. 	if mIntro_homie.kinzie ~= nil and mIntro_homie.kinzie ~= "" then 
  1374. 		on_death("", mIntro_homie.kinzie) 
  1375. 		on_dismiss("", mIntro_homie.kinzie) 
  1376. 	end 
  1377. 	 
  1378. end 
  1379.  
  1380. function mIntro_safe_thread_kill( thread ) 
  1381. 	 
  1382. 	if( thread ~= nil )	then 
  1383. 		if( thread ~= INVALID_THREAD_HANDLE) then 
  1384. 			thread_kill( thread ) 
  1385. 			thread = INVALID_THREAD_HANDLE 
  1386. 		end 
  1387. 	end 
  1388.  
  1389. end 
  1390.  
  1391.  
  1392.  
  1393. -------------------------------------------------------------------------------------------------- 
  1394. --[[ 
  1395.  
  1396.    _____      _ _ _                _      ______                _   _                  
  1397.   / ____|    | | | |              | |    |  ____|              | | (_)                 
  1398.  | |     __ _| | | |__   __ _  ___| | __ | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
  1399.  | |    / _` | | | '_ \ / _` |/ __| |/ / |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
  1400.  | |___| (_| | | | |_) | (_| | (__|   <  | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
  1401.   \_____\__,_|_|_|_.__/ \__,_|\___|_|\_\ |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
  1402. 																					   
  1403. 																					   
  1404. ]]-- 
  1405.  
  1406. function mIntro_failure_kinzie_died_cb() 
  1407. 	mission_end_failure("mIntro", "GM_INTRO_FAIL_KINZIE_DIED") 
  1408. end 
  1409.  
  1410.  
  1411. function mIntro_failure_dismissed_cb() 
  1412. 	mission_end_failure("mIntro", "GM_INTRO_FAIL_KINZIE_DIS") 
  1413. end 
  1414.  
  1415. -------------------------------------------------------------------------------------------------- 
  1416. --[[ 
  1417.  
  1418.   _______ _                        _   ______                _   _                  
  1419.  |__   __| |                      | | |  ____|              | | (_)                 
  1420. 	| |  | |__  _ __ ___  __ _  __| | | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
  1421. 	| |  | '_ \| '__/ _ \/ _` |/ _` | |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
  1422. 	| |  | | | | | |  __/ (_| | (_| | | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
  1423. 	|_|  |_| |_|_|  \___|\__,_|\__,_| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
  1424. 																				    
  1425. 																				    
  1426. ]]-- 
  1427.