--[[
m04.lua
SR3 Mission Script
DATE: 08/04/2010
AUTHOR: Anne Chilldon
]]--
-- Debug flags --
-- Tweakable Parameters --
--delay between calling the M04_Attack situation
M04_Attack_Line_Time = 5.0
M04_mechanic_cash = 50 -- enough to buy a paint job
M04_clothes_cash = 50 -- enough to buy a hat
-- Groups --
M04_group = {
--[[ = {
name = "name from editor",
members = { "optional", "list", "of", "members" },
},
= {
name = "next group name"
},]]
homies_001 = {
name = "Homies_grp",
members = { "Pierce" }
},
goons_001 = {
name = "Morningstar_goons",
members = { "Morningstar_goon_001", "Morningstar_goon_002", "Morningstar_goon_003"}
},
brute_001 = {
name = "Morningstar_brute",
vehicle = "Brute_Vehicle 001",
members = { "Morningstar Brute" }
},
brute_002 = {
name = "Brute_Driver_Group",
members = { "Brute_Driver 001" }
},
starting_vehicle = {
name = "Starting_Vehicles",
vehicle = "Helper_Vehicle 001"
},
backup_vehicle = {
name = "Backup_Vehicles",
vehicle = "Helper_Vehicle 002"
},
roadblock_001 = {
name = "RoadBlock 001",
vehicles = { "RoadBlock1_Vehicle 001", "RoadBlock1_Vehicle 002", },
--"RoadBlock1_Vehicle 003"
members = { "RoadBlock1_NPC 002", "RoadBlock1_NPC 004", "RoadBlock1_NPC 005"}
},
roadblock_002 = {
name = "RoadBlock 002",
vehicles = { "RoadBlock2_Vehicle 001", "RoadBlock2_Vehicle 002", },
-- "RoadBlock2_Vehicle 003"
members = { "RoadBlock2_NPC 002", "RoadBlock2_NPC 004", "RoadBlock2_NPC 005"}
},
notoriety_001 = {
name = "grp_Notoriety1",
vehicle = "veh_Notoriety_Vehicle 001",
members = { "npc_Notoriety1 001", "npc_Notoriety1 002" }
},
notoriety_002 = {
name = "grp_Notoriety2",
vehicle = "veh_Notoriety_Vehicle 002",
members = { "npc_Notoriety2 001", "npc_Notoriety2 002" }
},
notoriety_003 = {
name = "grp_Notoriety3",
vehicle = "veh_Notoriety_Vehicle 003",
members = { "npc_Notoriety3 001", "npc_Notoriety3 002" }
},
notoriety_004 = {
name = "grp_Notoriety4",
vehicle = "veh_Notoriety_Vehicle 004",
members = { "npc_Notoriety4 001", "npc_Notoriety4 002" }
},
CTE_01 = {
name = "CTE_Pierce_car_01",
vehicle = "CTE_Vehicle 001"
}
}
-- Navpoints --
RETAIL_MARK = { "Goon_Navpoint 001", "Goon_Navpoint 002", "Goon_Navpoint 003" }
M04_P_TELEPORT_2 = { "Pierce_Teleport_2" }
M04_P_TELEPORT_3 = { "Pierce_Teleport_3" }
M04_P_TELEPORT_4 = { "Pierce_Teleport_4" }
M04_P_STORE = { "Pierce_store_nav" }
M04_PLAYER_START = { "m04_local_player_start" }
M04_COOP_START = { "m04_remote_player_start" }
M04_PLAYER_CHECKPOINT_2 = { "m04_local_checkpoint_2" }
M04_COOP_CHECKPOINT_2 = { "m04_remote_checkpoint_2" }
M04_PLAYER_CHECKPOINT_3 = { "m04_local_checkpoint_3" }
M04_COOP_CHECKPOINT_3 = { "m04_remote_checkpoint_3" }
M04_PLAYER_CHECKPOINT_4 = { "m04_local_checkpoint_4" }
M04_COOP_CHECKPOINT_4 = { "m04_remote_checkpoint_4" }
M04_PLAYER_STORE = { "m04_local_store_nav" }
M04_COOP_STORE = { "m04_remote_store_nav" }
M04_VEHICLE_CHECKPOINT_2 = { "m04_vehicle_checkpoint_2" }
M04_VEHICLE_CHECKPOINT_3 = { "m04_vehicle_checkpoint_3" }
-- Paths --
Brute_Path = "Brute_path"
-- Triggers --
-- Mechanic Trigger
MECHANIC_TRIGGER = "Mechanic_Trigger 001"
MECHANIC_TRIGGER2 = "Mechanic_Trigger 002"
-- Clothing Trigger
CLOTHES_TRIGGER = "Clothes_Trigger 001"
CLOTHES_TRIGGER2 = "Clothes_Trigger 002"
-- Safehouse Trigger
SAFEHOUSE_TRIGGER = "Safehouse_Trigger 001"
SAFEHOUSE_TRIGGER2 = "Safehouse_Trigger 002"
-- Notoriety Trigger
NOTORIETY_TRIGGER = "Notoriety_Trigger 001"
-- Traffic Trigger
TRAFFIC_TRIGGER = "trig_Traffic"
-- Characters --
-- Vehicles --
-- Mesh Movers --
-- Text --
-- Help Text/Objective --
-- Get in a car --
M04_OBJ_GET_CAR = "m04_obj_get_car"
-- Drive to RimJobs --
M04_OBJ_DRIVE_MECHANIC = "m04_obj_drive_mechanic"
-- Use the mechanic --
M04_OBJ_USE_MECHANIC = "m04_obj_use_mechanic"
-- Drive to Planet Saints --
M04_OBJ_DRIVE_PLANET_SAINTS = "m04_obj_drive_planet_saints"
-- Purchase clothing --
M04_OBJ_BUY_CLOTHES = "m04_obj_buy_clothes"
-- Kill Goons --
M04_OBJ_KILL_GOONS = "m04_obj_kill_goons"
-- Kill the Brute --
M04_OBJ_KILL_BRUTE = "m04_obj_kill_brute"
-- Return to the safehouse to remove the notoriety --
M04_OBJ_RETURN_HOME = "m04_obj_return_home"
-- Tutorial --
-- Mechanics ar used to repair and upgrade vehicles --
-- Clothing shops allow you to purchase clothing for your character. You may always swap out clothing you have purchased at your crib or in the store --
-- Whenever you have notoriety, it will reduce slowly over time or can be reduced immediately by visiting any building you own --
-- Dialog --
-- Pierce --
-- We need to find a place we can use yto upgrade our rides. We should take it to RimJobs to get it cleaned up
-- That place will work. Now that we're rollin' in style, we'll need to dress the part. Let's go to Planet Saints and get some fresh threads
-- Now we're stylin'
-- What the fuck is that thing
-- Amazing line, I'll call you when I have more info on those Morningstar
-- Player --
-- It looks angry
-- Failure Text --
-- Pierce Dies --
M04_FAILURE_PIERCE_DIED = "m04_failure_pierce_died"
-- Pierce is abandoned --
M04_FAILURE_ABANDON_PIERCE = "m04_failure_abandon_pierce"
-- Car destroyed --
M04_FAILURE_CAR_DESTROYED = "m04_failure_car_destroyed"
-- Threads --
M04_thread_convo = INVALID_THREAD_HANDLE
M04_thread_attack_line_timer = INVALID_THREAD_HANDLE
-- Checkpoints --
M04_CHECKPOINT_START = MISSION_START_CHECKPOINT -- defined in ug_lib.lua
M04_CHECKPOINT_CLOTHES_TUTORIAL = "m04_checkpoint_clothes_tutorial"
M04_CHECKPOINT_BRUTE_FIGHT = "m04_checkpoint_brute_fight"
M04_CHECKPOINT_NOTORIETY_REDUCTION = "m04_checkpoint_notoriety_reduction"
-- Cutscenes --
M04_CUTSCENE_MISSION_INTRO = ""
M04_CUTSCENE_CTE_INTRO = "m04_cte_01"
M04_CUTSCENE_MISSION_OUTRO = ""
-- Conversations --
M04_convo = {
mission_start = {
name = "m04_mission_start",
handle = INVALID_CONVERSATION_HANDLE,
},
drive_to_rj = {
name = "M04_Drive_To_RJ",
handle = INVALID_CONVERSATION_HANDLE,
},
go_to_ps = {
name = "M04_Go_To_PS",
handle = INVALID_CONVERSATION_HANDLE,
},
drive_to_ps = {
name = "M04_Drive_To_PS",
handle = INVALID_CONVERSATION_HANDLE,
},
sing_intro = {
name = "M04_Sing_A_Long_Intro",
handle = INVALID_CONVERSATION_HANDLE,
},
exit_ps = {
name = "M04_Exit_PS",
handle = INVALID_CONVERSATION_HANDLE,
},
brute_combat = {
name = "M04_Brute_Combat",
handle = INVALID_CONVERSATION_HANDLE,
},
escape = {
name = "M04_Escape",
handle = INVALID_CONVERSATION_HANDLE,
},
wtf = {
name = "M04_What_Was_That_Guy",
handle = INVALID_CONVERSATION_HANDLE,
},
}
-- Other --
-- Global Variables --
In_coop = false
Player_car = ""
convo_1 = false
convo_2 = false
sing_along = false
Num_guys_to_kill = 0
convo_is_playing = false
M04_given_mechanic_cash = false
M04_given_clothes_cash = false
-- Trigger Flags --
Driving_to_mechanic = false
Using_mechanic = false
Mechanic_breadcrumb_Reached = false
Mechanic_Reached = false
Mechanic_Purchase_Done = false
Mechanic_Tutorial_Done = false
Clothes_Store_Reached = false
Clothes_Purchase_Done = false
Clothes_Tutorial_Done = false
Safehouse_Reached = false
Notoriety_Reached = 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
--
-- m04_checkpoint: The checkpoint the mission should begin at
-- is_restart: TRUE if the mission is restarting, FALSE otherwise
--
function m04_start(m04_checkpoint, is_restart)
--m04_checkpoint = M04_CHECKPOINT_BRUTE_FIGHT
-- Check if this mission starting from the beginning
if (m04_checkpoint == M04_CHECKPOINT_START) then
if (is_restart == false) then
-- First time playing mission
local fade_in_after = false
local cte_navs = { "m04_local_player_start", "m04_remote_player_start" }
-- Play CTE before any code happens
group_create( M04_group.CTE_01.name, true )
vehicle_ignore_repulsors(M04_group.CTE_01.vehicle, true)
cutscene_play( M04_CUTSCENE_CTE_INTRO, nil, cte_navs, fade_in_after )
group_destroy( M04_group.CTE_01.name )
else
--Teleport the players
teleport_coop(M04_PLAYER_START[1], M04_COOP_START[1], true)
end
fade_out(0)
end
-- Handle mission initialization for the current checkpoint
m04_initialize(m04_checkpoint)
-- Run the mission from the current checkpoint
m04_run(m04_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 m04_run(first_checkpoint)
local current_checkpoint = first_checkpoint
--M04_convo.mission_start.handle = audio_conversation_load(M04_convo.mission_start.name)
--local current_checkpoint = M04_CHECKPOINT_BRUTE_FIGHT
--Player_car = M04_group.starting_vehicle.vehicle
-- Run the mission from the beginning
if current_checkpoint == M04_CHECKPOINT_START then
-- Checkpoint 1 - Mechanic Tutorial
M04_given_mechanic_cash = false
-- Pierce talks
delay(1.0)
audio_play_persona_line(M04_group.homies_001.members[1], "M04_Mission_Start_01")
m04_get_into_car()
Mechanic_Tutorial_Done = false
while not Mechanic_Tutorial_Done do
if not (character_is_in_vehicle(LOCAL_PLAYER) or character_is_in_vehicle(REMOTE_PLAYER)) and not Mechanic_Reached then
-- don't do anything until the player is in a car
m04_get_into_car()
else
-- If we are not at the mechanic, tell the player to go there
m04_go_to_mechanic()
if Mechanic_Reached then
-- if other conditions are true, tell player to use the mechanic
m04_use_mechanic()
end
end
end
--[[
if (character_is_in_vehicle(LOCAL_PLAYER)) then
m04_go_to_mechanic()
m04_use_mechanic()
else
m04_get_into_car()
end
]]--
-- Set to checkpoint 2
current_checkpoint = M04_CHECKPOINT_CLOTHES_TUTORIAL
mission_set_checkpoint(M04_CHECKPOINT_CLOTHES_TUTORIAL, false)
end
if current_checkpoint == M04_CHECKPOINT_CLOTHES_TUTORIAL then
-- M04_convo.go_to_ps.handle = audio_conversation_load(M04_convo.go_to_ps.name)
--Checkpoint 2 - Clothes Tutorial
--TODO: Replace this with real audio
-- delay(4.0)
-- message("Pierce: That place will work.", 4.0)
-- message("Pierce: Now that we're rolling in style, we'll need to dress the part.", 4.0)
-- message("Pierce: Let's go to Planet Saints and get some fresh threads.", 4.0)
-- audio_conversation_play(M04_convo.go_to_ps.handle)
-- audio_conversation_wait_for_end(M04_convo.go_to_ps.handle)
-- M04_convo.go_to_ps.handle = INVALID_CONVERSATION_HANDLE
-- m04_get_into_car()
m04_open_rj_door()
M04_given_clothes_cash = false
m04_go_to_clothes_store()
m04_buy_clothes()
-- Set to checkpoint 3
current_checkpoint = M04_CHECKPOINT_BRUTE_FIGHT
mission_set_checkpoint(M04_CHECKPOINT_BRUTE_FIGHT, true)
end
if current_checkpoint == M04_CHECKPOINT_BRUTE_FIGHT then
-- Checkpoint 3 - Brute Fight
m04_spawn_brute()
-- Setting this up as a thread to
thread_new("m04_force_notoriety")
-- Set checkpoint 4
current_checkpoint = M04_CHECKPOINT_NOTORIETY_REDUCTION
mission_set_checkpoint(M04_CHECKPOINT_NOTORIETY_REDUCTION, true)
end
if current_checkpoint == M04_CHECKPOINT_NOTORIETY_REDUCTION then
-- Checkpoint 4 - Notoriety Reduction
m04_return_to_safehouse()
-- message("Pierce: Well that was fun!", 4.0)
--delay(4.0)
end
-- Call mission success??
-- mission_end_success("m04", M04_CUTSCENE_MISSION_OUTRO)
mission_end_success("m04")
end
-- This is the primary function responsible for cleaning up the entire mission
-- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++)
--
function m04_cleanup()
-- Kill conversation thread
thread_kill(M04_thread_convo)
-- Cleanup groups
m04_cleanup_homies()
m04_cleanup_enemies()
-- Cleanup triggers
m04_clear_trigger(MECHANIC_TRIGGER)
m04_clear_trigger(MECHANIC_TRIGGER2)
m04_clear_trigger(CLOTHES_TRIGGER)
m04_clear_trigger(SAFEHOUSE_TRIGGER)
m04_clear_trigger(NOTORIETY_TRIGGER)
-- allow notoriety spawning again
notoriety_force_no_spawn("police", false)
notoriety_force_no_spawn("morningstar", false)
notoriety_force_no_spawn("deckers", false)
notoriety_set_can_decay(true)
notoriety_set("Morningstar", 0)
notoriety_set("deckers", 0)
notoriety_set("Police", 0)
-- Make sure traffic splines are all turned back on
m04_traffic_on()
on_vehicle_exit("", LOCAL_PLAYER)
cleanup_conversations(M04_convo)
on_purchase( "" )
-- Cleanup singalong
radio_clear_sing_along_track("MIX_Sublime___What_I_Got")
radio_set_sing_along_allowed_during_missions(false)
vehicle_clear_all_radio_locks()
-- tutorial_stop("notoriety_decreases")
end
-- Called when the mission has ended with success
-- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++)
--
function m04_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 m04_initialize(checkpoint)
-- Make sure the screen is completly faded out
mission_start_fade_out(0.0)
-- Set the mission author
set_mission_author("Anne Chilldon")
-- Common initialization
m04_initialize_common()
notoriety_force_no_spawn("police", true)
notoriety_force_no_spawn("morningstar", true)
notoriety_force_no_spawn("deckers", true)
-- Checkpoint specific initialization
m04_initialize_checkpoint(checkpoint)
-- Start fading in
mission_start_fade_in()
end
-- ***************************************************
-- m04_run Helper Functions
-- ***************************************************
-- Tell the player to get in a car and loop until he is in a vehicle
function m04_get_into_car()
-- Get into the car
-- Remove any waypoints and such
if (Mechanic_Tutorial_Done) then
m04_clear_trigger(CLOTHES_TRIGGER)
else
m04_clear_trigger(MECHANIC_TRIGGER)
m04_clear_trigger(MECHANIC_TRIGGER2)
Driving_to_mechanic = false
Using_mechanic = false
end
mission_waypoint_remove(SYNC_ALL)
-- Spawn car near them and mark on Minimap and in game
--marker_add(M04_group.starting_vehicle.vehicle, MINIMAP_ICON_USE, OI_ASSET_USE)
--ingame_effect_add_vehicle()?
-- Set objective to 'get into car'
objective_text(0, "m04_obj_get_car", "", "", SYNC_ALL, OI_ASSET_USE)
-- Make sure character is in vehicle
repeat
thread_yield()
until (character_is_in_vehicle(LOCAL_PLAYER) or character_is_in_vehicle(REMOTE_PLAYER))
--marker_remove(M04_group.starting_vehicle.vehicle)
--marker_remove(Player_car)
-- Player_car = get_char_vehicle_name(LOCAL_PLAYER)
-- Set objective to 'drive to mechanic'
--objective_text_clear(0)
end
-- If the player is not already at the mechanic, tell him to go to the mechanic
function m04_go_to_mechanic()
if Mechanic_Reached then
if(coop_is_active())then
-- We should be at the mechanic. make sure
if (get_dist(LOCAL_PLAYER, MECHANIC_TRIGGER2) < 20 or get_dist(REMOTE_PLAYER, MECHANIC_TRIGGER) < 20) then
-- ok, we are still here
return
end
else
-- We should be at the mechanic. make sure
if (get_dist(LOCAL_PLAYER, MECHANIC_TRIGGER2) < 20) then
-- ok, we are still here
return
end
end
-- Far enough away that we should be reminded to go back to the mechanic
Mechanic_Reached = false
Mechanic_breadcrumb_Reached = false
elseif Mechanic_breadcrumb_Reached then
if(coop_is_active())then
-- We should be close to the mechanic. make sure
if (get_dist(LOCAL_PLAYER, MECHANIC_TRIGGER) < 15 or get_dist(REMOTE_PLAYER, MECHANIC_TRIGGER) < 15) then
-- ok, we are still here
thread_yield()
return
end
else
-- We should be close to the mechanic. make sure
if (get_dist(LOCAL_PLAYER, MECHANIC_TRIGGER) < 15) then
-- ok, we are still here
thread_yield()
return
end
end
Mechanic_breadcrumb_Reached = false
m04_clear_trigger(MECHANIC_TRIGGER2)
Driving_to_mechanic = false
end
if not Driving_to_mechanic then
objective_text(0, "m04_obj_find_mechanic", "", "", SYNC_ALL, OI_ASSET_LOCATION)
-- Set markers and GPS to rimjobs
m04_set_trigger(MECHANIC_TRIGGER, "m04_reached_mechanic")
mission_waypoint_add(MECHANIC_TRIGGER)
Driving_to_mechanic = true
Using_mechanic = false
if not convo_1 then
M04_thread_convo = thread_new("m04_play_convo_1")
end
-- Drive to Mechanic
tutorial_unlock("store_intro_mechanic", true)
end
thread_yield()
end
function m04_mechanic_purchase_cb( store_type, player_name )
if (store_type ~= "vehicle-cust") then
return
end
on_purchase( "" )
Mechanic_Purchase_Done = true
end
function m04_use_mechanic()
-- Initialize store (mechanic store == 1)
if not Using_mechanic then
-- Set objective 'Use the mechanic to customize vehicle'
objective_text_clear(0)
objective_text(0, "m04_obj_use_mechanic", "", "", SYNC_ALL, OI_ASSET_USE)
Driving_to_mechanic = false
Using_mechanic = true
on_purchase( "m04_mechanic_purchase_cb" )
end
-- Wait till the player has purchased something (mechanic == 1)
if not Mechanic_Purchase_Done then
thread_yield()
-- run our tests again
return
end
-- Wait for player to get out of the interface before continuing
while (store_interface_is_active())do
thread_yield()
end
Mechanic_Tutorial_Done = true
end
function m04_go_to_clothes_store()
M04_convo.go_to_ps.handle = audio_conversation_load(M04_convo.go_to_ps.name)
audio_conversation_play(M04_convo.go_to_ps.handle)
-- Drive to Clothes Store
Clothes_Store_Reached = false
tutorial_unlock("store_intro_clothes", true)
-- Set objective to 'Drive to the Planet Saints store'
objective_text_clear(0)
objective_text(0, "m04_obj_find_clothes", "", "", SYNC_ALL, OI_ASSET_LOCATION)
-- Update minimap and GPS
m04_set_trigger(CLOTHES_TRIGGER, "m04_reached_clothes")
mission_waypoint_add("Planet_saints_gps")
audio_conversation_wait_for_end(M04_convo.go_to_ps.handle)
M04_convo.go_to_ps.handle = INVALID_CONVERSATION_HANDLE
-- if not group_is_loaded(M04_group.backup_vehicle.name) then
-- group_create(M04_group.backup_vehicle.name, true)
-- end
--release_to_world(M04_group.backup_vehicle.vehicle )
if not sing_along then
m04_play_sing_along()
end
-- Check to see if player is at store
repeat
thread_yield()
until (Clothes_Store_Reached)
vehicle_clear_all_radio_locks()
end
function m04_clothes_purchase_cb( store_type, player_name )
if (store_type ~= "clothing") then
return
end
on_purchase( "" )
Clothes_Purchase_Done = true
Clothes_Tutorial_Done = true
end
function m04_buy_clothes()
-- Buy Clothes
Clothes_Tutorial_Done = false
-- Set objective to 'Purchase a change of clothing.'
objective_text_clear(0)
objective_text(0, "m04_obj_buy_clothes", "", "", SYNC_ALL, OI_ASSET_USE)
-- Turn traffic splines in front of the store off
m04_traffic_off()
-- HACK: Check to see if player has left clothing interface
--while not(store_interface_is_active())do
-- thread_yield()
--end
-- Reset notoriety
notoriety_reset("police")
notoriety_reset("Morningstar")
notoriety_reset("Deckers")
if not M04_given_clothes_cash then
cash_add(M04_clothes_cash)
if(coop_is_active())then
cash_add(M04_clothes_cash, REMOTE_PLAYER)
end
M04_given_clothes_cash = true
end
on_purchase( "m04_clothes_purchase_cb" )
-- TODO: Clothing tutorial
-- TODO: Check to see if the player has purchased clothing
while not Clothes_Purchase_Done do
thread_yield()
end
-- TODO: Check to see if player has left clothing interface
--while (store_interface_is_active())do
-- thread_yield()
--end
-- TODO: Remove this when the stores go in
--tutorial_start("store_intro_clothes", 2000, true, true)
--message("This is where the clothing tutorial is going to go", 5.0)
-- delay(6.0)
repeat thread_yield() until (Clothes_Tutorial_Done)
--TODO: Replace this with real audio
-- Pierce - "Now we are styling"
--message("Pierce: Now we're styling", 4.0)
-- TODO: Check to see if player has left clothing interface
while (store_interface_is_active())do
thread_yield()
end
-- Set up so that the Morningstar is visible
-- Possibly move brute toward player
m04_unhide_brute_section()
m04_open_ps_doors()
--Pierce is allowed to be stupid again
npc_leash_remove(M04_group.homies_001.members[1])
end
function m04_spawn_morningstar()
--Process Morningstar
--delay(4.0)
-- Spawn 3 Morningstar goons
--group_create(M04_group.goons_001.name, true)
if not (group_is_loaded(M04_group.roadblock_001.name))then
group_create_hidden(M04_group.roadblock_001.name, true)
end
if not(group_is_loaded(M04_group.roadblock_002.name))then
group_create_hidden(M04_group.roadblock_002.name, true)
end
-- Deal with brute
-- Spawn Melee Brute
if not(group_is_loaded(M04_group.brute_001.name))then
group_create_hidden(M04_group.brute_001.name, true)
end
if not(group_is_loaded(M04_group.brute_002.name))then
group_create_hidden(M04_group.brute_002.name, true)
end
-- Set it so that the brute doesn't attack the player and Pierce
set_attack_player_flag(M04_group.brute_001.members[1], false)
set_attack_enemies_flag(M04_group.brute_001.members[1], false)
--while not (character_is_in_vehicle(M04_group.brute_001.members[1], M04_group.brute_001.vehicle))do
-- thread_yield()
--end
for i, guard in pairs (M04_group.roadblock_001.members)do
npc_combat_enable(guard, false)
end
for i, guard in pairs (M04_group.roadblock_002.members)do
npc_combat_enable(guard, false)
end
--TODO: Move goons into store
-- for i, guard in pairs(M04_group.goons_001.members) do
-- ai_do_scripted_move(guard, RETAIL_MARK[i])
-- end
-- Set objective
-- objective_text_clear(0)
-- objective_text(0, "m04_obj_kill_goons", "", "", SYNC_ALL, OI_ASSET_KILL)
-- Make sure the player kills all the goons
-- process_enemy_set(M04_group.goons_001.members)
end
function m04_spawn_morningstar_no_brute()
--Process Morningstar
--delay(4.0)
-- Spawn 3 Morningstar goons
--group_create(M04_group.goons_001.name, true)
if not (group_is_loaded(M04_group.roadblock_001.name))then
group_create_hidden(M04_group.roadblock_001.name, true)
end
if not(group_is_loaded(M04_group.roadblock_002.name))then
group_create_hidden(M04_group.roadblock_002.name, true)
end
end
function m04_spawn_brute()
-- Setup attack lines
for i, guard in pairs (M04_group.roadblock_001.members)do
on_attack_performed("m04_ms_attack_line_cb", guard)
end
for i, guard in pairs (M04_group.roadblock_002.members)do
on_attack_performed("m04_ms_attack_line_cb", guard)
end
--vehicle_chase(M04_group.brute_001.vehicle)
vehicle_pathfind_to(M04_group.brute_001.vehicle, Brute_Path, true)
-- ai_do_scripted_move(M04_group.brute_001.members[1], RETAIL_MARK[1])
-- Pierce - What the fuck is that thing?
-- Player - It looks angry
-- Set objective to 'Kill the Brute'
objective_text_clear(0)
objective_text(0, "m04_obj_kill_brute", "", "", SYNC_ALL, OI_ASSET_KILL)
for i, guard in pairs (M04_group.roadblock_001.members)do
npc_combat_enable(guard, true)
end
for i, guard in pairs (M04_group.roadblock_002.members)do
npc_combat_enable(guard, true)
end
-- Set it so that the brute attacks the player and Pierce
set_attack_player_flag(M04_group.brute_001.members[1], true)
set_attack_enemies_flag(M04_group.brute_001.members[1], true)
-- Make sure the brute gets out of the truck
vehicle_exit(M04_group.brute_001.members[1], false)
vehicle_exit(M04_group.brute_002.members[1], false)
-- Make sure the player kills the brute
--process_enemy_set(M04_group.brute_001.members)
thread_new("m04_convo", M04_convo.exit_ps, 0.0)
must_kill_setup(M04_group.brute_001.members)
end
function m04_force_notoriety()
M04_convo.escape.handle = audio_conversation_load(M04_convo.escape.name)
--Force notoriety
Notoriety_Reached = false
if (group_is_loaded(M04_group.roadblock_001.name))then
for i, guard in pairs(M04_group.roadblock_001.members)do
character_set_persona(guard, "gang normal")
set_team(guard, "Morningstar")
end
end
if(group_is_loaded(M04_group.roadblock_002.name))then
for i, guard in pairs(M04_group.roadblock_002.members)do
character_set_persona(guard, "gang normal")
set_team(guard, "Morningstar")
end
end
if not (group_is_loaded(M04_group.notoriety_001.name)) then
group_create(M04_group.notoriety_001.name, true)
end
vehicle_enter_teleport(M04_group.notoriety_001.members[1], M04_group.notoriety_001.vehicle, 0)
vehicle_enter_teleport(M04_group.notoriety_001.members[2], M04_group.notoriety_001.vehicle, 1)
-- if not (group_is_loaded(M04_group.notoriety_002.name))then
-- group_create(M04_group.notoriety_002.name, true)
-- end
-- vehicle_enter_teleport(M04_group.notoriety_002.members[1], M04_group.notoriety_002.vehicle, 0)
-- vehicle_enter_teleport(M04_group.notoriety_002.members[2], M04_group.notoriety_002.vehicle, 1)
if not (group_is_loaded(M04_group.notoriety_003.name))then
group_create(M04_group.notoriety_003.name, true)
end
vehicle_enter_teleport(M04_group.notoriety_003.members[1], M04_group.notoriety_003.vehicle, 0)
vehicle_enter_teleport(M04_group.notoriety_003.members[2], M04_group.notoriety_003.vehicle, 1)
-- if not(group_is_loaded(M04_group.notoriety_004.name))then
-- group_create(M04_group.notoriety_004.name, true)
-- end
-- vehicle_enter_teleport(M04_group.notoriety_004.members[1], M04_group.notoriety_004.vehicle, 0)
-- vehicle_enter_teleport(M04_group.notoriety_004.members[2], M04_group.notoriety_004.vehicle, 1)
-- Have notoriety groups chase the player
vehicle_chase(M04_group.notoriety_001.vehicle)
vehicle_chase(M04_group.notoriety_003.vehicle)
-- If another conversation is already playing, wait for it to finish
if(convo_is_playing)then
repeat
thread_yield()
until (not convo_is_playing)
end
convo_is_playing = true
audio_conversation_play(M04_convo.escape.handle)
-- Turn traffic splines back on
m04_traffic_on()
-- Turn off notoriety decay
notoriety_set_can_decay(false)
notoriety_force_no_spawn("morningstar", false)
notoriety_force_no_spawn("deckers", false)
-- Set notoriety to 2 stars for Morningstar
notoriety_set("Morningstar", 2)
m04_set_invisible_trigger(NOTORIETY_TRIGGER, "m04_reached_notoriety")
audio_conversation_wait_for_end(M04_convo.escape.handle)
convo_is_playing = false
M04_convo.escape.handle = INVALID_CONVERSATION_HANDLE
end
function m04_return_to_safehouse()
-- Pierce - "They know it's you, they'll be coming until we get somewhere safe. Let's get back to the safe house."
Safehouse_Reached = false
-- Update minimap and GPS
m04_set_trigger(SAFEHOUSE_TRIGGER, "m04_reached_safehouse")
mission_waypoint_add(SAFEHOUSE_TRIGGER)
-- Set objective to 'Return to safehouse to remove notoriety'
objective_text_clear(0)
objective_text(0, "m04_obj_return_home", "", "", SYNC_ALL, OI_ASSET_LOCATION)
-- Notoriety tutorial
--message("This is where the notoriety tutorial is going to go", 5.0)
--tutorial_start("notoriety_decreases", 5000, true, true)
-- Convo w/ Pierce about brute
if not convo_2 then
M04_thread_convo = thread_new("m04_play_convo_2")
end
while not Notoriety_Reached do
thread_yield()
end
-- Check to see if at safehouse
repeat
thread_yield()
until (Safehouse_Reached)
notoriety_set("Morningstar", 0)
notoriety_set("deckers", 0)
notoriety_set("Police", 0)
end
function m04_play_convo_1()
convo_1 = true
M04_convo.drive_to_rj.handle = audio_conversation_load(M04_convo.drive_to_rj.name)
M04_convo.drive_to_ps.handle = audio_conversation_load(M04_convo.drive_to_ps.name)
delay(5.0)
while not(character_is_in_vehicle(LOCAL_PLAYER) and character_is_in_vehicle(M04_group.homies_001.members[1])) do
thread_yield()
end
audio_conversation_play(M04_convo.drive_to_rj.handle)
-- message("Pierce and player have conversation about Shaundi and Gat", 15.0)
audio_conversation_wait_for_end(M04_convo.drive_to_rj.handle)
delay(5.0)
audio_conversation_play(M04_convo.drive_to_ps.handle)
audio_conversation_wait_for_end(M04_convo.drive_to_ps.handle)
M04_convo.drive_to_ps.handle = INVALID_CONVERSATION_HANDLE
M04_convo.drive_to_rj.handle = INVALID_CONVERSATION_HANDLE
end
function m04_play_convo_2()
while not(character_is_in_vehicle(LOCAL_PLAYER) and character_is_in_vehicle(M04_group.homies_001.members[1])) do
thread_yield()
end
M04_convo.wtf.handle = audio_conversation_load(M04_convo.wtf.name)
-- Set up followers
if not (group_is_loaded(M04_group.notoriety_002.name))then
group_create(M04_group.notoriety_002.name, true)
end
vehicle_enter_teleport(M04_group.notoriety_002.members[1], M04_group.notoriety_002.vehicle, 0)
vehicle_enter_teleport(M04_group.notoriety_002.members[2], M04_group.notoriety_002.vehicle, 1)
vehicle_chase(M04_group.notoriety_002.vehicle) --, LOCAL_PLAYER, false)
if not(group_is_loaded(M04_group.notoriety_004.name))then
group_create(M04_group.notoriety_004.name, true)
end
vehicle_enter_teleport(M04_group.notoriety_004.members[1], M04_group.notoriety_004.vehicle, 0)
vehicle_enter_teleport(M04_group.notoriety_004.members[2], M04_group.notoriety_004.vehicle, 1)
vehicle_chase(M04_group.notoriety_004.vehicle) --, LOCAL_PLAYER, false)
-- If another conversation is already playing, wait for it to finish
if(convo_is_playing)then
repeat
thread_yield()
until (not convo_is_playing)
end
convo_is_playing = true
audio_conversation_play(M04_convo.wtf.handle)
audio_conversation_wait_for_end(M04_convo.wtf.handle)
convo_is_playing = false
M04_convo.wtf.handle = INVALID_CONVERSATION_HANDLE
convo_2 = true
end
function m04_play_sing_along()
-- TODO: Have Pierce and player sing along w/ radio
local test = -1
delay(2.0)
M04_convo.sing_intro.handle = audio_conversation_load(M04_convo.sing_intro.name)
while not (character_is_in_vehicle(LOCAL_PLAYER))do
if Clothes_Store_Reached then
return
end
thread_yield()
end
test = radio_get_station(get_char_vehicle_name(LOCAL_PLAYER))
audio_conversation_play(M04_convo.sing_intro.handle)
vehicle_set_radio_controls_locked(get_char_vehicle_name(LOCAL_PLAYER), true)
radio_set_station(LOCAL_PLAYER, 4)
delay(2.0)
radio_set_station(LOCAL_PLAYER, 6)
delay(2.0)
radio_set_station(LOCAL_PLAYER, 10)
delay(2.0)
test = radio_get_station(LOCAL_PLAYER)
audio_conversation_wait_for_end(M04_convo.sing_intro.handle)
M04_convo.sing_intro.handle = INVALID_CONVERSATION_HANDLE
-- Sing alongs are normally not allowed during missions, override that.
-- TODO: We'll need to turn this back off at the end of the mission or
-- after the sing along has ended.
radio_set_sing_along_allowed_during_missions(true)
-- Enable the player's sing along for this track during the mission.
-- TODO: Call radio_clear_sing_along_track to clear this when the mission
-- ends so that we don't play the sing along during regular gameplay.
radio_set_sing_along_track("MIX_Sublime___What_I_Got", "M04_SINGALONG_WM_PLAYER")
delay(7.0)
sing_along = true
end
-- ***************************************************
-- m04_initialize Helper Functions
-- ***************************************************
-- Handle any common initialization
--
function m04_initialize_common()
--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]--
end
-- Checkpoint specific initialization
--
-- checkpoint: The checkpoint to be initialized
function m04_initialize_checkpoint(checkpoint)
if (checkpoint == M04_CHECKPOINT_START) then
--[[ INSERT ANY INITIALIZATION CODE FOR STARTING THE MISSION AT THE BEGINNING ]]--
-- Spawn Pierce and player outside of ShaundiBFApartment
-- Add Pierce as homie
m04_setup_crew()
end
if (checkpoint == M04_CHECKPOINT_CLOTHES_TUTORIAL) then
teleport_coop(M04_PLAYER_CHECKPOINT_2[1], M04_COOP_CHECKPOINT_2[1], true)
if not group_is_loaded(M04_group.backup_vehicle.name) then
group_create(M04_group.backup_vehicle.name, true)
end
m04_setup_crew()
teleport(M04_group.homies_001.members[1], M04_P_TELEPORT_2[1])
teleport_vehicle(M04_group.backup_vehicle.vehicle, M04_VEHICLE_CHECKPOINT_2[1])
release_to_world(M04_group.backup_vehicle.vehicle )
Mechanic_Tutorial_Done = true
end
if (checkpoint == M04_CHECKPOINT_BRUTE_FIGHT) then
teleport_coop(M04_PLAYER_CHECKPOINT_3[1], M04_COOP_CHECKPOINT_3[1], true)
m04_setup_crew()
teleport(M04_group.homies_001.members[1], M04_P_TELEPORT_3[1])
teleport_vehicle(M04_group.starting_vehicle.vehicle, M04_VEHICLE_CHECKPOINT_3[1])
Mechanic_Tutorial_Done = true
m04_spawn_morningstar()
m04_traffic_off()
m04_unhide_brute_section()
m04_open_ps_doors()
-- if not group_is_loaded(M04_group.backup_vehicle.name) then
-- group_create(M04_group.backup_vehicle.name, true)
-- end
end
if (checkpoint == M04_CHECKPOINT_NOTORIETY_REDUCTION) then
teleport_coop(M04_PLAYER_CHECKPOINT_4[1], M04_COOP_CHECKPOINT_4[1], true)
m04_spawn_morningstar_no_brute()
m04_setup_crew()
m04_force_notoriety()
teleport(M04_group.homies_001.members[1], M04_P_TELEPORT_4[1])
teleport_vehicle(M04_group.starting_vehicle.vehicle, M04_VEHICLE_CHECKPOINT_3[1])
Mechanic_Tutorial_Done = true
-- if not group_is_loaded(M04_group.backup_vehicle.name) then
-- group_create(M04_group.backup_vehicle.name, true)
-- end
group_show(M04_group.roadblock_001.name)
group_show(M04_group.roadblock_002.name)
end
end
-- ***************************************************
-- Miscellaneous m04 Helper Funcrtions
-- ***************************************************
-- Setting up homies
function m04_setup_crew()
-- Spawn Pierce and the car, add Pierce as a homie
if not group_is_loaded(M04_group.homies_001.name) then
group_create(M04_group.homies_001.name, true)
end
if not group_is_loaded(M04_group.starting_vehicle.name) then
group_create(M04_group.starting_vehicle.name, true)
end
release_to_world(M04_group.starting_vehicle.name)
party_add(M04_group.homies_001.members[1], LOCAL_PLAYER)
follower_set_can_abandon(M04_group.homies_001.members[1], true)
on_death("m04_failure_pierce_died", M04_group.homies_001.members[1])
on_dismiss("m04_failure_abandon_pierce", M04_group.homies_001.members[1])
-- on_vehicle_destroyed("m04_failure_car_died", M04_group.starting_vehicle.vehicle)
end
-- CLEANUP FUNCTIONS\
function m04_cleanup_homies()
if group_is_loaded(M04_group.homies_001.name) then
group_destroy(M04_group.homies_001.name)
end
--release_to_world(M04_group.starting_vehicle.vehicle )
--release_to_world(M04_group.backup_vehicle.vehicle )
if group_is_loaded(M04_group.starting_vehicle.name) then
group_destroy(M04_group.starting_vehicle.name)
end
-- if group_is_loaded(M04_group.backup_vehicle.name) then
-- group_destroy(M04_group.backup_vehicle.name)
-- end
on_death("", M04_group.homies_001.members[1])
on_dismiss("", M04_group.homies_001.members[1])
on_vehicle_destroyed("", M04_group.starting_vehicle.vehicle)
end
function m04_cleanup_enemies()
if group_is_loaded(M04_group.goons_001.name) then
-- Loop over each guy in the group, and make sure their markers have been removed
for i, enemy in pairs(M04_group.goons_001.members) do
if (character_is_dead(enemy) == false) then
marker_remove(enemy)
end
end
-- Cleanup the group
group_destroy(M04_group.goons_001.name)
end
if group_is_loaded(M04_group.brute_001.name) then
-- Loop over each guy in the group, and make sure their markers have been removed
must_kill_cleanup(M04_group.brute_001.members)
-- Cleanup the group
group_destroy(M04_group.brute_001.name)
end
if group_is_loaded(M04_group.brute_002.name) then
-- Loop over each guy in the group, and make sure their markers have been removed
for i, enemy in pairs(M04_group.brute_002.members) do
if (character_is_dead(enemy) == false) then
marker_remove(enemy)
end
end
-- Cleanup the group
group_destroy(M04_group.brute_002.name)
end
if group_is_loaded(M04_group.roadblock_001.name) then
-- Loop over each guy in the group, and make sure their markers have been removed
for i, enemy in pairs(M04_group.roadblock_001.members) do
on_attack_performed("", enemy)
if (character_is_dead(enemy) == false) then
marker_remove(enemy)
end
end
-- Cleanup the group
group_destroy(M04_group.roadblock_001.name)
end
if group_is_loaded(M04_group.roadblock_002.name) then
-- Loop over each guy in the group, and make sure their markers have been removed
for i, enemy in pairs(M04_group.roadblock_002.members) do
on_attack_performed("", enemy)
if (character_is_dead(enemy) == false) then
marker_remove(enemy)
end
end
-- Cleanup the group
group_destroy(M04_group.roadblock_002.name)
end
if group_is_loaded(M04_group.notoriety_001.name)then
group_destroy(M04_group.notoriety_001.name)
end
if group_is_loaded(M04_group.notoriety_002.name)then
group_destroy(M04_group.notoriety_002.name)
end
if group_is_loaded(M04_group.notoriety_003.name)then
group_destroy(M04_group.notoriety_003.name)
end
if group_is_loaded(M04_group.notoriety_004.name)then
group_destroy(M04_group.notoriety_004.name)
end
end
-- TRIGGER FUNCTIONS
function m04_set_trigger(trigger, trigger_callback)
trigger_enable(trigger, true)
marker_add_trigger(trigger, MINIMAP_ICON_LOCATION, INGAME_EFFECT_CHECKPOINT, OI_ASSET_LOCATION, OI_FLAGS_LOCATION, SYNC_ALL)
on_trigger(trigger_callback, trigger)
end
function m04_clear_trigger(trigger)
on_trigger("", trigger)
trigger_enable(trigger, false)
marker_remove_trigger(trigger, SYNC_ALL)
mission_waypoint_remove()
end
function m04_set_invisible_trigger(trigger, trigger_callback)
trigger_enable(trigger, true)
on_trigger(trigger_callback, trigger)
end
function m04_clear_invisible_trigger(trigger)
on_trigger("", trigger)
trigger_enable(trigger, false)
end
function must_kill_setup(enemy_table)
for i, enemy in pairs(enemy_table) do
if (character_is_dead(enemy) == false) then
on_death("m04_enemy_killed", enemy)
marker_add(enemy, MINIMAP_ICON_KILL, OI_ASSET_KILL_FULL, OI_FLAGS_DEFAULT, SYNC_ALL)
Num_guys_to_kill = Num_guys_to_kill + 1
end
end
thread_new("m04_convo", M04_convo.brute_combat, 10.0)
while (Num_guys_to_kill > 0) do
thread_yield()
end
end
function must_kill_cleanup(enemy_table)
-- Clear enemy callbacks
for i, enemy in pairs(enemy_table) do
-- cleanup the callback
on_death("", enemy)
marker_remove(enemy, SYNC_ALL)
end
end
-- *************************
--
-- Callback functions
--
-- *************************
-- End the mission if Pierce dies
function m04_failure_pierce_died()
mission_end_failure("m04", M04_FAILURE_PIERCE_DIED)
end
-- End the mission if Pierce is abandoned
function m04_failure_abandon_pierce()
mission_end_failure("m04", M04_FAILURE_ABANDON_PIERCE)
end
-- End the mission if the car explodes before showing up at the mechanic
function m04_failure_car_died()
if not Mechanic_Tutorial_Done then
mission_end_failure("m04", M04_FAILURE_CAR_DESTROYED)
end
end
function m04_reached_mechanic()
Mechanic_breadcrumb_Reached = true
m04_clear_trigger(MECHANIC_TRIGGER)
mission_waypoint_remove(SYNC_ALL)
m04_set_trigger(MECHANIC_TRIGGER2, "m04_reached_mechanic2")
end
function m04_reached_mechanic2()
Mechanic_Reached = true
-- Reset the notoriety
-- Reset notoriety
notoriety_reset("police")
notoriety_reset("Morningstar")
-- Give the player some cash to play with at the store (check to add for coop too)
if not M04_given_mechanic_cash then
cash_add(M04_mechanic_cash)
if(coop_is_active())then
cash_add(M04_mechanic_cash, REMOTE_PLAYER)
end
M04_given_mechanic_cash = true
end
m04_clear_trigger(MECHANIC_TRIGGER2)
mission_waypoint_remove(SYNC_ALL)
end
function m04_reached_clothes()
m04_clear_trigger(CLOTHES_TRIGGER)
mission_waypoint_remove(SYNC_ALL)
m04_set_trigger(CLOTHES_TRIGGER2, "m04_reached_clothes2")
end
function m04_reached_clothes2()
Clothes_Store_Reached = true
m04_clear_trigger(CLOTHES_TRIGGER2)
mission_waypoint_remove(SYNC_ALL)
fade_out(0.5)
fade_out_block()
teleport_coop(M04_PLAYER_STORE[1], M04_COOP_STORE[1], true)
teleport(M04_group.homies_001.members[1], M04_P_STORE[1])
hud_push_screen("store_common", SYNC_ALL)
hud_push_screen("store_clothing", SYNC_ALL)
-- Leash Pierce to the store so he stops doing stupid shit
npc_leash_to_nav(M04_group.homies_001.members[1], M04_P_STORE[1], 3)
m04_spawn_morningstar()
-- m04_open_ps_doors()
cleanup_conversations(M04_convo)
-- Kill conversation thread
thread_kill(M04_thread_convo)
M04_thread_convo = INVALID_CONVERSATION_HANDLE
fade_in(0.5)
fade_in_block()
end
function m04_reached_safehouse()
m04_clear_trigger(SAFEHOUSE_TRIGGER)
mission_waypoint_remove(SYNC_ALL)
tutorial_start("notoriety_decreases", 0, true, true)
m04_set_trigger(SAFEHOUSE_TRIGGER2, "m04_reached_safehouse2")
end
function m04_reached_safehouse2()
Safehouse_Reached = true
m04_clear_trigger(SAFEHOUSE_TRIGGER2)
mission_waypoint_remove(SYNC_ALL)
end
function m04_reached_notoriety()
Notoriety_Reached = true
m04_clear_invisible_trigger(NOTORIETY_TRIGGER)
notoriety_set_can_decay(true)
notoriety_force_no_spawn("morningstar", true)
notoriety_force_no_spawn("deckers", true)
end
-- Turn off traffic splines in the traffic trigger
function m04_traffic_off()
set_traffic_density(0.1)
set_ped_density(0.1)
sidewalk_disable_nodes(TRAFFIC_TRIGGER, true)
traffic_disable_lanes(TRAFFIC_TRIGGER, true)
set_traffic_density(1)
set_ped_density(1)
end
-- Turn traffic back on
function m04_traffic_on()
sidewalk_disable_nodes(TRAFFIC_TRIGGER, false)
traffic_disable_lanes(TRAFFIC_TRIGGER, false)
end
function m04_enemy_killed(enemy)
on_death("",enemy)
marker_remove(enemy, SYNC_ALL)
Num_guys_to_kill = Num_guys_to_kill - 1
end
-- Have Morningstar say something
--
-- name: (string) name of character
-- weapon: (string) name of weapon
-- attack: (string) type of attack performed
--
function m04_ms_attack_line_cb(name, weapon, attack)
local situation = "M04_Attack"
-- don't play this if we have done this recently
if(not thread_check_done(M04_thread_attack_line_timer))then
return
end
-- start timer
M04_thread_attack_line_timer = thread_new("delay", M04_Attack_Line_Time)
-- Play situation
audio_play_persona_line(name, situation)
end
-- Unhide everyone in the roadblock/brute section
--
--
function m04_unhide_brute_section()
vehicle_enter_teleport(M04_group.brute_002.members[1], M04_group.brute_001.vehicle, 0)
vehicle_enter_teleport(M04_group.brute_001.members[1], M04_group.brute_001.vehicle)
group_show(M04_group.roadblock_001.name)
group_show(M04_group.roadblock_002.name)
group_show(M04_group.brute_001.name)
group_show(M04_group.brute_002.name)
end
-- Open the door to planet saints
--
--
function m04_open_ps_doors()
door_open("sm_psdoor1")
door_open("sm_psdoor2")
end
-- Open the door to Rim Jobs
--
--
function m04_open_rj_door()
door_open("sm_rjdoor")
end
-- *************************
--
-- Thread functions
--
-- *************************
-- Function to make life easier when calling conversations
--
-- convo: Conversation to play
-- delay_time: (float) length of delay before playing conversation
--
function m04_convo(convo, delay_time)
if(convo == nil)then
return
end
-- If another conversation is already playing, wait for it to finish
if(convo_is_playing)then
repeat
thread_yield()
until (not convo_is_playing)
end
convo_is_playing = true
-- Load the conversation
convo.handle = audio_conversation_load(convo.name)
-- make sure we shouldn't wait for the convo to start
if(delay_time)then
delay(delay_time)
end
-- Play the conversation
audio_conversation_play(convo.handle)
delay(1)
-- Wait for the conversation to end
audio_conversation_wait_for_end(convo.handle)
convo.handle = INVALID_CONVERSATION_HANDLE
convo_is_playing = false
end