-   
- --[[ USING THE MISSION START TEMPLATE   
- 		1.	Read "SR3 Mission Scripting Standards" if you haven't already.  
- 		2.	Save this file as "mIntro.lua" in the missions directory.  
- 		3.	Replace "mIntro" with the name of your mission (must use the same name as your mission start node).  
- 		3a.	Replace "mIntro" with the capitalized name of your mission  
- 		4.	Replace "20130821" with today's date.  
- 		5.	Replace "hvs" with your name.  
- 		6.	Replace "first_checkpoint_nav" with the name of the first location to go to  
- 		7.	Replace "fcp with a 3-4 letter abbreviation for the first checkpoint.  
- 		8.	Replace "next_checkpoint_nav" with the second checkpoint name (first is named start)  
- 		9.	Replace "ncp" with a 3-4 letter abbreviation for the next checkpoint.  
- 		10.	If you find an error with this template, fix it and check it in!!!!  
- 		11.	Remove these instructions.  You're on your own now!  
- ]]--  
-   
- --[[  
- 	mIntro.lua  
- 	SR3 Mission Script  
- 	DATE: 2013-12-09  
- 	AUTHOR:	Kevin Tyska  
- ]]--  
-   
-   
- -- Debug flags --  
-   
- -- Tweakable Parameters --  
-   
- --------------------------------------------------------------------------------------------------  
- 																				--[[ GROUPS ]]--  
- --------------------------------------------------------------------------------------------------  
-   
- --------------------------------------------------------------------------------------------------  
- 																				--[[ THREADS ]]--  
- --------------------------------------------------------------------------------------------------  
-   
-   
- --------------------------------------------------------------------------------------------------  
- 																			--[[ CHECKPOINTS ]]--  
- --------------------------------------------------------------------------------------------------  
- 	mSatanFlight_checkpoint = { 
- 		{ 
- 			name = MISSION_START_CHECKPOINT,		-- First Checkpoint - go to boss (gtb)  
- 			init = "mSatanFlight_gtb_init",				-- init(bool mission_restart)  
- 			run = "mSatanFlight_gtb_run",					-- run()  
- 			cleanup = "mSatanFlight_gtb_cleanup",			-- cleanup(bool mission_exit) (+++MUST RETURN IMMEDIATELY+++)  
- 			next_checkpoint = nil,  
- 			host_start = "nav_host",  
- 			client_start = "nav_client",  
- 			p1_car_nav = "",  
- 			p2_car_nav = "",  
- 			start_groups = { }, 
- 			cp_only_groups = { }, 
- 		},  
- 	}  
- 	  
- --------------------------------------------------------------------------------------------------  
- 																			--[[ CUTSCENES ]]--  
- --------------------------------------------------------------------------------------------------  
-   
- 	  
- --------------------------------------------------------------------------------------------------  
- 																			--[[ RAIL DATA ]]--  
- --------------------------------------------------------------------------------------------------  
- 	  
- 	-- mSatanFlight_rail = { 
- 		-- gth_flight_rail = { 
- 			-- vehicle = M1_group.gth_demons.vehicle,  
- 			-- mission_critical = true,  
- 			-- seats = { 
- 				-- -- driver and passaner npcs will be added after team slection  
- 				-- {character = LOCAL_PLAYER, seat_idx = 2 }, 
- 			-- },  
- 			-- coop_seats = { 
- 				-- -- driver and passaner npcs will be added after team slection  
- 				-- {character = LOCAL_PLAYER, seat_idx = 2 }, 
- 				-- {character = REMOTE_PLAYER, seat_idx = 3 }, 
- 			-- },  
- 			-- setup = false,  
- 		-- }  
- 	-- }  
-   
- --------------------------------------------------------------------------------------------------  
- 																			--[[ CONVERSATIONS ]]--  
- --------------------------------------------------------------------------------------------------  
-   
- 	mSatanFlight_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)  
- 			  
- 		},]]  
-   
- 	}  
- 	  
- 	mSatanFlight_convo_queue = { 
- 		--[[start_drive_queue = {  
- 			{ delay = 2.0, convo = mSatanFlight_convo.goto_first_checkpoint_nav }, 
- 			{ delay = 4.0, convo = mSatanFlight_convo.goto_first_checkpoint_nav2 }, 
- 			{ delay = 3.0, convo = mSatanFlight_convo.goto_first_checkpoint_nav3 }, 
- 			{ delay = 5.0, convo = mSatanFlight_convo.goto_first_checkpoint_nav4 } 
- 		},  
- 		]]--  
- 	}  
- 	  
- --------------------------------------------------------------------------------------------------  
- 																			--[[ TRIGGERS ]]--  
- --------------------------------------------------------------------------------------------------  
- 	mSatanFlight_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 = "mSatanFlight_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 = mSatanFlight_convo.convo_name  -- play a conversation  
- 		--	(optional)next_trigger = "next_trigger_name" sets up next trigger when triggered (breadcrumbs)  
- 		--},  
- 		  
- 									--[[ first_checkpoint_nav TRIGGERS ]]--  
-   
- 		  
-   
- 	}  
- 	  
- --------------------------------------------------------------------------------------------------  
- 																	  --[[ INTERROGATION DATA ]]--  
- --------------------------------------------------------------------------------------------------  
- 	--mSatanFlight_interrogate = { 
- 	--	leader = { 
- 	--		target = mSatanFlight_group.friendly_fire.owner,  
- 	--		persona = "Interrogation",  
- 	--		objective = "mSatanFlight_INTERROGATE_OWNER",  
- 	--	--	(optional)conversation = mSatanFlight_convo.convo_name  -- play a conversation while interrogating  
- 	--	},  
- 	--}  
-   
- --------------------------------------------------------------------------------------------------  
- 																				--[[ VFX ]]--  
- --------------------------------------------------------------------------------------------------	  
- mSatanFlight_vfx = { 
- 	  
- }  
-   
- 		  
- --------------------------------------------------------------------------------------------------  
- 																				   --[[ OTHER ]]--  
- --------------------------------------------------------------------------------------------------  
-   
- mSatanFlight_homie = { 
- 	kinzie = "",  
- }  
-   
- mSatanFlight_p1_attach = { 
- 	demon = "",  
- }  
-   
- mSatanFlight_p2_attach = { 
- 	demon = "",  
- }  
-   
- mSatanFlight_runtime = { 
- }  
-   
-   
- mSatanFlight_players = {} 
-   
-   
-   
- --------------------------------------------------------------------------------------------------  
- 								--[[**********************]]--  
- 								--[[                      ]]--  
- 								--[[  Standard functions  ]]--  
- 								--[[                      ]]--  
- 								--[[**********************]]--  
-   
- -- 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 mSatanFlight_start(start_checkpoint_name, is_restart)  
- 	--mission_start_fade_out(0.0)  
- 	  
- 	mission_startup(mSatanFlight_trigger, mSatanFlight_convo)  
-   
- 	-- Handle mission initialization for the current checkpoint  
- 	mSatanFlight_initialize(start_checkpoint_name)  
-   
- 	-- Run the mission from the current checkpoint  
- 	checkpoint_run_mission(mSatanFlight_checkpoint, start_checkpoint_name)  
- 	  
- 	mission_end_success("mSatanFlight")--, mSatanFlight_scene.outro, {, }) 
- 	--mission_set_next_mission( "mFlightTutorial" )  
- end  
-   
- -- This is the primary function responsible for cleaning up the entire mission  
- -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++)  
- --  
- function mSatanFlight_cleanup()  
- 	--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]--  
- 	  
- 	-- cleanup all threads  
- 	--cleanup_threads(mSatanFlight_thread)  
- 	  
- 	-- cleanup triggers, convos, kill_list and interrogations  
- 	mission_shutdown()  
- 	  
- 	-- cleanup all groups  
- 	--cleanup_groups(mSatanFlight_group)  
-   
- 	--Make sure no camera scripts are functioning  
- 	camera_script_disable()  
-   
- 	--make sure we're not exploding  
- 	continuous_explosion_stop()  
-   
- 	--make sure health pick ups are on  
- 	health_pickups_enable(true)  
-   
- 	--Make sure camera shake is off  
- 	camera_shake_stop()  
-   
- 	--Make sure vehicles spawn  
- 	spawning_vehicles(true)   
-   
- 	--Ensure player collision is on  
- 	character_collision_enable(LOCAL_PLAYER, true)  
-   
- 	--Make sure this is back on  
- 	-- Re-enable warp to shore	  
- 	for i, player in pairs( mSatanFlight_players ) do  
- 		player_warp_to_shore_enable( player )  
- 	end  
-   
- 	--camera_set_platforming_mode(false)  
-   
- end  
-   
- -- Called when the mission has ended with success  
- -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++)  
- --  
- function mSatanFlight_success()  
- 	--[[ INSERT ANY MISSION SPECIFIC SUCCESS STUFF ]]--  
- 	  
- end  
-   
- --------------------------------------------------------------------------------------------------  
- 								--[[**********************]]--  
- 								--[[                      ]]--  
- 								--[[ Initialize functions ]]--  
- 								--[[                      ]]--  
- 								--[[**********************]]--  
-   
- -- Initialize the mission for the specified checkpoint  
- --  
- -- checkpoint_name:		(string) Checkpoint to initialize the mission to  
- --  
- function mSatanFlight_initialize(checkpoint_name)  
- 	-- Common initialization  
- 	mSatanFlight_initialize_common()  
- 	  
- 	-- Checkpoint specific initialization  
- 	checkpoint_init(mSatanFlight_checkpoint, checkpoint_name)  
-   
- 	-- Get the player names  
- 	mSatanFlight_players = player_names_get_all()  
-   
- 	-- Start fading in   
- 	--mission_start_fade_in()  
- end  
-   
- -- Handle any common initialization  
- --  
- function mSatanFlight_initialize_common()  
- 	--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]--  
-   
- 	--Set up the camera for platforming  
- 	--camera_set_platforming_mode(true)  
-   
- 	--Turn off any and all super powers  
-   
- end  
-   
- -- function mSatanFlight_setup_homies( )  
- 	-- if mSatanFlight_groups.homies.kinzie ~= nil and coop_is_active()==false and mSatanFlight_groups.homies.kinzie ~= "" then  
- 		  
- 		-- if (add_to_party == true) then  
- 			-- party_add(mSatanFlight_groups.homies.kinzie, LOCAL_PLAYER)  
- 		-- end  
- 		  
- 		-- on_death("mSatanFlight_failure_kinzie_died_cb", mImpfest_homie.kinzie) 
- 		-- on_dismiss("mSatanFlight_failure_dismissed_cb", mImpfest_homie.kinzie) 
- 	-- end  
-   
- 	-- -- the co-op check here to get rid of her  
- 	-- if (coop_is_active() == true) then  
- 		-- mSatanFlight_cleanup_homies()  
- 		-- group_destroy(mSatanFlight_groups.homies.kinzie)  
- 	-- end  
- -- end  
-   
- -- -- remove callbacks for homies  
- -- --  
- -- function mSatanFlight_cleanup_homies()  
- 	-- if mSatanFlight_groups.homies.kinzie ~= nil and coop_is_active()==false then  
- 		-- on_death("", mSatanFlight_groups.homies.kinzie) 
- 		-- on_dismiss("", mSatanFlight_groups.homies.kinzie) 
- 	-- end  
- -- end  
-   
- --------------------------------------------------------------------------------------------------  
- 								--[[**********************]]--  
- 								--[[                      ]]--  
- 								--[[ Checkpoint functions ]]--  
- 								--[[                      ]]--  
- 								--[[**********************]]--  
-   
- --------------------------------------------------------------------------------------------------  
- 																	--[[ Go to Boss ]]--  
- --------------------------------------------------------------------------------------------------  
-   
- -- Initialize this checkpoint.  
- --  
- -- mission_start: (bool) Whether we're initializing from a mission (re)start or from  
- --					a natural play-through.  
- --  
- function mSatanFlight_gtb_init(mission_start)  
- 	  
- end  
-   
- -- The first objective  
- --  
- function mSatanFlight_gtb_run()  
-   
- 	local start_cp = get_table_by_name(mSatanFlight_checkpoint, MISSION_START_CHECKPOINT)  
- 	local fade_in_after = true  
- 	cutscene_play("Bink_Islands_Completed", nil, {start_cp.host_start, start_cp.client_start}, fade_in_after) 
-   
- 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 mSatanFlight_gtb_cleanup(mission_exit)  
-   
- end  
-   
- ------------------------------------  
- --  
- -- Checkpoint helper functions  
- --  
- ------------------------------------  
-   
- ------------------------------------  
- --  
- -- Checkpoint callback functions  
- --  
- ------------------------------------  
-   
- --   
- --------------------------------------------------------------------------------------------------  
- 								--[[**********************]]--  
- 								--[[                      ]]--  
- 								--[[   Common functions   ]]--  
- 								--[[                      ]]--  
- 								--[[**********************]]--  
- 								  
-   
-   
- --------------------------------------------------------------------------------------------------  
- 								--[[**********************]]--  
- 								--[[                      ]]--  
- 								--[[  Callback functions  ]]--  
- 								--[[                      ]]--  
- 								--[[**********************]]--  
-   
-   
- --------------------------------------------------------------------------------------------------  
- 								--[[**********************]]--  
- 								--[[                      ]]--  
- 								--[[   Thread functions   ]]--  
- 								--[[                      ]]--  
- 								--[[**********************]]--  
-   
-   
-