--[[
MM_Z_04.lua
SR3 Mission Script
DATE: 11-12-2010
AUTHOR: Jimmy Cross
]]--
-- Debug flags --
-- Tweakable Parameters --
-- Groups --
-- Navpoints --
MM_Z_04_navs = {
cp_start = { "local_player", "remote_player" }
}
-- Triggers --
MM_Z_04_trigger = {
}
-- Characters --
-- Vehicles --
-- Mesh Movers --
-- Text --
-- Threads --
-- Checkpoints --
MM_Z_04_checkpoint = {
start = {
name = MISSION_START_CHECKPOINT,
nav1 = "start_nav 001",
nav2 = "start_nav 002"
}
}
-- Cutscenes --
MM_Z_04_cutscene = {
zimos_outro = "Z_Z02"
--zimos_outro = ""
}
CUTSCENE_MISSION_INTRO = ""
CUTSCENE_MISSION_OUTRO = ""
-- Conversations --
MM_Z_04_convo = {
--[[mission_start = {
name = "MM_Z_04_convo_1",
handle = INVALID_CONVERSATION_HANDLE
}
]]--
}
-- Other --
-- *************************
--
-- 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
--
-- checkpoint: The checkpoint the mission should begin at
-- is_restart: TRUE if the mission is restarting, FALSE otherwise
--
function MM_Z_04_start(checkpoint, is_restart)
-- Check if this mission starting from the beginning
if (checkpoint == MM_Z_04_checkpoint.start.name) then
if (is_restart == false) then
-- First time playing mission
if( MM_Z_04_cutscene.zimos_outro ~= "" ) then
--cutscene_in()
--cutscene_play( MM_Z_04_cutscene.zimos_outro )
zscene_prep( MM_Z_04_cutscene.zimos_outro )
while( not zscene_is_loaded(MM_Z_04_cutscene.zimos_outro) ) do
thread_yield()
end
cutscene_play( MM_Z_04_cutscene.zimos_outro, nil, MM_Z_04_navs.cp_start, false )
--fade_out( 0.5 )
--fade_out_block()
--teleport_coop( MM_Z_04_navs.cp_start.player_local, MM_Z_04_navs.cp_start.player_remote, true )
--bink_play( MM_Z_04_cutscene.zimos_outro )
--fade_in( 0.5 )
--fade_in_block()
--cutscene_out()
end
end
fade_out(0)
end
-- Handle mission initialization for the current checkpoint
MM_Z_04_initialize(checkpoint)
-- Run the mission from the current checkpoint
MM_Z_04_run(checkpoint)
end
-- This is the primary function responsible for running the entire mission from start to finish.
--
-- first_checkpoint: The first checkpoint to begin running the mission at
--
function MM_Z_04_run(first_checkpoint)
local current_checkpoint = first_checkpoint
-- Run the mission from the beginning
if( current_checkpoint == MM_Z_04_checkpoint.start.name ) then
--[[ INSERT PROCESSING FOR THE FIRST CHECKPOINT HERE ]]--
--[[
-- Intro animations
-- Player(s) look cool GO!
local anim_name = "M06 Player Mission Start"
local morph_name = "M06 Player Mission Start"
local force_play = false
local stand_still = false
local zero_movement = false
action_play_non_blocking(LOCAL_PLAYER, anim_name, morph_name, force_play, stand_still, zero_movement)
player_script_controlled_clear(LOCAL_PLAYER) -- let player escape this animation
if (coop_is_active()) then
action_play_non_blocking(REMOTE_PLAYER, anim_name, morph_name, force_play, stand_still, zero_movement)
player_script_controlled_clear(REMOTE_PLAYER) -- let player escape this animation
end
--delay(3)
--while action_play_is_finished( LOCAL_PLAYER, 1.0 ) == false or action_play_is_finished( REMOTE_PLAYER, 1.0 ) == false do
--thread_yield()
--end
while action_sequence_is_playing() == true do
thread_yield()
end
]]--
mission_unlock("_A_TM_NE_01")
mission_set_completed("mm_z_04")
mission_end_silently(false)
mission_autosave()
end
end
-- This is the primary function responsible for cleaning up the entire mission
-- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++)
--
function MM_Z_04_cleanup()
--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]--
end
-- Called when the mission has ended with success
-- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++)
--
function MM_Z_04_success()
--[[ INSERT ANY MISSION SPECIFIC SUCCESS STUFF ]]--
end
-- *************************
--
-- Local functions
--
-- *************************
-- Initialize the mission for the specified checkpoint
--
-- checkpoint: Checkpoint to initialize the mission to
--
function MM_Z_04_initialize(checkpoint)
-- Make sure the screen is completly faded out
mission_start_fade_out(0.0)
-- Set the mission author
set_mission_author("Jimmy Cross")
-- Common initialization
MM_Z_04_initialize_common()
-- Checkpoint specific initialization
MM_Z_04_initialize_checkpoint(checkpoint)
-- Start fading in
mission_start_fade_in()
end
-- ***************************************************
-- MM_Z_04_run Helper Functions
-- ***************************************************
-- ***************************************************
-- MM_Z_04_initialize Helper Functions
-- ***************************************************
-- Handle any common initialization
--
function MM_Z_04_initialize_common()
--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]--
end
-- Checkpoint specific initialization
--
-- checkpoint: The checkpoint to be initialized
function MM_Z_04_initialize_checkpoint(checkpoint)
if (checkpoint == MM_Z_04_checkpoint.start.name) then
--[[ INSERT ANY INITIALIZATION CODE FOR STARTING THE MISSION AT THE BEGINNING ]]--
end
end
-- ***************************************************
-- Miscellaneous MM_Z_04 Helper Funcrtions
-- ***************************************************
function MM_Z_04_clear_trigger(trigger)
on_trigger( "", trigger )
trigger_enable( trigger, false )
marker_remove_trigger( trigger, SYNC_ALL )
end
-- *************************
--
-- Callback functions
--
-- *************************
-- *************************
--
-- Thread functions
--
-- *************************