--[[  
 
            _____       _              
 
           |_   _|     | |             
 
  _ __ ___   | |  _ __ | |_ _ __ ___   
 
 | '_ ` _ \  | | | '_ \| __| '__/ _ \  
 
 | | | | | |_| |_| | | | |_| | | (_) | 
 
 |_| |_| |_|_____|_| |_|\__|_|  \___/  
 
                                       
 
                                       
 
 
 
 
 
]]-- 
 
 
 
--[[ 
 
	mIntro.lua 
 
	SR3 Mission Script 
 
	DATE: 2013-12-09 
 
	AUTHOR:	Kevin Tyska 
 
]]-- 
 
 
 
 
 
-- Debug flags -- 
 
 
 
-- Tweakable Parameters -- 
 
 
 
-------------------------------------------------------------------------------------------------- 
 
--[[   
 
 
 
   _____                            
 
  / ____|                           
 
 | |  __ _ __ ___  _   _ _ __  ___  
 
 | | |_ | '__/ _ \| | | | '_ \/ __| 
 
 | |__| | | | (_) | |_| | |_) \__ \ 
 
  \_____|_|  \___/ \__,_| .__/|___/ 
 
						| |         
 
						|_|    
 
 
 
]]-- 
 
-------------------------------------------------------------------------------------------------- 
 
	mIntro_group = {  
 
 
		kinzie_npc_start = {  
			name = "homies_group", 
 
			npcs = { "npc_Kinzie_start" },  
			kinzie = "npc_Kinzie_start", 
 
		}, 
 
 
 
		start_car = {  
			name = "start_vehicle_group", 
 
		}, 
 
 
 
		dane_npc = {  
			name = "SAM_Dane_group", 
 
			npcs = { "SAM_Dane<001>" },  
			dane = "SAM_Dane<001>", 
 
		}, 
 
 
 
	} 
 
	 
 
	mIntro_saints = {  
		--Will be filled in when the mission starts 
 
	} 
 
 
 
--------------------------------------------------------------------------------------------------																				 
 
--[[ 
 
 
 
  _______ _                        _      
 
 |__   __| |                      | |     
 
	| |  | |__  _ __ ___  __ _  __| |___  
 
	| |  | '_ \| '__/ _ \/ _` |/ _` / __| 
 
	| |  | | | | | |  __/ (_| | (_| \__ \ 
 
	|_|  |_| |_|_|  \___|\__,_|\__,_|___/ 
 
										  
 
	 
 
]]-- 
 
-------------------------------------------------------------------------------------------------- 
 
	mIntro_thread = {  
 
 
	} 
 
 
 
-------------------------------------------------------------------------------------------------- 
 
--[[  
 
 
 
   _____ _               _                _       _        
 
  / ____| |             | |              (_)     | |       
 
 | |    | |__   ___  ___| | ___ __   ___  _ _ __ | |_ ___  
 
 | |    | '_ \ / _ \/ __| |/ / '_ \ / _ \| | '_ \| __/ __| 
 
 | |____| | | |  __/ (__|   <| |_) | (_) | | | | | |_\__ \ 
 
  \_____|_| |_|\___|\___|_|\_\ .__/ \___/|_|_| |_|\__|___/ 
 
							 | |                           
 
							 |_|                           
 
]]-- 
 
-------------------------------------------------------------------------------------------------- 
 
	mIntro_checkpoint = {  
		{  
			name = MISSION_START_CHECKPOINT,		-- First Checkpoint - go to ultor (gtu) 
 
			init = "mIntro_gtu_init",				-- init(bool mission_restart) 
 
			run = "mIntro_gtu_run",					-- run() 
 
			cleanup = "mIntro_gtu_cleanup",			-- cleanup(bool mission_exit) (+++MUST RETURN IMMEDIATELY+++) 
 
			next_checkpoint = nil, 
 
			host_start = "Player_Start_Nav_Host", 
 
			client_start = "Player_Start_Nav_Client", 
 
			p1_car_nav = "", 
 
			p2_car_nav = "", 
 
			start_groups = { mIntro_group.start_car },  
			cp_only_groups = { },  
		}, 
 
	} 
 
	 
 
-------------------------------------------------------------------------------------------------- 
 
--[[  
 
 
 
   _____      _                                 
 
  / ____|    | |                                
 
 | |    _   _| |_ ___  ___ ___ _ __   ___  ___  
 
 | |   | | | | __/ __|/ __/ _ \ '_ \ / _ \/ __| 
 
 | |___| |_| | |_\__ \ (_|  __/ | | |  __/\__ \ 
 
  \_____\__,_|\__|___/\___\___|_| |_|\___||___/ 
 
											    
 
	 
 
]]-- 
 
-------------------------------------------------------------------------------------------------- 
 
	mIntro_scene = {  
		intro = "intro", 
 
		outro = "Bink_MeetDane" 
 
	} 
 
	 
 
-------------------------------------------------------------------------------------------------- 
 
--[[   
 
   _____                                    _   _                  
 
  / ____|                                  | | (_)                 
 
 | |     ___  _ ____   _____ _ __ ___  __ _| |_ _  ___  _ __  ___  
 
 | |    / _ \| '_ \ \ / / _ \ '__/ __|/ _` | __| |/ _ \| '_ \/ __| 
 
 | |___| (_) | | | \ V /  __/ |  \__ \ (_| | |_| | (_) | | | \__ \ 
 
  \_____\___/|_| |_|\_/ \___|_|  |___/\__,_|\__|_|\___/|_| |_|___/ 
 
	 
 
]]-- 
 
-------------------------------------------------------------------------------------------------- 
 
 
 
	mIntro_persona = {   
		Johnny = {  
			persona_name = "Johnny_Gat", 
 
			persona_id = INVALID_PERSONA_HANDLE 
 
		}, 
 
		Kinzie = {  
			persona_name = "Kinzie", 
 
			persona_id = INVALID_PERSONA_HANDLE 
 
		}, 
 
		Dane = {  
			persona_name = "Dane", 
 
			persona_id = INVALID_PERSONA_HANDLE 
 
		}, 
 
	} 
 
	 
 
	mIntro_convo = {  
		--[[ = { 
 
			name = "file_name without voice (_bm, _wm, _bf...", 
 
			player_talks = true or false, 
 
			handle = INVALID_CONVERSATION_HANDLE, 
 
			convo_thread = INVALID_THREAD_HANDLE, 
 
			max_wait_seconds = 60,	-- if the conversation doesn't complete before this time, kill it 
 
			timer_thread = INVALID_THREAD_HANDLE, 
 
			priority = CONVO_PRIORITY_HIGH or CONVO_PRIORITY_NORMAL or CONVO_PRIORITY_OPTIONAL 
 
			(optional) persona_line = true,	-- this is a single line 
 
			(required if persona_line) speaker_name = "name of speaker",	-- single line speaker (might be set before call to play is made?) 
 
			(optional)phone_call = true,  -- this is a phone conversation (phone persona must be preloaded) 
 
			(required if phone_call) receiving_call = true or false  -- auto-answer is always true in missions (until proven otherwise) 
 
			 
 
		},]] 
 
 
 
		get_dane = {  
			name = "mIntro_Get_Dane",  
 
			player_talks = false, 
 
			handle = INVALID_CONVERSATION_HANDLE, 
 
			convo_thread = INVALID_THREAD_HANDLE, 
 
			max_wait_seconds = 60, 
 
			timer_thread = INVALID_THREAD_HANDLE, 
 
			priority = CONVO_PRIORITY_NORMAL, 
 
		}, 
 
 
 
		con_nudge_a = {  
			name = "mIntro_Nudge_A",  
 
			player_talks = false, 
 
			handle = INVALID_CONVERSATION_HANDLE, 
 
			convo_thread = INVALID_THREAD_HANDLE, 
 
			max_wait_seconds = 60, 
 
			timer_thread = INVALID_THREAD_HANDLE, 
 
			priority = CONVO_PRIORITY_NORMAL, 
 
		}, 
 
 
 
		con_nudge_b = {  
			name = "mIntro_Nudge_B",  
 
			player_talks = false, 
 
			handle = INVALID_CONVERSATION_HANDLE, 
 
			convo_thread = INVALID_THREAD_HANDLE, 
 
			max_wait_seconds = 60, 
 
			timer_thread = INVALID_THREAD_HANDLE, 
 
			priority = CONVO_PRIORITY_NORMAL, 
 
		}, 
 
 
 
		notoriety = {  
			name = "mIntro_First_Notoriety",  
 
			player_talks = false, 
 
			handle = INVALID_CONVERSATION_HANDLE, 
 
			convo_thread = INVALID_THREAD_HANDLE, 
 
			max_wait_seconds = 60, 
 
			timer_thread = INVALID_THREAD_HANDLE, 
 
			priority = CONVO_PRIORITY_NORMAL, 
 
		}, 
 
 
 
		con_car = {  
			name = "mIntro_Car",  
 
			player_talks = false, 
 
			handle = INVALID_CONVERSATION_HANDLE, 
 
			convo_thread = INVALID_THREAD_HANDLE, 
 
			max_wait_seconds = 60, 
 
			timer_thread = INVALID_THREAD_HANDLE, 
 
			priority = CONVO_PRIORITY_NORMAL, 
 
		}, 
 
 
 
		transit_talk = {  
			name = "mIntro_New_Intro_Drive",  
 
			player_talks = false, 
 
			handle = INVALID_CONVERSATION_HANDLE, 
 
			convo_thread = INVALID_THREAD_HANDLE, 
 
			max_wait_seconds = 60, 
 
			timer_thread = INVALID_THREAD_HANDLE, 
 
			priority = CONVO_PRIORITY_NORMAL, 
 
		}, 
 
		hell_talk = {  
			name = "mIntro_Hell",  
 
			player_talks = false, 
 
			handle = INVALID_CONVERSATION_HANDLE, 
 
			convo_thread = INVALID_THREAD_HANDLE, 
 
			max_wait_seconds = 60, 
 
			timer_thread = INVALID_THREAD_HANDLE, 
 
			priority = CONVO_PRIORITY_NORMAL, 
 
		}, 
 
	} 
 
	 
 
	mIntro_convo_queue = {  
		--[[start_drive_queue = {   
			{ delay = 2.0, convo = mIntro_convo.goto_first_checkpoint_nav },  
			{ delay = 4.0, convo = mIntro_convo.goto_first_checkpoint_nav2 },  
			{ delay = 3.0, convo = mIntro_convo.goto_first_checkpoint_nav3 },  
			{ delay = 5.0, convo = mIntro_convo.goto_first_checkpoint_nav4 }  
		}, 
 
		]]-- 
 
	} 
 
	 
 
-------------------------------------------------------------------------------------------------- 
 
--[[  
 
 
 
  _______   _                            
 
 |__   __| (_)                           
 
	| |_ __ _  __ _  __ _  ___ _ __ ___  
 
	| | '__| |/ _` |/ _` |/ _ \ '__/ __| 
 
	| | |  | | (_| | (_| |  __/ |  \__ \ 
 
	|_|_|  |_|\__, |\__, |\___|_|  |___/ 
 
			   __/ | __/ |               
 
			  |___/ |___/                
 
 
 
 
 
]]-- 
 
-------------------------------------------------------------------------------------------------- 
 
	mIntro_trigger = {  
		-- = { 
 
		--	name = "_trigger", 
 
		--	hit = false, 
 
		-- 	last_hit_by = nil, -- 	last_hit_human = nil (set to the last human to enter the trigger in the default trigger callback) 
 
		--  (optional)callback = "mIntro_function_name_cb" 
 
		--	(optional)marker = TRIGGER_LOCATION or TRIGGER_USE or custom or don't include for no marker 
 
		--  (optional)waypoint = true, 
 
		--  (optional)teleport_to = {  
		--						host = "host_nav", 
 
		--						client = "client_nav"  
 
		--					},		 
 
		--	(optional)conversation = mIntro_convo.convo_name  -- play a conversation 
 
		--	(optional)next_trigger = "next_trigger_name" sets up next trigger when triggered (breadcrumbs) 
 
		--}, 
 
		 
 
									--[[ first_checkpoint_nav TRIGGERS ]]-- 
 
 
 
		ultor_trigger = {  
			name = "goto_ultor_trig", 
 
			hit = false, 
 
			--marker = TRIGGER_LOCATION, 
 
			waypoint = false, 
 
		}, 
 
 
 
		car_chat = {  
				name = "car_talk", 
 
				hit = false, 
 
				conversation = mIntro_convo.transit_talk, 
 
				--callback = "mIntro_car_talk_cb", 
 
				--marker = TRIGGER_LOCATION, 
 
				--waypoint = true, 
 
			}, 
 
		hell_chat = {  
				name = "hell_talk", 
 
				hit = false, 
 
				conversation = mIntro_convo.hell_talk, 
 
				--callback = "mIntro_hell_talk_cb", 
 
				--marker = TRIGGER_LOCATION, 
 
				--waypoint = true, 
 
			}, 
 
 
 
		plan_chat = {  
				name = "plan_trigger", 
 
				hit = false, 
 
				conversation = mIntro_convo.con_nudge_a, 
 
				--callback = "mIntro_plan_talk_cb", 
 
				--marker = TRIGGER_LOCATION, 
 
				--waypoint = true, 
 
			}, 
 
	} 
 
	 
 
-------------------------------------------------------------------------------------------------- 
 
																	  --[[ INTERROGATION DATA ]]-- 
 
-------------------------------------------------------------------------------------------------- 
 
	--mIntro_interrogate = {  
	--	leader = {  
	--		target = mIntro_group.friendly_fire.owner, 
 
	--		persona = "Interrogation", 
 
	--		objective = "mIntro_INTERROGATE_OWNER", 
 
	--	--	(optional)conversation = mIntro_convo.convo_name  -- play a conversation while interrogating 
 
	--	}, 
 
	--} 
 
 
 
-------------------------------------------------------------------------------------------------- 
 
																				--[[ VFX ]]-- 
 
--------------------------------------------------------------------------------------------------	 
 
mIntro_vfx = {  
 
 
} 
 
 
 
		 
 
-------------------------------------------------------------------------------------------------- 
 
--[[   
 
 
 
   ____  _   _                
 
  / __ \| | | |               
 
 | |  | | |_| |__   ___ _ __  
 
 | |  | | __| '_ \ / _ \ '__| 
 
 | |__| | |_| | | |  __/ |    
 
  \____/ \__|_| |_|\___|_|    
 
						 
 
 
 
]]-- 
 
-------------------------------------------------------------------------------------------------- 
 
 
 
mIntro_homie = {  
	kinzie = "", 
 
} 
 
 
 
 
 
 
 
mIntro_runtime = {  
	intro_land_complete = false, 
 
	dane_intro_complete = false, 
 
	mission_end_complete = false, 
 
} 
 
 
 
 
 
 
 
mIntro_players = {}  
 
 
MM_1_2_tutorials = {  
	veh_ent = {  
		name = "vehicle entry", 
 
		delay = 2000, 
 
	}, 
 
} 
 
 
 
MM_1_1_steal_a_car = {  
	{  
		finished = false, 
 
	}, 
 
	{  
		finished = false, 
 
	}, 
 
} 
 
 
 
MM_1_1_set_gps_waypoint = {  
	{  
		set = false, 
 
		finished = false, 
 
	}, 
 
	{  
		set = true, 
 
		finished = true, 
 
	}, 
 
} 
 
 
 
MM_1_1_go_shopping = {  
	{  
		weapon = false, 
 
		upgrade = false, 
 
		finished = false, 
 
	}, 
 
	{  
		weapon = true, 
 
		upgrade = true, 
 
		finished = true, 
 
	}, 
 
} 
 
 
 
 
 
function add_pistol() 
 
	local weapon_name = "Pistol-Gang" 
 
	local count = 120 
 
	local unlimited = false 
 
	local equip_now = true 
 
	--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 
 
	-- using inv_item_add to make sure the player keeps this pistol 
 
	--inv_weapon_add_temporary(LOCAL_PLAYER, weapon_name, count, unlimited, equip_now) 
 
	inv_item_add(weapon_name, count, LOCAL_PLAYER, equip_now) 
 
 
 
	 if (coop_is_active() == true) then 
 
			--inv_weapon_add_temporary(REMOTE_PLAYER, weapon_name, count, unlimited, equip_now) 
 
			inv_item_add(weapon_name, count, REMOTE_PLAYER, equip_now) 
 
	 end 
 
 
 
end 
 
 
 
function add_uzi() 
 
	local weapon_name = "SMG-Brimstone_Uzi" 
 
	local count = 1 
 
	local unlimited = true 
 
	local equip_now = true 
 
	inv_weapon_add_temporary(LOCAL_PLAYER, weapon_name, count, unlimited, equip_now) 
 
	weapon_apply_upgrade(LOCAL_PLAYER, "SMG-Brimstone_Uzi", 4) 
 
	weapon_apply_upgrade(LOCAL_PLAYER, "SMG-Brimstone_Uzi", 9) 
 
	weapon_apply_upgrade(LOCAL_PLAYER, "SMG-Brimstone_Uzi", 14) 
 
	weapon_apply_upgrade(LOCAL_PLAYER, "SMG-Brimstone_Uzi", 15) 
 
 
 
	 if (coop_is_active() == true) then 
 
			inv_weapon_add_temporary(REMOTE_PLAYER, weapon_name, count, unlimited, equip_now) 
 
			weapon_apply_upgrade(REMOTE_PLAYER, "SMG-Brimstone_Uzi", 4) 
 
	 end 
 
 
 
end 
 
 
 
function add_bolter() 
 
	local weapon_name = "Rifle-LavaBolter" 
 
	local count = 1 
 
	local unlimited = true 
 
	local equip_now = false 
 
	inv_weapon_add_temporary(LOCAL_PLAYER, weapon_name, count, unlimited, equip_now) 
 
 
 
	 if (coop_is_active() == true) then 
 
			inv_weapon_add_temporary(REMOTE_PLAYER, weapon_name, count, unlimited, equip_now) 
 
	 end 
 
 
 
end 
 
 
 
function add_rpg() 
 
	local weapon_name = "Explosive-RocketLauncher" 
 
	local count = 1 
 
	local unlimited = true 
 
	local equip_now = false 
 
	inv_weapon_add_temporary(LOCAL_PLAYER, weapon_name, count, unlimited, equip_now) 
 
 
 
	 if (coop_is_active() == true) then 
 
			inv_weapon_add_temporary(REMOTE_PLAYER, weapon_name, count, unlimited, equip_now) 
 
	 end 
 
 
 
end 
 
 
 
 
 
-------------------------------------------------------------------------------------------------- 
 
--[[ 
 
 
 
   _____ _                  _               _   ______                _   _                  
 
  / ____| |                | |             | | |  ____|              | | (_)                 
 
 | (___ | |_ __ _ _ __   __| | __ _ _ __ __| | | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
 
  \___ \| __/ _` | '_ \ / _` |/ _` | '__/ _` | |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
 
  ____) | || (_| | | | | (_| | (_| | | | (_| | | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
 
 |_____/ \__\__,_|_| |_|\__,_|\__,_|_|  \__,_| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
 
																							 
 
																							 
 
]]-- 
 
 
 
-- This is the primary entry point for the mission, and is responsible for starting up the mission 
 
-- at the specified checkpoint. 
 
-- CALLED FROM CODE 
 
-- 
 
-- start_checkpoint_name:	(string) The checkpoint the mission should begin at 
 
-- is_restart:					(bool) TRUE if the mission is restarting, FALSE otherwise 
 
-- 
 
function mIntro_start(start_checkpoint_name, is_restart) 
 
	 
 
	-- HVS_BDF 4/14/14: The conventional way of handling fades when starting a mission is to use 
 
	-- the mission_start_fade_out() and mission_start_fade_in() functions.  These functions do a 
 
	-- few different things (one does the inverse of the other) including the disabling of player 
 
	-- controls. 
 
	-- In cases where we don't start the mission with a SAM, this is a good thing. 
 
	-- However, if we want to fade in directly into a SAM that's already in progress,  
 
	-- DO NOT call mission_start_fade_in() because this could re-enable the player controls 
 
	-- that were disabled when the SAM started.  Instead, use the standard fade_in() function 
 
	-- and let the SAM take care of re-enabling the player controls when it is finished. 
 
	mission_start_fade_out() 
 
	 
 
 
 
	hvUnlockLoadout("mIntro")  
	 
 
	-- HVS_BDF: we don't necessarily want to call load_persona() because this creates a 2D 
 
	-- version, which can prevent actual in-game characters from lip syncing their VO if 
 
	-- the 2D persona was loaded prior to their character being spawned. 
 
	-- In the case of PC characters, they are present in the world  
 
	-- and their characters should lip sync their VO.  Same with Dane. 
 
	--load_persona(mIntro_persona.Johnny) 
 
	--load_persona(mIntro_persona.Kinzie) 
 
	--load_persona(mIntro_persona.Dane) 
 
	 
 
	-- 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? 
 
	--player_inventory_restore_on_mission_exit(LOCAL_PLAYER) 
 
	--player_inventory_restore_on_mission_exit(REMOTE_PLAYER) 
 
	 
 
	--add_pistol() 
 
 
 
	 
 
	 
 
	while (player_customization_is_finalized( LOCAL_PLAYER ) == false) do 
 
		delay(0.25) 
 
	end 
 
	 
 
	--notoriety_force_no_spawn(true) 
 
 
 
	-- initialize systems 
 
	mission_startup(mIntro_trigger, mIntro_convo) -- mIntro_checkpoint 
 
	-- if using interrogations 
 
	--interrogate_startup(mIntro_interrogate) 
 
	 
 
	local start_cp = get_table_by_name(mIntro_checkpoint, MISSION_START_CHECKPOINT) 
 
 
 
	-- Check if this mission starting from the beginning 
 
	if (start_checkpoint_name == start_cp.name) then 
 
		if (is_restart == false and mIntro_scene.intro ~= "") then 
 
			-- First time playing mission 
 
			local fade_in_after = false 
 
			cutscene_play(mIntro_scene.intro, nil, {start_cp.host_start, start_cp.client_start}, fade_in_after)  
		else 
 
			teleport_coop(start_cp.host_start, start_cp.client_start, true) 
 
		end 
 
		fade_out(0) 
 
	end 
 
	 
 
	inv_item_remove_all(LOCAL_PLAYER) 
 
	inv_item_remove_all(REMOTE_PLAYER) 
 
 
 
	--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 
 
	--or else we get some hellish gat body, kinzie face, and no one wants that. 
 
	if not coop_is_active() and not player_is_default_character() then 
 
		player_swap_character() 
 
	end 
 
 
 
	-- HVS_JPM - we cleared their inventory and didn't add the pistol back... 
 
	add_pistol() 
 
 
 
	local add_to_wardrobe = false 
 
	local clear_facewear = false 
 
	customization_item_wear( "cm_PCGatJSuit", "PC_Gat_Jsuit.cmeshx", "default", add_to_wardrobe, SYNC_LOCAL, clear_facewear ) 
 
	if(coop_is_active()) then 
 
		customization_item_wear( "cf_PCKinzieJSuit", "cf_pckinziejsuit.cmeshx", "default", add_to_wardrobe, SYNC_REMOTE, not clear_facewear ) 
 
	end 
 
	-- Handle mission initialization for the current checkpoint 
 
	mIntro_initialize(start_checkpoint_name) 
 
 
 
	-- Run the mission from the current checkpoint 
 
	checkpoint_run_mission(mIntro_checkpoint, start_checkpoint_name) 
 
 
 
	if(mIntro_runtime.mission_end_complete == false) then 
 
		mission_end_success("mIntro", mIntro_scene.outro)  
	end	 
 
		 
 
	--mission_end_success("mIntro", mIntro_scene.outro) --, {, })  
 
 
end 
 
 
 
-- This is the primary function responsible for cleaning up the entire mission 
 
-- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
 
-- 
 
function mIntro_cleanup() 
 
	--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]-- 
 
	-- cleanup all threads 
 
	cleanup_threads(mIntro_thread) 
 
	 
 
	-- run checkpoint cleanups (move into mission_shutdown?) 
 
	checkpoint_cleanup_mission(mIntro_checkpoint) 
 
	 
 
	-- cleanup triggers, convos, kill_list and interrogations 
 
	mission_shutdown() 
 
	 
 
	-- cleanup all groups 
 
	cleanup_groups(mIntro_group) 
 
 
 
	-- allow superpowers 
 
	player_super_attacks_enable(true) 
 
	player_super_movement_enable(true) 
 
 
 
	tutorial_stop(MM_1_2_tutorials.veh_ent.name) 
 
 
 
	-- remove unlimited ammo temp weapons 
 
	--inv_weapon_remove_temporary(LOCAL_PLAYER,"Pistol-Gang") 
 
	--inv_weapon_remove_temporary(LOCAL_PLAYER,"SMG-Brimstone_Uzi") 
 
	--inv_weapon_remove_temporary(LOCAL_PLAYER,"Rifle-LavaBolter") 
 
 
 
	-- if (coop_is_active() == true) then 
 
		--inv_weapon_remove_temporary(REMOTE_PLAYER,"Pistol-Gang") 
 
		--inv_weapon_remove_temporary(REMOTE_PLAYER,"SMG-Brimstone_Uzi") 
 
		--inv_weapon_remove_temporary(REMOTE_PLAYER,"Rifle-LavaBolter") 
 
	-- end 
 
 
 
	--turn on soul clusters 
 
	collectible_hide_orbs(false) 
 
 
 
	on_placed_waypoint("")  
	 
 
	on_purchase("")  
 
 
	on_notoriety_event("")  
 
 
	pause_map_tutorial_mode(false) 
 
	 
 
	store_weapon_tutorial_mode(false) 
 
	spawning_vehicles(true)  
 
 
 
    on_seamless_animated_moment_end("")  
    seamless_animated_moment_cleanup() 
 
 
 
end 
 
 
 
-- Called when the mission has ended with success 
 
-- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
 
-- 
 
function mIntro_success() 
 
	--[[ INSERT ANY MISSION SPECIFIC SUCCESS STUFF ]]-- 
 
	 
 
end 
 
 
 
-------------------------------------------------------------------------------------------------- 
 
--[[ 
 
 
 
 
 
  _____       _ _   _       _ _           ______                _   _                  
 
 |_   _|     (_) | (_)     | (_)         |  ____|              | | (_)                 
 
   | |  _ __  _| |_ _  __ _| |_ _______  | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
 
   | | | '_ \| | __| |/ _` | | |_  / _ \ |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
 
  _| |_| | | | | |_| | (_| | | |/ /  __/ | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
 
 |_____|_| |_|_|\__|_|\__,_|_|_/___\___| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
 
																					   
 
																					   
 
]]-- 
 
-- Initialize the mission for the specified checkpoint 
 
-- 
 
-- checkpoint_name:		(string) Checkpoint to initialize the mission to 
 
-- 
 
function mIntro_initialize(checkpoint_name) 
 
	-- Common initialization 
 
	mIntro_initialize_common() 
 
	 
 
	-- Checkpoint specific initialization 
 
	checkpoint_init(mIntro_checkpoint, checkpoint_name) 
 
 
 
	-- Get the player names 
 
	mIntro_players = player_names_get_all() 
 
 
 
	-- Remove any present subtitles 
 
	message_remove_all() 
 
 
 
	-- Start fading in  
 
	mission_start_fade_in() 
 
end 
 
 
 
-- Handle any common initialization 
 
-- 
 
function mIntro_initialize_common() 
 
	--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]-- 
 
 
 
	--Turn off any and all super powers 
 
	player_super_attacks_enable(false) 
 
	player_super_movement_enable(false) 
 
 
 
	collectible_hide_orbs(true) 
 
	 
 
	add_pistol() 
 
 
 
end 
 
 
 
-- function mIntro_setup_homies( ) 
 
	-- if mIntro_groups.homies.kinzie ~= nil and coop_is_active()==false and mIntro_groups.homies.kinzie ~= "" then 
 
		 
 
		-- if (add_to_party == true) then 
 
			-- party_add(mIntro_groups.homies.kinzie, LOCAL_PLAYER) 
 
		-- end 
 
		 
 
		-- on_death("mIntro_failure_kinzie_died_cb", mImpfest_homie.kinzie)  
		-- on_dismiss("mIntro_failure_dismissed_cb", mImpfest_homie.kinzie)  
	-- end 
 
 
 
	-- -- the co-op check here to get rid of her 
 
	-- if (coop_is_active() == true) then 
 
		-- mIntro_cleanup_homies() 
 
		-- group_destroy(mIntro_groups.homies.kinzie) 
 
	-- end 
 
-- end 
 
 
 
-- -- remove callbacks for homies 
 
-- -- 
 
-- function mIntro_cleanup_homies() 
 
	-- if mIntro_groups.homies.kinzie ~= nil and coop_is_active()==false then 
 
		-- on_death("", mIntro_groups.homies.kinzie)  
		-- on_dismiss("", mIntro_groups.homies.kinzie)  
	-- end 
 
-- end 
 
 
 
-------------------------------------------------------------------------------------------------- 
 
--[[ 
 
 
 
 
 
   _____ _               _                _       _     ______                _   _                  
 
  / ____| |             | |              (_)     | |   |  ____|              | | (_)                 
 
 | |    | |__   ___  ___| | ___ __   ___  _ _ __ | |_  | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
 
 | |    | '_ \ / _ \/ __| |/ / '_ \ / _ \| | '_ \| __| |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
 
 | |____| | | |  __/ (__|   <| |_) | (_) | | | | | |_  | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
 
  \_____|_| |_|\___|\___|_|\_\ .__/ \___/|_|_| |_|\__| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
 
							 | |                                                                     
 
							 |_|                                                                     
 
 
 
]]-- 
 
-------------------------------------------------------------------------------------------------- 
 
--[[  
 
 
 
   _____         _          _    _ _ _              
 
  / ____|       | |        | |  | | | |             
 
 | |  __  ___   | |_ ___   | |  | | | |_ ___  _ __  
 
 | | |_ |/ _ \  | __/ _ \  | |  | | | __/ _ \| '__| 
 
 | |__| | (_) | | || (_) | | |__| | | || (_) | |    
 
  \_____|\___/   \__\___/   \____/|_|\__\___/|_|    
 
                                                    
 
 
 
]]-- 
 
-------------------------------------------------------------------------------------------------- 
 
 
 
-- Initialize this checkpoint. 
 
-- 
 
-- mission_start: (bool) Whether we're initializing from a mission (re)start or from 
 
--					a natural play-through. 
 
-- 
 
function mIntro_gtu_init(mission_start) 
 
 
 
	--set up single player only homie Kinzie 
 
	if (coop_is_active() == false) then 
 
		local block = true 
 
		group_create( mIntro_group.kinzie_npc_start.name, block ) 
 
		mIntro_setup_homies ( mIntro_group.kinzie_npc_start ) 
 
	end 
 
 
 
	local sam_land_kinzie = mIntro_homie.kinzie 
 
 
 
	if (coop_is_active() == true) then 
 
		sam_land_kinzie = REMOTE_PLAYER 
 
	end 
 
 
 
	-- Start the SAM for land introduction 
 
	local actor_list = { sam_land_kinzie, LOCAL_PLAYER }  
	seamless_animated_moment_prep("sam_intro_land", actor_list)  
	on_seamless_animated_moment_end("sam_intro_land_complete")  
 
 
	-- HVS_BDF 4/14/14: The conventional way of handling fades when starting a mission is to use 
 
	-- the mission_start_fade_out() and mission_start_fade_in() functions.  These functions do a 
 
	-- few different things (one does the inverse of the other) including the disabling of player 
 
	-- controls. 
 
	-- In cases where we don't start the mission with a SAM, this is a good thing. 
 
	-- However, if we want to fade in directly to a SAM that's already in progress,  
 
	-- DO NOT call mission_start_fade_in() because this could re-enable the player controls 
 
	-- that were disabled when the SAM started.  Instead, use the standard fade_in() function 
 
	-- and let the SAM take care of re-enabling the player controls when it is finished. 
 
	seamless_animated_moment_start("sam_intro_land", actor_list)  
	fade_in(0.2) 
 
 
 
	--Wait until the SAM has completed 
 
    while(mIntro_runtime.intro_land_complete == false) do 
 
         thread_yield() 
 
	end 
 
	 
 
	on_seamless_animated_moment_end("")  
 
 
 
 
end 
 
 
 
-- The first objective 
 
-- 
 
function mIntro_gtu_run() 
 
	  
 
	--HVS_RCK - Just in case there's still a kinzie lurking around and we're now in coop, ditch her. 
 
	if (coop_is_active() == true) then 
 
		mIntro_cleanup_homies() 
 
		group_destroy(mIntro_group.kinzie_npc_start) 
 
	end 
 
 
 
	on_respawn("handle_player_respawn", LOCAL_PLAYER)  
 
 
	notoriety_set_max("police", 2)  
		  
 
	--tutorial_start("sprint_normal", 1000, true)  
 
 
 
 
	group_create( mIntro_group.dane_npc.name, true ) 
 
	npc_leash_to_nav(mIntro_group.dane_npc.npcs[1],"dane_mark<001>",0.0) 
 
	turn_invulnerable(mIntro_group.dane_npc.npcs[1]) 
 
	character_allow_ragdoll(mIntro_group.dane_npc.npcs[1], false) 
 
	character_prevent_flinching(mIntro_group.dane_npc.npcs[1], true) 
 
 
 
	trigger_setup(mIntro_trigger.car_chat) 
 
	trigger_setup(mIntro_trigger.hell_chat) 
 
	trigger_setup(mIntro_trigger.plan_chat) 
 
	objective_text(0, "MM_1_1_OBJ_STEAL_A_CAR", nil, nil, SYNC_ALL, OI_ASSET_USE)	 
 
	--set_ignore_ai_flag(mIntro_group.dane_npc.npcs[1], true) 
 
	--set_animation_group(mIntro_group.dane_npc.npcs[1], "stand" ) 
 
	--set_animation_state(mIntro_group.dane_npc.npcs[1], "stand") 
 
	--character_set_animation_overrides(mIntro_group.dane_npc.npcs[1],"stand") 
 
	set_animation_set(mIntro_group.dane_npc.npcs[1], "Dane")	 
 
	set_script_animation_state(mIntro_group.dane_npc.npcs[1],"stand")	 
 
 
 
	tutorial_start("sprint_normal", 150, true)  
 
 
	convo_start(mIntro_convo.get_dane) 
 
	convo_wait_for_end() 
 
	 
 
	if character_is_in_vehicle(LOCAL_PLAYER) == false then 
 
		convo_start(mIntro_convo.con_car) 
 
		convo_wait_for_end() 
 
	end	 
 
 
 
	objective_text_clear(0) 
 
	 
 
	-- Have player(s) steal a car, if needed (local/remote separate) 
 
	local vehicle_entry_tutorial = true 
 
	if not character_is_in_vehicle(LOCAL_PLAYER) then 
 
		objective_text(0, "MM_1_1_OBJ_STEAL_A_CAR", nil, nil, SYNC_LOCAL, OI_ASSET_USE) 
 
		--vehicle_entry_tutorial = true 
 
	end 
 
	if coop_is_active() then 
 
		if not character_is_in_vehicle(REMOTE_PLAYER) then 
 
			MM_1_1_steal_a_car[SYNC_REMOTE].finished = false 
 
			objective_text(1, "MM_1_1_OBJ_STEAL_A_CAR", nil, nil, SYNC_REMOTE, OI_ASSET_USE) 
 
			--vehicle_entry_tutorial = true 
 
		end 
 
	end 
 
	 
 
	-- Start Vehicle Entry tutorial (infinite), if needed 
 
	if (vehicle_entry_tutorial == true) then 
 
		tutorial_start(MM_1_2_tutorials.veh_ent.name, MM_1_2_tutorials.veh_ent.delay, true, true, true) 
 
	end 
 
 
 
		 
 
	-- Wait for player(s) to steal a car (local/remote separate) 
 
	while ((MM_1_1_steal_a_car[SYNC_LOCAL].finished == false) 
 
	and (MM_1_1_steal_a_car[SYNC_REMOTE].finished == false)) do 
 
	 
 
		-- Check if local player is in a vehicle 
 
		if character_is_in_vehicle(LOCAL_PLAYER) then 
 
		 
 
			-- If local player just finished, have them wait for remote player, if needed 
 
			-- Hacked so coop won't mess up progression..KT_HVS 
 
			if (MM_1_1_steal_a_car[SYNC_LOCAL].finished == false) then 
 
				--if (MM_1_1_steal_a_car[SYNC_REMOTE].finished == false) then 
 
					--objective_text(0, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_LOCAL, OI_ASSET_LOCATION) 
 
				--end 
 
				MM_1_1_steal_a_car[SYNC_LOCAL].finished = true 
 
				MM_1_1_steal_a_car[SYNC_REMOTE].finished = true 
 
				vehicle_entry_tutorial = false 
 
			end 
 
			 
 
		end 
 
		 
 
		-- Check if remote player is in a vehicle 
 
		if character_is_in_vehicle(REMOTE_PLAYER) then 
 
		 
 
			-- If remote player just finished, have them wait for local player, if needed 
 
			if (MM_1_1_steal_a_car[SYNC_REMOTE].finished == false) then 
 
				--if (MM_1_1_steal_a_car[SYNC_LOCAL].finished == false) then 
 
					--objective_text(1, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_REMOTE, OI_ASSET_LOCATION) 
 
				--end 
 
				MM_1_1_steal_a_car[SYNC_LOCAL].finished = true 
 
				MM_1_1_steal_a_car[SYNC_REMOTE].finished = true 
 
				vehicle_entry_tutorial = false 
 
			end 
 
			 
 
		end 
 
				 
 
		-- Let other threads run 
 
		thread_yield() 
 
		 
 
	end 
 
	 
 
	-- Clear objective text (local/remote separate) 
 
	objective_text_clear(0) 
 
	if coop_is_active() then 
 
		objective_text_clear(1) 
 
	end 
 
 
 
	-- Stop Vehicle Entry tutorial 
 
	tutorial_stop(MM_1_2_tutorials.veh_ent.name) 
 
 
 
	player_vehicle = get_char_vehicle_name(LOCAL_PLAYER) 
 
	radio_set_station(player_vehicle, 1) 
 
 
 
 
 
	objective_text(0,"","GM_INTRO_ULTOR_01","",SYNC_ALL,OI_ASSET_LOCATION) 
 
	trigger_setup(mIntro_trigger.ultor_trigger)	 
 
	--delay(8.0) 
 
	--tutorial_start("jump_climb", 600, true)  
 
 
	--delay(8.0) 
 
	--tutorial_start("crouch", 600, true)  
	--tutorial_vehicle_controls_enabled(true) 
 
 
 
	-- Wait for Kinzie to call out HUB 
 
 
 
 
 
	 
 
	tutorial_stop_current() 
 
	if character_is_in_vehicle(LOCAL_PLAYER) == false then 
 
	tutorial_start("combat_weapons", 0, true)  
	end	 
 
	 
 
 
 
	 
 
	convo_start(mIntro_convo.con_nudge_b)	 
 
	convo_wait_for_end()	 
 
	 
 
 
 
	delay(2) 
 
 
 
	-- Unlock cellphone, if needed 
 
	--if (mm_1_1_phone_lock == true) then 
 
		--cellphone_lock(false) 
 
		--mm_1_1_phone_lock = false 
 
	--end 
 
	 
 
	-- Setup callback to track if GPS waypoint was set 
 
	on_placed_waypoint("mm_1_1_gps_set_cb")  
	 
 
	on_purchase("mm_1_1_item_purchased_cb")  
 
 
	on_notoriety_event("mIntro_combat_tutorial")  
	 
 
	-- Setup HUB map tutorial mode 
 
	pause_map_tutorial_mode(true) 
 
	 
 
	store_weapon_tutorial_mode(true) 
 
	 
 
	-- Have player(s) set GPS waypoint to Friendly Fire (local/remote separate) 
 
	--objective_text(0, "MM_1_1_OBJ_ACCESS_HUB", nil, nil, SYNC_LOCAL, OI_ASSET_USE) 
 
	hud_prompt(LOCAL_PLAYER, "MM_1_1_ACT_ACCESS_HUB", "mm_1_1_hud_prompt_cb") 
 
	if coop_is_active() then 
 
		MM_1_1_set_gps_waypoint[SYNC_REMOTE].set = false 
 
		MM_1_1_set_gps_waypoint[SYNC_REMOTE].finished = false 
 
		--objective_text(1, "MM_1_1_OBJ_ACCESS_HUB", nil, nil, SYNC_REMOTE, OI_ASSET_USE) 
 
		hud_prompt(REMOTE_PLAYER, "MM_1_1_ACT_ACCESS_HUB", "mm_1_1_hud_prompt_cb") 
 
	end 
 
	 
 
	-- Wait for player(s) to set GPS waypoint to Friendly Fire (local/remote separate) 
 
	while ((MM_1_1_set_gps_waypoint[SYNC_LOCAL].finished == false)  
 
	or (MM_1_1_set_gps_waypoint[SYNC_REMOTE].finished == false)) do 
 
	 
 
		-- Check if local player set GPS waypoint 
 
		if (MM_1_1_set_gps_waypoint[SYNC_LOCAL].set == true) then 
 
		 
 
			-- If local player just finished, have them wait for remote player, if needed 
 
			if (MM_1_1_set_gps_waypoint[SYNC_LOCAL].finished == false) then 
 
				if (MM_1_1_set_gps_waypoint[SYNC_REMOTE].finished == false) then 
 
					--objective_text(0, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_LOCAL, OI_ASSET_LOCATION) 
 
					hud_prompt_clear(LOCAL_PLAYER) 
 
				end 
 
				MM_1_1_set_gps_waypoint[SYNC_LOCAL].finished = true 
 
			end 
 
			 
 
		end 
 
		 
 
		-- Check if remote player set GPS waypoint 
 
		if (MM_1_1_set_gps_waypoint[SYNC_REMOTE].set == true) then 
 
		 
 
			-- If remote player just finished, have them wait for local player, if needed 
 
			if (MM_1_1_set_gps_waypoint[SYNC_REMOTE].finished == false) then 
 
				if (MM_1_1_set_gps_waypoint[SYNC_LOCAL].finished == false) then 
 
					--objective_text(1, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_REMOTE, OI_ASSET_LOCATION) 
 
					hud_prompt_clear(REMOTE_PLAYER) 
 
				end 
 
				MM_1_1_set_gps_waypoint[SYNC_REMOTE].finished = true 
 
			end 
 
			 
 
		end 
 
		 
 
		if (MM_1_1_go_shopping[SYNC_LOCAL].upgrade == true) and (MM_1_1_go_shopping[SYNC_REMOTE].upgrade == true) then 
 
			store_weapon_tutorial_mode(false) 
 
		end 
 
		 
 
		if mIntro_trigger.ultor_trigger.hit then 
 
			break 
 
		end 
 
		-- Let other threads run 
 
		thread_yield() 
 
		 
 
	end 
 
	 
 
	if not mIntro_trigger.ultor_trigger.hit then 
 
		while (MM_1_1_go_shopping[SYNC_LOCAL].upgrade == false) or (MM_1_1_go_shopping[SYNC_REMOTE].upgrade == false) do 
 
			if (MM_1_1_go_shopping[SYNC_LOCAL].upgrade == true) and (MM_1_1_go_shopping[SYNC_REMOTE].upgrade == true) then 
 
				store_weapon_tutorial_mode(false) 
 
			end 
 
			 
 
			if mIntro_trigger.ultor_trigger.hit then 
 
				break 
 
			end 
 
			thread_yield() 
 
		end 
 
	end 
 
	 
 
	on_purchase("")  
	 
 
	-- Clear waypoint callback 
 
	on_placed_waypoint("")  
	 
 
	-- Clear HUB map tutorial mode 
 
	pause_map_tutorial_mode(false) 
 
	 
 
	store_weapon_tutorial_mode(false) 
 
	 
 
	-- Clear objective text (local/remote separate) 
 
	objective_text_clear(0) 
 
	hud_prompt_clear(LOCAL_PLAYER) 
 
	if coop_is_active() then 
 
		objective_text_clear(1) 
 
		hud_prompt_clear(REMOTE_PLAYER) 
 
	end 
 
	 
 
	--this needs to be coop_safe, or else odd stuff happens 
 
	--if (coop_is_active() == true) then 
 
		--local inside = false 
 
		--local radius = trigger_get_radius(mIntro_trigger.ultor_trigger.name) 
 
		--local k_in = false 
 
		--local g_in = false 
 
		--while not inside do 
 
			 
 
			--local gat_inside = false 
 
			--local kinzie_inside = false 
 
			--if(get_dist(LOCAL_PLAYER, mIntro_trigger.ultor_trigger.name) < radius) then 
 
 
 
				--gat_inside = true 
 
				--if(gat_inside ~= g_in) then 
 
					--objective_text( 0, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_LOCAL, OI_ASSET_LOCATION ) 
 
				--end 
 
				--g_in = true 
 
			--end 
 
 
 
		 
 
			--if(get_dist(REMOTE_PLAYER, mIntro_trigger.ultor_trigger.name) < radius) then 
 
				--kinzie_inside = true 
 
				--only show this once 
 
				--if(kinzie_inside ~= k_in) then 
 
					--objective_text( 0, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_REMOTE, OI_ASSET_LOCATION ) 
 
				--end 
 
				--k_in = true 
 
				 
 
			--end 
 
 
 
			--if gat_inside and kinzie_inside then 
 
				--inside = true 
 
			--end 
 
			--thread_yield() 
 
		--end 
 
	--else 
 
		--while not mIntro_trigger.ultor_trigger.hit do 
 
			--thread_yield() 
 
		--end 
 
	--end	 
 
 
 
	while not mIntro_trigger.ultor_trigger.hit do 
 
		thread_yield() 
 
	end 
 
 
 
	objective_text_clear(0) 
 
 
 
	notoriety_reset("police")  
	notoriety_set("police", 0)  
		 
 
	if (character_has_human_shield(LOCAL_PLAYER) == true) then 
 
		player_release_human_shield(LOCAL_PLAYER, false, true) 
 
	end 
 
 
 
	if (coop_is_active() == true) then 
 
		if (character_has_human_shield(REMOTE_PLAYER) == true) then 
 
			player_release_human_shield(REMOTE_PLAYER, false, true) 
 
		end 
 
	end 
 
 
 
	character_evacuate_from_all_vehicles(LOCAL_PLAYER, false, true) 
 
 
 
	 if (coop_is_active() == false) then 
 
		character_evacuate_from_all_vehicles(mIntro_homie.kinzie, false, true) 
 
	 else 
 
		character_evacuate_from_all_vehicles(REMOTE_PLAYER, false, true) 
 
	 end 
 
 
 
	group_hide(mIntro_group.start_car) 
 
 
 
	--world_despawn_all_vehicles() 
 
	spawning_vehicles(false)  
 
	teleport_player_vehicles("carpoint_01", "carpoint_02")  
 
 
	delay(0.2) 
 
 
 
-- Teleport co-op player into place as well 
 
	if (coop_is_active() == true) then 
 
		local teleport_player = REMOTE_PLAYER 
 
		local teleport_sync = SYNC_REMOTE 
 
		 
 
		if (mIntro_trigger.ultor_trigger.last_hit_by == REMOTE_PLAYER) then 
 
				teleport_player = LOCAL_PLAYER 
 
				teleport_sync = SYNC_LOCAL 
 
		end 
 
		 
 
		fade_out(1.0, 0, teleport_sync) 
 
		 
 
		teleport(teleport_player, "player_2_telenav") 
 
		while teleport_check_done(teleport_player) == false do 
 
			thread_yield() 
 
		end	 
 
		 
 
		fade_in(1.0, 0, teleport_sync) 
 
	end  
 
 
 
	trigger_clear(mIntro_trigger.car_chat.name) 
 
	trigger_clear(mIntro_trigger.hell_chat.name) 
 
	trigger_clear(mIntro_trigger.plan_chat.name) 
 
	local sam_dane_kinzie = mIntro_homie.kinzie 
 
 
 
 
 
	--character_set_animation_overrides(mIntro_group.dane_npc.npcs[1],"") 
 
	--clear_animation_state(mIntro_group.dane_npc.npcs[1]) 
 
	 	 	  
 
	 audio_object_post_event( "Play_IntroSequence_Music_Stop" ) 
 
	 audio_object_post_event( "Play_DaneIntro" ) 
 
	 audio_object_post_event( "Play_MKing_Dane_Intro" ) 
 
 
 
	 if (coop_is_active() == true) then 
 
			sam_dane_kinzie = REMOTE_PLAYER 
 
	 end 
 
 
 
 
 
	--Dane SAM 
 
	local actor_list = { mIntro_group.dane_npc.dane, LOCAL_PLAYER, sam_dane_kinzie }  
	seamless_animated_moment_prep("sam_dane_intro", actor_list)  
 
 
 
 
 
 
	on_seamless_animated_moment_end("SAM_dane_intro_complete")  
	seamless_animated_moment_start("sam_dane_intro", actor_list)  
 
 
	-- register a callback function to be called at the end 
 
	on_anim_trigger( "mIntro_SAM_fade_out", mIntro_group.dane_npc.dane ) 
 
 
 
	--Wait until the SAM has completed 
 
    while(mIntro_runtime.dane_intro_complete == false) do 
 
         thread_yield() 
 
	end 
 
	 
 
	on_seamless_animated_moment_end("")  
	 
 
end 
 
 
 
-- Do any cleanup for this checkpoint. 
 
-- 
 
-- (+++THIS IS CALLED FROM MISSION CLEANUP, MUST RETURN IMMEDIATELY+++) 
 
-- 
 
-- mission_exit: (bool) Whether we're exiting the mission entirely, or just 
 
--					moving on to the next checkpoint. 
 
-- 
 
function mIntro_gtu_cleanup(mission_exit) 
 
 
 
	seamless_animated_moment_cleanup() 
 
	 
 
	on_respawn("", LOCAL_PLAYER)  
	on_respawn("", REMOTE_PLAYER)  
 
 
	on_seamless_animated_moment_end("")  
 
 
	on_placed_waypoint("")  
 
 
	on_purchase("")  
 
 
	on_notoriety_event("")  
	 
 
	pause_map_tutorial_mode(false) 
 
	 
 
	waypoint_remove( SYNC_ALL, true ) 
 
 
 
	store_weapon_tutorial_mode(false) 
 
 
 
	spawning_vehicles(true)  
 
 
 
	on_anim_trigger( "", mIntro_group.dane_npc.dane ) 
 
 
 
	trigger_clear(mIntro_trigger.car_chat.name) 
 
	trigger_clear(mIntro_trigger.hell_chat.name) 
 
	trigger_clear(mIntro_trigger.plan_chat.name) 
 
	if mission_exit then	 
 
		mIntro_cleanup_homies() 
 
	end 
 
 
 
end 
 
 
 
------------------------------------ 
 
-- 
 
-- Checkpoint helper functions 
 
-- 
 
------------------------------------ 
 
 
 
------------------------------------ 
 
-- 
 
-- Checkpoint callback functions 
 
-- 
 
------------------------------------ 
 
 
 
function mIntro_SAM_fade_out() 
 
 
 
	--seamless_animated_moment_cleanup()	-- HVS_BDF: we don't want this here because it causes the camera to pan back during the fade-out 
 
	mission_end_success("mIntro", mIntro_scene.outro) --, {, })  
	mIntro_runtime.mission_end_complete = true; 
 
 
 
 
 
 
 
end 
 
 
 
function sam_intro_land_complete() 
 
	mIntro_runtime.intro_land_complete = true 
 
end 
 
 
 
function SAM_dane_intro_complete() 
 
	mIntro_runtime.dane_intro_complete = true 
 
end 
 
 
 
function handle_player_respawn() 
 
	-- HVS_BDF: we only need to do this in co-op, otherwise we get errors in Debug 
 
	if (coop_is_active() == false) then 
 
		mIntro_setup_homies ( mIntro_group.kinzie_npc_start ) 
 
	end 
 
end 
 
 
 
function mm_1_1_gps_set_cb(player_name, gps_set) 
 
 
 
	-- If GPS waypoint wasn't set, don't bother 
 
	if (gps_set == false) then 
 
		return 
 
	end 
 
	 
 
	-- Track which player-set GPS waypoint 
 
	if (player_name == LOCAL_PLAYER) then 
 
		MM_1_1_set_gps_waypoint[SYNC_LOCAL].set = true 
 
	else 
 
		MM_1_1_set_gps_waypoint[SYNC_REMOTE].set = true 
 
	end 
 
 
 
	if character_is_in_vehicle(LOCAL_PLAYER) == false then 
 
		on_placed_waypoint("")  
	else 
 
		--convo_end_all()	 
 
		on_placed_waypoint("")  
	end	 
 
 
 
end 
 
 
 
function mm_1_1_item_purchased_cb(item_type, player_name) 
 
 
 
	-- Track if player is local/remote 
 
	local sync_type 
 
	if (player_name == LOCAL_PLAYER) then 
 
		sync_type = SYNC_LOCAL 
 
	else 
 
		sync_type = SYNC_REMOTE 
 
	end 
 
	 
 
	-- Track which type of item was purchased by which player 
 
	if (item_type == "weapon-upgrade") then 
 
		MM_1_1_go_shopping[sync_type].upgrade = true 
 
	end 
 
	convo_start(mIntro_convo.con_nudge_a) 
 
		 
 
end 
 
 
 
-- TODO: Is this really needed? 
 
function mm_1_1_hud_prompt_cb() 
 
end 
 
 
 
function mIntro_combat_tutorial() 
 
 
 
	if character_is_in_vehicle(LOCAL_PLAYER) == false then 
 
		on_notoriety_event("")  
		convo_start(mIntro_convo.notoriety) 
 
		convo_wait_for_end() 
 
		tutorial_start("combat_basics", 2000, true)  
		delay(5.0) 
 
		tutorial_start("combat_weapons_1", 2000, true)  
		delay(5.0) 
 
		tutorial_start("combat_fineaim", 2000, true)  
		delay(5.0) 
 
	end	 
 
 
 
end 
 
 
 
function mIntro_car_talk_cb() 
 
	--convo_start(mIntro_convo.transit_talk) 
 
	--convo_wait_for_end() 
 
	--trigger_clear(mIntro_trigger.car_chat.name) 
 
	--convo_end_all() 
 
end 
 
 
 
function mIntro_hell_talk_cb() 
 
	--convo_start(mIntro_convo.hell_talk) 
 
	--convo_wait_for_end() 
 
	--trigger_clear(mIntro_trigger.hell_chat.name) 
 
	--convo_end_all() 
 
end 
 
 
 
function mIntro_plan_talk_cb() 
 
	--convo_start(mIntro_convo.con_nudge_a) 
 
	--convo_wait_for_end() 
 
	--trigger_clear(mIntro_trigger.plan_chat.name) 
 
	--convo_end_all() 
 
end 
 
 
 
 
 
------------------------------------ 
 
-- 
 
-- Checkpoint thread functions 
 
-- 
 
------------------------------------ 
 
 
 
-------------------------------------------------------------------------------------------------- 
 
--[[ 
 
 
 
   _____                                        ______                _   _                  
 
  / ____|                                      |  ____|              | | (_)                 
 
 | |     ___  _ __ ___  _ __ ___   ___  _ __   | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
 
 | |    / _ \| '_ ` _ \| '_ ` _ \ / _ \| '_ \  |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
 
 | |___| (_) | | | | | | | | | | | (_) | | | | | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
 
  \_____\___/|_| |_| |_|_| |_| |_|\___/|_| |_| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
 
																							 
 
																							 
 
]]-- 
 
								 
 
function mIntro_setup_homies ( homie_group ) 
 
	if homie_group.kinzie ~= nil and homie_group.kinzie ~= "" then 
 
		mIntro_homie.kinzie = homie_group.kinzie 
 
		party_add(mIntro_homie.kinzie, LOCAL_PLAYER) 
 
		follower_set_can_abandon( mIntro_homie.kinzie, false ) 
 
		--to prevent from losing this mission 
 
		turn_invulnerable(mIntro_homie.kinzie) 
 
		npc_never_die(mIntro_homie.kinzie, true) 
 
		on_death ( "", mIntro_homie.kinzie ) 
 
		on_dismiss ( "mIntro_failure_dismissed_cb", mIntro_homie.kinzie ) 
 
		party_set_dismissable(false) 
 
	end 
 
	 
 
end 
 
 
 
function mIntro_cleanup_homies() 
 
	if mIntro_homie.kinzie ~= nil and mIntro_homie.kinzie ~= "" then 
 
		on_death("", mIntro_homie.kinzie)  
		on_dismiss("", mIntro_homie.kinzie)  
	end 
 
	 
 
end 
 
 
 
function mIntro_safe_thread_kill( thread ) 
 
	 
 
	if( thread ~= nil )	then 
 
		if( thread ~= INVALID_THREAD_HANDLE) then 
 
			thread_kill( thread ) 
 
			thread = INVALID_THREAD_HANDLE 
 
		end 
 
	end 
 
 
 
end 
 
 
 
 
 
 
 
-------------------------------------------------------------------------------------------------- 
 
--[[ 
 
 
 
   _____      _ _ _                _      ______                _   _                  
 
  / ____|    | | | |              | |    |  ____|              | | (_)                 
 
 | |     __ _| | | |__   __ _  ___| | __ | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
 
 | |    / _` | | | '_ \ / _` |/ __| |/ / |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
 
 | |___| (_| | | | |_) | (_| | (__|   <  | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
 
  \_____\__,_|_|_|_.__/ \__,_|\___|_|\_\ |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
 
																					   
 
																					   
 
]]-- 
 
 
 
function mIntro_failure_kinzie_died_cb() 
 
	mission_end_failure("mIntro", "GM_INTRO_FAIL_KINZIE_DIED")  
end 
 
 
 
 
 
function mIntro_failure_dismissed_cb() 
 
	mission_end_failure("mIntro", "GM_INTRO_FAIL_KINZIE_DIS")  
end 
 
 
 
-------------------------------------------------------------------------------------------------- 
 
--[[ 
 
 
 
  _______ _                        _   ______                _   _                  
 
 |__   __| |                      | | |  ____|              | | (_)                 
 
	| |  | |__  _ __ ___  __ _  __| | | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
 
	| |  | '_ \| '__/ _ \/ _` |/ _` | |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
 
	| |  | | | | | |  __/ (_| | (_| | | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
 
	|_|  |_| |_|_|  \___|\__,_|\__,_| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
 
																				    
 
																				    
 
]]--