--[[
mm_p_03.lua
SR3 Mission Script
DATE: 9-3-2010
AUTHOR: Jimmy Cross
]]--
-- Debug flags --
-- Tweakable Parameters --
MM_P_03_PIERCE_SPAWN_DIST = 55.0
MM_P_03_PIERCE_ADD_DIST = 5.0
PURCHASE_STORE_OBJ_DIST = 5.0
FLASHPOINT_SPAWN_DIST = 75.0
FLASHPOINT_NOT_ACTIVE = 1
FLASHPOINT_FAILED = 3
FLASHPOINT_COMPLETE = 4
-- Groups --
MM_P_03_group = {
npcs = {
name = "MM_P_03_NPC",
pierce = "MM_P_03_NPC_Pierce"
},
fp = {
name = "MM_P_03_FP"
},
vehicles = {
name = "MM_P_03_Vehicle_Group",
vehicle = "MM_P_03_vehicle"
},
CTE_MMP03_01 = {
name = "CTE_MMP03_Pierce_Car_01"
},
post_cte = { "MM_P_03_NPC", "MM_P_03_Vehicle_Group" }
}
-- Navpoints --
checkpoint_nav = "MM_P_03_Nav_Store_Front" -- navpoint to teleport Pierce to at checkpoint
MM_P_03_navs = {
fp = "MM_P_03_Nav_FP",
fp2 = "MM_P_03_Nav_FP02",
sf = "MM_P_03_Nav_Store_Front",
collectible = "MM_P_03_Nav_Collectible",
store = "MM_P_03_Nav_Store",
store_int = "MM_P_03_Nav_Inside_Store",
cp_start = {
player_local = "Local Player Start",
player_remote = "Remote Player Start"
}
}
-- Triggers --
MM_P_03_trigger = {
fp1 = {
name = "trigger_fp1",
is_triggered = false
},
fp2 = {
name = "trigger_fp2",
is_triggered = false
}
}
-- Characters --
-- Vehicles --
-- Mesh Movers --
-- Text --
-- Threads --
local PIERCE_WATCHER_THREAD = INVALID_THREAD_HANDLE
local MMP03_PLAY_CONVO_THREAD = INVALID_THREAD_HANDLE
-- Checkpoints --
MM_P_03_checkpoint = {
start = {
name = MISSION_START_CHECKPOINT,
navs = { "cp_start_local", "cp_start_remote" }
},
flashpoint = {
name = "flashpoint",
nav1 = "Local Player Start",
nav2 = "Remote Player Start",
nav3 = "MM_P_03_Nav_Store_Front"
}
}
-- Cutscenes --
CUTSCENE_MISSION_INTRO = ""
MMP03_CUTSCENE_CTE_INTRO = "mmp03_cte_01"
CUTSCENE_MISSION_OUTRO = ""
-- Conversations --
MM_P_03_convo = {
start = {
name = "MM_P_03_Start",
handle = INVALID_CONVERSATION_HANDLE
},
store_purchased = {
name = "MM_P_03_After_Purchase",
handle = INVALID_CONVERSATION_HANDLE
},
collect = {
name = "MM_P_03_Find_Collectable",
handle = INVALID_CONVERSATION_HANDLE
},
buy_bld = {
name = "MM_P_03_Go_Buy_Building",
handle = INVALID_CONVERSATION_HANDLE
},
drive_fp = {
name = "MM_P_03_Drive_To_Flashpoint",
handle = INVALID_CONVERSATION_HANDLE
},
finished_fp = {
name = "MM_P_03_2nd_Flashpoint",
handle = INVALID_CONVERSATION_HANDLE
},
fp2 = {
name = "MM_P_03_Finished_Flashpoint",
handle = INVALID_CONVERSATION_HANDLE
},
notoriety = {
name = "MM_P_03_Drive_To_Lose",
handle = INVALID_CONVERSATION_HANDLE
}
}
-- Failure text --
local PIERCE_DEAD = "mm_p_03_pierce_died" -- Pierce Died
local PIERCE_ABANDONDED = "mm_p_03_pierce_abandonded"
local FAIL_FP = "mm_p_03_fail_fp"
-- Misc Globals
local MM_P_03_NAG_ACTIVE = false
local MM_P_03_FP_NAG = "MM03_NAG_FP"--"mm_p_03_nag_fp"--
local mm_p_03_convo_playing = false
-- *************************
--
-- 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_p_03_start(checkpoint, is_restart)
-- Check if this mission starting from the beginning
if (checkpoint == MM_P_03_checkpoint.start.name) then
if (is_restart == false) then
-- First time playing mission
local fade_in_after = false
-- Play CTE before any code happens
group_create( MM_P_03_group.CTE_MMP03_01.name, true )
cutscene_play( MMP03_CUTSCENE_CTE_INTRO, nil, MM_P_03_checkpoint.start.navs, fade_in_after )
group_destroy( MM_P_03_group.CTE_MMP03_01.name )
else
teleport_coop(MM_P_03_checkpoint.start.navs[1], MM_P_03_checkpoint.start.navs[2], true)
end
fade_out(0)
end
-- Handle mission initialization for the current checkpoint
mm_p_03_initialize(checkpoint)
-- Run the mission from the current checkpoint
mm_p_03_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_p_03_run(first_checkpoint)
local current_checkpoint = first_checkpoint
-- Run the mission from the beginning
if( current_checkpoint == MM_P_03_checkpoint.start.name ) then
delay(1.5)
MMP03_PLAY_CONVO_THREAD = thread_new("mm_p_03_play_convo_thread", MM_P_03_convo.start)
mm_p_03_go_to_storefront()
mm_p_03_collectibles()
mm_p_03_go_to_property()
current_checkpoint = MM_P_03_checkpoint.flashpoint.name
mission_set_checkpoint( MM_P_03_checkpoint.flashpoint.name, true )
end
if( current_checkpoint == MM_P_03_checkpoint.flashpoint.name ) then
mm_p_03_go_to_flashpoint()
mm_p_03_lower_notoriety()
end
-- Call mission success??
mission_end_success( "mm_p_03", CUTSCENE_MISSION_OUTRO )
-- get rid of Pierce
party_dismiss( MM_P_03_group.npcs.pierce )
-- tell Player new mission available
--message( "!!A new mission is available", 6.0 )
-- mission_unlock( "next_mission" ) -- unlock the next mission
end
-- This is the primary function responsible for cleaning up the entire mission
-- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++)
--
function mm_p_03_cleanup()
--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]--
tutorial_stop("notoriety_decreases")
mm_p_03_clear_trigger( MM_P_03_trigger.fp1.name )
mm_p_03_clear_trigger( MM_P_03_trigger.fp2.name )
marker_remove( MM_P_03_navs.sf, SYNC_ALL )
marker_remove( MM_P_03_navs.collectible, SYNC_ALL )
marker_remove( MM_P_03_navs.store, SYNC_ALL )
marker_remove( MM_P_03_navs.fp, SYNC_ALL )
marker_remove( MM_P_03_navs.fp2, SYNC_ALL )
marker_remove( MM_P_03_navs.store_int, SYNC_ALL )
mission_waypoint_remove()
if group_is_loaded(MM_P_03_group.vehicles.name) then
group_destroy(MM_P_03_group.vehicles.name)
end
-- make sure clerks are turned back on
shop_ignore_clerk(false)
on_death( "", MM_P_03_group.npcs.pierce )
on_dismiss( "", MM_P_03_group.npcs.pierce )
group_destroy( MM_P_03_group.npcs.name )
flashpoints_enable( true )
mm_p_03_unregister_trigger(1)
mm_p_03_unregister_trigger(2)
notoriety_set_max("morningstar", 5)
notoriety_set_max("police", 5)
notoriety_set("morningstar", 0)
notoriety_set("police", 0)
end
-- Called when the mission has ended with success
-- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++)
--
function mm_p_03_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_p_03_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_p_03_initialize_common()
-- Checkpoint specific initialization
mm_p_03_initialize_checkpoint(checkpoint)
-- Start fading in
mission_start_fade_in()
end
-- Getting the player to the Saints HQ after mission accepted on phone
--
--
function mm_p_03_go_to_storefront()
local property = false
local store_cost = 100
if not mission_store_purchased(property) then
shop_ignore_clerk(true) -- ignore clerk related problems with store purchasing
-- give player some monies
cash_add(store_cost)
-- maybe we shouldn't give coop money because he's not required to purchase? meh.
if(coop_is_active())then
cash_add(store_cost, "#PLAYER2#")
end
-- probably need to set an objective marker and waypoint here to make clear which store must be purchased
mission_waypoint_add( MM_P_03_navs.store, SYNC_ALL)
marker_add( MM_P_03_navs.store, MINIMAP_ICON_LOCATION, OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL )
-- tell player to buy it
objective_text( 0, "MM03_OBJ_PURCHASE_STORE", nil, nil, SYNC_ALL, OI_ASSET_LOCATION )
-- wait until store is purchased
while not mission_store_purchased(property) do
thread_yield()
end
shop_ignore_clerk(false)
mission_waypoint_remove( SYNC_ALL )
marker_remove( MM_P_03_navs.store, SYNC_ALL )
delay(6)
MMP03_PLAY_CONVO_THREAD = thread_new("mm_p_03_play_convo_thread", MM_P_03_convo.store_purchased)
end
end
function mm_p_03_go_to_property()
objective_text_clear(0)
objective_text( 0, "MM03_OBJ_GOTO_PROPERTY", nil, nil, SYNC_ALL, OI_ASSET_LOCATION )
MMP03_PLAY_CONVO_THREAD = thread_new("mm_p_03_play_convo_thread", MM_P_03_convo.buy_bld)
local property = true
local property_cost = 100
if not mission_store_purchased(property) then
-- give player some monies
cash_add(property_cost)
-- maybe we shouldn't give coop money because he's not required to purchase? meh.
if(coop_is_active())then
cash_add(property_cost, "#PLAYER2#")
end
mission_waypoint_add( MM_P_03_navs.sf, SYNC_ALL)
marker_add( MM_P_03_navs.sf, MINIMAP_ICON_LOCATION, OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL )
repeat thread_yield() until ( get_dist_closest_player_to_object( MM_P_03_navs.sf ) < 5 )
objective_text_clear(0)
-- tell player to buy it
objective_text( 0, "MM03_OBJ_PURCHASE_PROPERTY", nil, nil, SYNC_ALL, OI_ASSET_LOCATION )
-- wait until store is purchased
while not mission_store_purchased(property) do
thread_yield()
end
--insert processing for property purchase here
mission_waypoint_remove( SYNC_ALL )
marker_remove( MM_P_03_navs.sf, SYNC_ALL )
end
end
function mm_p_03_collectibles()
objective_text_clear(0)
objective_text( 0, "MM03_OBJ_GOTO_COLLECTIBLE", nil, nil, SYNC_ALL, OI_ASSET_LOCATION )
if not mission_collectible_collected() then
-- probably need to set an objective marker and waypoint here to make clear which collectable to go to
mission_waypoint_add(MM_P_03_navs.collectible, SYNC_ALL)
marker_add(MM_P_03_navs.collectible, MINIMAP_ICON_LOCATION, OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL )
repeat thread_yield() until ( get_dist_closest_player_to_object( MM_P_03_navs.collectible ) < 10 )
objective_text_clear(0)
objective_text( 0, "MM03_OBJ_ACQUIRE_COLLECTIBLE", nil, nil, SYNC_ALL, OI_ASSET_LOCATION )
-- wait until it is collected
while not mission_collectible_collected() do
thread_yield()
end
MMP03_PLAY_CONVO_THREAD = thread_new("mm_p_03_play_convo_thread", MM_P_03_convo.collect)
marker_remove( MM_P_03_navs.collectible, SYNC_ALL)
mission_waypoint_remove( SYNC_ALL )
end
end
function mm_p_03_go_to_flashpoint()
local flashpoint_num = 1 --DD: Which flashpoint we're dealing with
local fp_nav = "" --DD: Will store the waypoint marker navpoint
delay(5)
MMP03_PLAY_CONVO_THREAD = thread_new("mm_p_03_play_convo_thread", MM_P_03_convo.drive_fp)
while not ( flashpoint_num == 3 ) do
--DD: Set which navpoint we're referring to for the waypoint marker
if ( flashpoint_num == 1 ) then
fp_nav = MM_P_03_navs.fp
else
fp_nav = MM_P_03_navs.fp2
end
mm_p_03_register_trigger( flashpoint_num ) --setup the bounding trigger
objective_text( 0, "MM03_OBJ_GOTO_FP", nil, nil, SYNC_ALL, OI_ASSET_LOCATION )
-- update GPS info
mission_waypoint_add( fp_nav ) -- add GPS marker at the flashpoint activity
marker_add( fp_nav, MINIMAP_ICON_LOCATION, OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL )
--marker_add_trigger( MM_P_03_trigger.fp.name, MINIMAP_ICON_LOCATION, INGAME_EFFECT_CHECKPOINT, OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL )
-- wait for the Player to get to the flashpoint point
repeat thread_yield() until ( get_dist_closest_player_to_object( fp_nav ) < FLASHPOINT_SPAWN_DIST )
flashpoints_enable(true)
flashpoint_start_mission( flashpoint_num )
local flashpoint_complete = false
repeat
thread_yield() -- make sure player is close enough to activate the flashpoint
until ( get_dist_closest_player_to_object( fp_nav ) < 17 ) or (flashpoint_mission_status() ~= FLASHPOINT_NOT_ACTIVE)
objective_text_clear(0)
mission_waypoint_remove()
marker_remove( fp_nav, SYNC_ALL )
objective_text( 0, "MM03_OBJ_KILL_FP", nil, nil, SYNC_ALL, OI_ASSET_KILL ) --tell the player to destroy the flashpoint
while not flashpoint_complete do
local fp_status = flashpoint_mission_status()
if fp_status == FLASHPOINT_FAILED then
mm_p_03_fail_fp()
--mission_end_failure("mm_p_03", FAIL_FP ) --"You failed the flashpoint")
--mission_end_failure("mm_p_03", FAIL_FP ) --"You failed the flashpoint")
elseif fp_status == FLASHPOINT_COMPLETE then
mm_p_03_unregister_trigger(flashpoint_num) --make sure the bounding trigger is unregistered
flashpoint_complete = true
if flashpoint_num == 1 then
MMP03_PLAY_CONVO_THREAD = thread_new("mm_p_03_play_convo_thread", MM_P_03_convo.finished_fp)
else
MMP03_PLAY_CONVO_THREAD = thread_new("mm_p_03_play_convo_thread", MM_P_03_convo.fp2)
end
flashpoint_num = flashpoint_num + 1
end
thread_yield()
end
objective_text_clear(0)
end
-- tell the Player flashpoints now available across entire city
--message( "!!Flashpoints are now unlocked across the entire city and can be done at any time for increased cash flow ", 6.0 )
--need: script action to unlock flashpoints
end
function mm_p_03_lower_notoriety()
mission_waypoint_add( MM_P_03_navs.store_int, SYNC_ALL)
marker_add( MM_P_03_navs.store_int, MINIMAP_ICON_LOCATION, OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL )
-- tell player to go back to the store to lower notoriety
objective_text( 0, "MM03_OBJ_CLEAR_NOTORIETY", nil, nil, SYNC_ALL, OI_ASSET_LOCATION )
MMP03_PLAY_CONVO_THREAD = thread_new("mm_p_03_play_convo_thread", MM_P_03_convo.notoriety)
tutorial_unlock( "notoriety_decreases", true )
repeat thread_yield() until ( get_dist_closest_player_to_object( MM_P_03_navs.store_int ) < 3 )
mission_waypoint_remove()
marker_remove( MM_P_03_navs.store_int, SYNC_ALL )
if tutorial_visible() == true then
tutorial_stop_current()
end
tutorial_start("notoriety_decreases", 0, true, true)
notoriety_set_max( "morningstar", 0 )
notoriety_set( "morningstar", 0 )
notoriety_set_max("police", 0)
notoriety_set("police", 0)
while tutorial_visible() == true do
thread_yield()
end
delay(3)
end
-- ***************************************************
-- mm_p_03_run Helper Functions
-- ***************************************************
function mm_p_03_pierce_dead()
mission_end_failure( "mm_p_03", PIERCE_DEAD )
end
function mm_p_03_pierce_abandoned()
mission_end_failure( "mm_p_03", PIERCE_ABANDONDED )
end
function mm_p_03_spawn_watcher_thread()
if PIERCE_WATCHER_THREAD == INVALID_THREAD_HANDLE then
PIERCE_WATCHER_THREAD = thread_new( "mm_p_03_pierce_in_party" )
end
end
function mm_p_03_spawn_initial()
-- Spawn courtesy vehicle
if not group_is_loaded(MM_P_03_group.vehicles.name) then
group_create(MM_P_03_group.vehicles.name, true)
end
--release_to_world(MM_P_03_group.vehicles.name)
group_create( MM_P_03_group.npcs.name, true ) --create the NPC group
--teleport_coop(MM_P_03_checkpoint.start.nav1, MM_P_03_checkpoint.start.nav2, true)
on_death( "mm_p_03_pierce_dead", MM_P_03_group.npcs.pierce ) --callback for pierce dying
on_dismiss( "mm_p_03_pierce_abandoned", MM_P_03_group.npcs.pierce ) --abandoning pierce makes him sadface
party_add( MM_P_03_group.npcs.pierce )
follower_set_can_abandon(MM_P_03_group.npcs.pierce, true)
mm_p_03_spawn_watcher_thread()
end
function mm_p_03_unregister_trigger( flashpoint_num )
if MM_P_03_NAG_ACTIVE == true then
--hud_critical_timer_stop( 1 )
MM_P_03_NAG_ACTIVE = false
end
if ( flashpoint_num == 1 ) then
on_trigger_exit( "", MM_P_03_trigger.fp1.name )
on_trigger( "", MM_P_03_trigger.fp1.name )
trigger_enable( MM_P_03_trigger.fp1.name, false )
else
on_trigger_exit( "", MM_P_03_trigger.fp2.name )
on_trigger( "", MM_P_03_trigger.fp2.name )
trigger_enable( MM_P_03_trigger.fp2.name, false )
end
end
function mm_p_03_register_trigger( flashpoint_num )
if ( flashpoint_num == 1 ) then
trigger_enable( MM_P_03_trigger.fp1.name, true )
on_trigger( "mm_p_03_entered_fp_area_trigger", MM_P_03_trigger.fp1.name )
--on_trigger_exit( "mm_p_03_left_fp_area_trigger", MM_P_03_trigger.fp.name ) --move to the on_trigger callback
else
trigger_enable( MM_P_03_trigger.fp2.name, true)
on_trigger( "mm_p_03_entered_fp_area_trigger", MM_P_03_trigger.fp2.name )
--on_trigger_exit( "mm_p_03_left_fp_area_trigger", MM_P_03_trigger.fp.name )
end
end
-- ***************************************************
-- mm_p_03_initialize Helper Functions
-- ***************************************************
-- Handle any common initialization
--
function mm_p_03_initialize_common()
--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]--
end
-- Checkpoint specific initialization
--
-- checkpoint: The checkpoint to be initialized
function mm_p_03_initialize_checkpoint(checkpoint)
notoriety_set_max("morningstar", 3)
notoriety_set_max("police", 1)
flashpoints_enable( false )
if( checkpoint == MM_P_03_checkpoint.start.name ) then
mm_p_03_spawn_initial()
end
if( checkpoint == MM_P_03_checkpoint.flashpoint.name ) then
if not group_is_loaded( MM_P_03_group.npcs.name ) then --see if the NPC group is loaded
group_create( MM_P_03_group.npcs.name, true ) --create the NPC group
teleport_coop(MM_P_03_checkpoint.flashpoint.nav1, MM_P_03_checkpoint.flashpoint.nav2, true)
teleport( MM_P_03_group.npcs.pierce, MM_P_03_checkpoint.flashpoint.nav3, true )
on_death( "mm_p_03_pierce_dead", MM_P_03_group.npcs.pierce ) --callback for pierce dying
on_dismiss( "mm_p_03_pierce_abandoned", MM_P_03_group.npcs.pierce ) --abandoning pierce makes him sadface
party_add( MM_P_03_group.npcs.pierce )
follower_set_can_abandon(MM_P_03_group.npcs.pierce, true)
mm_p_03_spawn_watcher_thread()
teleport_coop( MM_P_03_navs.cp_start.player_local, MM_P_03_navs.cp_start.player_remote, true )
end
end
end
-- ***************************************************
-- Miscellaneous mm_p_03 Helper Funcrtions
-- ***************************************************
function mm_p_03_clear_trigger(trigger)
on_trigger( "", trigger )
trigger_enable( trigger, false )
marker_remove_trigger( trigger, SYNC_ALL )
end
-- *************************
--
-- Callback functions
--
-- *************************
function mm_p_03_sp_trigger_cb()
-- clear the trigger, waypoint, and objective
mm_p_03_clear_trigger( MM_P_03_trigger.sp.name )
waypoint_remove()
marker_remove( MM_P_03_navs.sf, SYNC_ALL )
objective_text_clear(0)
MM_P_03_trigger.sp.hit = true
--[[ TODO: add functionality for purchasing building/store ]]--
-- Hit the trigger at the purchase point, trigger purchase screen
--message( "Bought a building" ) -- fake buying a building
delay( 3.0 )
--[[ /TODO ]]--
-- objective complete, update checkpoint and move on to flashpoint
-- current_checkpoint = MM_P_03_checkpoint.flashpoint.name
-- mission_set_checkpoint( current_checkpoint, true )
end
function mm_p_03_entered_fp_area_trigger( player_name, trigger_name )
--message("inside fp trigger", 2)
--stop nagging the player
if MM_P_03_NAG_ACTIVE == true then
--hud_critical_timer_stop( 1 )
if player_name == LOCAL_PLAYER then
mission_help_clear(SYNC_LOCAL)
else
mission_help_clear(SYNC_REMOTE)
end
end
MM_P_03_NAG_ACTIVE = false
on_trigger_exit( "mm_p_03_left_fp_area_trigger", trigger_name )
end
function mm_p_03_left_fp_area_trigger( player_name, trigger_name )
MM_P_03_NAG_ACTIVE = true
--message("left the trigger, you're gonna fail!!", 8)
--nag the player that he's going to fail the flashpoint
local sync = SYNC_LOCAL
if ( player_name == REMOTE_PLAYER ) then
sync = SYNC_REMOTE
end
--hud_critical_timer_set( 20000, MM_P_03_FP_NAG, "mm_p_03_fail_fp", sync ) --FAIL_TIMER_INDICES[player_name]
mission_help_table_nag( MM_P_03_FP_NAG, "", "", sync )
--mission_help_table( MM_P_03_FP_NAG, nil, nil, sync )
-- Player is no longer in this trigger, so register a new on_trigger callback
on_trigger( "mm_p_03_entered_fp_area_trigger", trigger_name )
end
function mm_p_03_fail_fp()
mission_end_failure("mm_p_03", FAIL_FP ) --"You failed the flashpoint")
end
-- *************************
--
-- Thread functions
--
-- *************************
function mm_p_03_pierce_in_party()
while npc_is_in_party( MM_P_03_group.npcs.pierce ) == true do
thread_yield()
end
end
function mm_p_03_play_convo_thread(convo)
convo.handle = audio_conversation_load(convo.name)
while mm_p_03_convo_playing == true do
thread_yield()
end
mm_p_03_convo_playing = true
audio_conversation_play(convo.handle)
audio_conversation_wait_for_end(convo.handle)
audio_conversation_end(convo.handle)
mm_p_03_convo_playing = false
--convo.handle = INVALID_CONVERSATION_HANDLE
end