--[[ USING THE MISSION START TEMPLATE
1. Read "SR3 Mission Scripting Standards" if you haven't already.
2. Save this file as "mmStompTutorial.lua" in the missions directory.
3. Replace "mmStompTutorial" with the name of your mission (must use the same name as your mission start node).
3a. Replace "mmStompTutorial" with the capitalized name of your mission
4. Replace "3-3-2014" with today's date.
5. Replace "Arturo Mata" with your name.
6. Replace "Ultor" 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 "" with the second checkpoint name (first is named start)
9. Replace "" 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!!!!c
11. Remove these instructions. You're on your own now!
]]--
--[[
mmStompTutorial.lua
SR3 Mission Script
DATE: 3-3-2014
AUTHOR: Arturo Mata
]]--
-- Debug flags --
-- Tweakable Parameters --
--------------------------------------------------------------------------------------------------
--[[ GROUPS ]]--
--------------------------------------------------------------------------------------------------
mmStompTutorial_group =
{
--[[ startup GROUPS ]]--
--[[ Ultor GROUPS ]]--
wave_1 =
{
name = "wave_1",
members =
{
"Demon_Grunt<001>",
},
coop_name = "coop_wave_1",
coop_only_members =
{
"Demon_Grunt<002>",
},
damage_threads = { },
},
wave_2 =
{
name = "wave_2",
members =
{
"Demon_Grunt<003>",
"Demon_Grunt<004>",
"Demon_Grunt<005>",
},
coop_name = "coop_wave_2",
coop_only_members =
{
"Demon_Grunt<006>",
"Demon_Grunt<007>",
"Demon_Grunt<008>",
},
damage_threads = { },
},
wave_3 =
{
name = "wave_3",
members =
{
"Demon_Grunt<009>",
"Demon_Grunt<010>",
"Demon_Grunt<011>",
"Demon_Grunt<012>",
"Demon_Grunt<013>",
"Demon_Grunt<014>",
},
coop_name = "coop_wave_3",
coop_only_members =
{
"Demon_Grunt<015>",
"Demon_Grunt<016>",
"Demon_Grunt<017>",
"Demon_Grunt<018>",
"Demon_Grunt<019>",
"Demon_Grunt<020>",
},
damage_threads = { },
},
wave_4 =
{
name = "wave_4",
members =
{
"Imp<001>",
"Imp<002>",
"Imp<003>",
"Imp<004>",
"Imp<005>",
"Imp<006>",
"Imp<007>",
"Imp<008>",
},
coop_name = "coop_wave_4",
coop_only_members =
{
"Imp<009>",
"Imp<010>",
--"Imp<011>",
--"Imp<012>",
--"Imp<013>",
--"Imp<014>",
--"Imp<015>",
--"Imp<016>",
},
damage_threads = { },
},
wave_5 =
{
name = "wave_5",
members =
{
"Dark_Inciter<001>",
},
destination_1 = "Dark_Inciter_Dest<001>",
destination_2 = "Dark_Inciter_Dest<002>",
coop_name = "coop_wave_5",
coop_only_members =
{
"Dark_Inciter<002>",
},
damage_threads = { },
},
--[[ GROUPS ]]--
}
mmStompTutorial_respawn_points =
{
-- wave_1
[ "Demon_Grunt<001>" ] = "Respawn_Navpoint<001>",
[ "Demon_Grunt<002>" ] = "Respawn_Navpoint<002>",
-- wave_2
[ "Demon_Grunt<003>" ] = "Respawn_Navpoint<003>",
[ "Demon_Grunt<004>" ] = "Respawn_Navpoint<004>",
[ "Demon_Grunt<005>" ] = "Respawn_Navpoint<005>",
[ "Demon_Grunt<006>" ] = "Respawn_Navpoint<006>",
[ "Demon_Grunt<007>" ] = "Respawn_Navpoint<007>",
[ "Demon_Grunt<008>" ] = "Respawn_Navpoint<008>",
-- wave 3
[ "Demon_Grunt<009>" ] = "Respawn_Navpoint<009>",
[ "Demon_Grunt<010>" ] = "Respawn_Navpoint<010>",
[ "Demon_Grunt<011>" ] = "Respawn_Navpoint<011>",
[ "Demon_Grunt<012>" ] = "Respawn_Navpoint<012>",
[ "Demon_Grunt<013>" ] = "Respawn_Navpoint<013>",
[ "Demon_Grunt<014>" ] = "Respawn_Navpoint<014>",
[ "Demon_Grunt<015>" ] = "Respawn_Navpoint<015>",
[ "Demon_Grunt<016>" ] = "Respawn_Navpoint<016>",
[ "Demon_Grunt<017>" ] = "Respawn_Navpoint<017>",
[ "Demon_Grunt<018>" ] = "Respawn_Navpoint<018>",
[ "Demon_Grunt<019>" ] = "Respawn_Navpoint<019>",
[ "Demon_Grunt<020>" ] = "Respawn_Navpoint<020>",
-- wave_4
[ "Imp<001>" ] = "Respawn_Nav_Imp<001>",
[ "Imp<002>" ] = "Respawn_Nav_Imp<002>",
[ "Imp<003>" ] = "Respawn_Nav_Imp<003>",
[ "Imp<004>" ] = "Respawn_Nav_Imp<004>",
[ "Imp<005>" ] = "Respawn_Nav_Imp<005>",
[ "Imp<006>" ] = "Respawn_Nav_Imp<006>",
[ "Imp<007>" ] = "Respawn_Nav_Imp<007>",
[ "Imp<008>" ] = "Respawn_Nav_Imp<008>",
[ "Imp<009>" ] = "Respawn_Nav_Imp<009>",
[ "Imp<010>" ] = "Respawn_Nav_Imp<010>",
--[ "Imp<011>" ] = "Respawn_Nav_Imp<011>",
--[ "Imp<012>" ] = "Respawn_Nav_Imp<012>",
--[ "Imp<013>" ] = "Respawn_Nav_Imp<013>",
--[ "Imp<014>" ] = "Respawn_Nav_Imp<014>",
--[ "Imp<015>" ] = "Respawn_Nav_Imp<015>",
--[ "Imp<016>" ] = "Respawn_Nav_Imp<016>",
-- wave_5
[ "Dark_Inciter<001>" ] = "Respawn_Nav_inciter<001>",
[ "Dark_Inciter<002>" ] = "Respawn_Nav_inciter<002>",
}
mmStompTutorial_killed_by_stomp_damage =
{
-- wave_1
[ "Demon_Grunt<001>" ] = false,
[ "Demon_Grunt<002>" ] = false,
-- wave_2
[ "Demon_Grunt<003>" ] = false,
[ "Demon_Grunt<004>" ] = false,
[ "Demon_Grunt<005>" ] = false,
[ "Demon_Grunt<006>" ] = false,
[ "Demon_Grunt<007>" ] = false,
[ "Demon_Grunt<008>" ] = false,
-- wave 3
[ "Demon_Grunt<009>" ] = false,
[ "Demon_Grunt<010>" ] = false,
[ "Demon_Grunt<011>" ] = false,
[ "Demon_Grunt<012>" ] = false,
[ "Demon_Grunt<013>" ] = false,
[ "Demon_Grunt<014>" ] = false,
[ "Demon_Grunt<015>" ] = false,
[ "Demon_Grunt<016>" ] = false,
[ "Demon_Grunt<017>" ] = false,
[ "Demon_Grunt<018>" ] = false,
[ "Demon_Grunt<019>" ] = false,
[ "Demon_Grunt<020>" ] = false,
-- wave_4
[ "Imp<001>" ] = false,
[ "Imp<002>" ] = false,
[ "Imp<003>" ] = false,
[ "Imp<004>" ] = false,
[ "Imp<005>" ] = false,
[ "Imp<006>" ] = false,
[ "Imp<007>" ] = false,
[ "Imp<008>" ] = false,
[ "Imp<009>" ] = false,
[ "Imp<010>" ] = false,
-- [ "Imp<011>" ] = false,
--[ "Imp<012>" ] = false,
--[ "Imp<013>" ] = false,
--[ "Imp<014>" ] = false,
--[ "Imp<015>" ] = false,
--[ "Imp<016>" ] = false,
}
--------------------------------------------------------------------------------------------------
--[[ THREADS ]]--
--------------------------------------------------------------------------------------------------
mmStompTutorial_thread = {
-- = INVALID_THREAD_HANDLE,
}
mmStompTutorial_effects = {
respawn_effect = "Vfx Hell Teleport 01<001>",
}
--------------------------------------------------------------------------------------------------
--[[ CHECKPOINTS ]]--
--------------------------------------------------------------------------------------------------
mmStompTutorial_checkpoint = {
{
name = MISSION_START_CHECKPOINT, -- First Checkpoint (fcp)
init = "mmStompTutorial_fcp_init", -- init(bool mission_restart)
run = "mmStompTutorial_fcp_run", -- run()
cleanup = "mmStompTutorial_fcp_cleanup", -- cleanup(bool mission_exit) (+++MUST RETURN IMMEDIATELY+++)
--next_checkpoint = "mmStompTutorial_",
next_checkpoint = nil,
host_start = "Player_start_nav_host",
client_start = "Player_start_nav_client",
p1_car_nav = "",
p2_car_nav = "",
start_groups = { },
cp_only_groups = { },
},
}
--------------------------------------------------------------------------------------------------
--[[ CUTSCENES ]]--
mmStompTutorial_scene = {
intro = "",
outro = ""
}
--------------------------------------------------------------------------------------------------
--[[ CONVERSATIONS ]]--
--------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------mmStomp_persona
mmStomp_persona =
{
shakespeare = {
persona_name = "SHAKESPEARE",
persona_id = INVALID_PERSONA_HANDLE
},
}
mmStompTutorial_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)
},]]
-- Welcome back to the Inferno room. Lets get back to business and try out your new Supernatural ability, Force Stomp. Force Stomp sends anyone or anything nearby flying in the air. Try it out by stomping near these demons.
intro = {
name = "mmstomptutorial_intro",
player_talks = 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,
},
-- That's some nice stomping right there! Let's keep it up. Try it out on a few more targets!
more_enemies = {
name = "mmStompTutorial_wave",
player_talks = 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,
},
-- Now for a challenge. See if you can stomp these imps.
more_imps = {
name = "mmStompTutorial_imps",
player_talks = 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,
},
-- Blast�powers�also�deactivate�enemy�shields.�Use�the�blast�to�take�out�the�shield�on�a�Dark�Inciter�then�give�it�a�face�full�of�bullets!
inciter = {
name = "mmStompTutorial_inciter",
player_talks = 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,
},
-- No, no, no. I know you love violence, but this excersice is about using your feet, not using your fists.
chide = {
name = "mmStompTutorial_chide",
player_talks = 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,
},
-- Success! I'm impressed how fast you got the hang of that.
success = {
name = "mmStompTutorial_success",
player_talks = 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,
},
}
mmStompTutorial_convo_queue = {
--[[start_drive_queue = {
{ delay = 2.0, convo = mmStompTutorial_convo.goto_Ultor },
{ delay = 4.0, convo = mmStompTutorial_convo.goto_Ultor2 },
{ delay = 3.0, convo = mmStompTutorial_convo.goto_Ultor3 },
{ delay = 5.0, convo = mmStompTutorial_convo.goto_Ultor4 }
},
]]--
}
--------------------------------------------------------------------------------------------------
--[[ TRIGGERS ]]--
--------------------------------------------------------------------------------------------------
mmStompTutorial_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 = "mmStompTutorial_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 = mmStompTutorial_convo.convo_name -- play a conversation
-- (optional)next_trigger = "next_trigger_name" sets up next trigger when triggered (breadcrumbs)
--},
--[[ Ultor TRIGGERS ]]--
lava_trigger = {
name = "lava_trigger",
callback = "mmTutorial_lava_trigger_callback",
},
--[[ TRIGGERS ]]--
}
--------------------------------------------------------------------------------------------------
--[[ INTERROGATION DATA ]]--
--------------------------------------------------------------------------------------------------
--mmStompTutorial_interrogate = {
-- leader = {
-- target = mmStompTutorial_group.friendly_fire.owner,
-- persona = "Interrogation",
-- objective = "mmStompTutorial_INTERROGATE_OWNER",
-- -- (optional)conversation = mmStompTutorial_convo.convo_name -- play a conversation while interrogating
-- },
--}
--------------------------------------------------------------------------------------------------
--[[ OTHER ]]--
--------------------------------------------------------------------------------------------------
mmStomp_runtime =
{
bPersonaLoaded = false,
}
mmStompTutorial_CurrentEnemyCount = 0;
mmStompTutorial_PowerEquipped_Local = false
mmStompTutorial_PowerEquipped_Remote = false
SUPERPOWER_GROUNDPOUND = 1
--------------------------------------------------------------------------------------------------
--[[**********************]]--
--[[ ]]--
--[[ 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 mmStompTutorial_start(start_checkpoint_name, is_restart)
mission_start_fade_out(0.0)
imp_jump_occasionals_enable( false )
disable_diversions(true)
ui_hud_set_current_challenge(-1)
-- Set up the warp trigger.
trigger_setup( mmStompTutorial_trigger.lava_trigger )
set_ped_override_density(.1)
set_traffic_density(.1)
parking_spot_disable_all(true)
-- turn off all pickup drops
health_pickups_enable(false)
human_all_stop_dropping_weapons(true)
human_all_stop_dropping_cash(true)
-- Swap to the training facility.
city_zone_swap( "u_train", true )
-- initialize systems
mission_startup(mmStompTutorial_trigger, mmStompTutorial_convo) -- mmStompTutorial_checkpoint
local start_cp = get_table_by_name(mmStompTutorial_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 mmStompTutorial_scene.intro ~= "") then
-- First time playing mission
local fade_in_after = false
cutscene_play(mmStompTutorial_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
-- Handle mission initialization for the current checkpoint
mmStompTutorial_initialize(start_checkpoint_name)
-- Run the mission from the current checkpoint
checkpoint_run_mission(mmStompTutorial_checkpoint, start_checkpoint_name)
mission_end_success("mmStompTutorial", nil, { "player_end_nav_client", "player_end_nav_host" } )
end
-- This is the primary function responsible for cleaning up the entire mission
-- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++)
function mmStompTutorial_cleanup()
--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]--
city_zone_swap( "u_train", false, true )
imp_jump_occasionals_enable( true )
-- Clean up lava trigger
trigger_cb( "", mmStompTutorial_trigger.lava_trigger )
disable_diversions(false)
ui_hud_set_current_challenge(-2)
inv_weapon_disable_all_but_this_slot( WEAPON_SLOT_PISTOL, true, SYNC_ALL )
hud_prompt_clear()
-- Re-enable all superpowers and weapon radial
local enable = true
player_super_attacks_enable( enable, "Freeze" )
player_super_attacks_enable( enable, "Aura" )
player_super_attacks_enable( enable, "Summon" )
player_super_power_lock_to_tutorial_element( false )
hud_inventory_disable( false )
player_super_power_set_regen_scalar_buff(1.0)
npc_respawn_dist_reset()
set_ped_override_density(-1)
set_traffic_density(1)
parking_spot_disable_all(false)
-- turn back on pickup drops
health_pickups_enable(true)
human_all_stop_dropping_weapons(false)
human_all_stop_dropping_cash(false)
--ensure warp to shore is back on
player_warp_to_shore_enable( LOCAL_PLAYER )
if coop_is_active() == true then
player_warp_to_shore_enable( REMOTE_PLAYER )
end
-- cleanup all threads
cleanup_threads(mmStompTutorial_thread)
-- run checkpoint cleanups (move into mission_shutdown?)
checkpoint_cleanup_mission(mmStompTutorial_checkpoint)
-- cleanup triggers, convos, kill_list and interrogations
mission_shutdown()
-- cleanup all groups
cleanup_groups(mmStompTutorial_group)
--fade_out_block()
-- delay(1.0)
-- -- teleport the player
-- teleport_coop("player_end_nav_host", "player_end_nav_client", true)
-- delay(2.0)
--fade_in_block()
end
-- Called when the mission has ended with success
-- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++)
--
function mmStompTutorial_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 mmStompTutorial_initialize(checkpoint_name)
-- Common initialization
mmStompTutorial_initialize_common()
-- Checkpoint specific initialization
checkpoint_init(mmStompTutorial_checkpoint, checkpoint_name)
-- Remove any present subtitles
message_remove_all()
-- Start fading in
mission_start_fade_in()
audio_object_post_event( "Play_StompTutorialMusic" )
if mmStomp_runtime.bPersonaLoaded == false then
load_persona(mmStomp_persona.shakespeare)
mmStomp_runtime.bPersonaLoaded = true
end
end
-- Handle any common initialization
--
function mmStompTutorial_initialize_common()
--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]--
waypoint_remove()
mission_set_cancel_warp_location("player_end_nav_host", "player_end_nav_client")
--"crv crouch left" -- cops_ps_cvch_lft
-- Disable all superpowers and weapon radial
local enable = false
player_super_attacks_enable( enable, "Freeze" )
player_super_attacks_enable( enable, "Aura" )
player_super_attacks_enable( enable, "Summon" )
player_super_power_lock_to_tutorial_element( true, "stomp_force", SYNC_ALL )
player_super_power_select( "Stomp", SYNC_ALL, "stomp_force" )
hud_inventory_disable( true )
end
--------------------------------------------------------------------------------------------------
--[[**********************]]--
--[[ ]]--
--[[ Checkpoint functions ]]--
--[[ ]]--
--[[**********************]]--
--------------------------------------------------------------------------------------------------
--[[ First Checkpoint Name ]]--
--------------------------------------------------------------------------------------------------
-- Initialize this checkpoint.
--
-- mission_start: (bool) Whether we're initializing from a mission (re)start or from
-- a natural play-through.
--
function mmStompTutorial_fcp_init(mission_start)
-- Set up the players as invulnerable
turn_invulnerable( LOCAL_PLAYER )
if coop_is_active() == true then
turn_invulnerable( REMOTE_PLAYER )
end
-- Disable warp to shore
player_warp_to_shore_disable( LOCAL_PLAYER )
if coop_is_active() == true then
player_warp_to_shore_disable( REMOTE_PLAYER )
end
-- In the case that this power isn't unlocked, unlock it.
-- Really only here for debug purposes when jumping into the mission at hvslice 0.
--Remove all summons
player_super_power_clear_summons(LOCAL_PLAYER)
player_unlock_super_power( SUPERPOWER_GROUNDPOUND, LOCAL_PLAYER, true )
if coop_is_active() then
player_unlock_super_power( SUPERPOWER_GROUNDPOUND, REMOTE_PLAYER, true )
end
-- Enable superpower stuffs
player_super_movement_enable( true )
player_super_attacks_enable( true )
-- Disable melee (because if the co-op client melees, they gain ownership of the enemy and that messes up our death callbacks)
set_player_can_take_human_shields( LOCAL_PLAYER, false )
set_player_can_take_human_shields( REMOTE_PLAYER, false )
player_allow_weapon_melee( false )
-- Disable notoriety
notoriety_set_min_and_max( "luchadores", 0, 0 )
notoriety_set_min_and_max( "police", 0, 0 )
end
-- The first objective --
function mmStompTutorial_fcp_run()
-- Default to no power selected so that they have to select the power.
-- player_super_power_select( "none", SYNC_ALL )
mmStompTutorial_reset_kill_flags()
-- Give the player a pistol and make it the only available weapon
inv_weapon_add_temporary( LOCAL_PLAYER, "Pistol-Gang", 100, true, true, false, true )
inv_item_equip("Pistol-Gang", LOCAL_PLAYER)
if coop_is_active() == true then
inv_weapon_add_temporary( REMOTE_PLAYER, "Pistol-Gang", 100, true, true, false, true )
inv_item_equip("Pistol-Gang", REMOTE_PLAYER)
end
inv_weapon_disable_all_but_this_slot( WEAPON_SLOT_PISTOL, true, SYNC_ALL )
-- Do not allow access to the hub menu
cellphone_lock(true)
-- Disable all weapon slots (except fists)
--inv_weapon_disable_all_but_this_slot(WEAPON_SLOT_UNARMED)
-- player_super_power_set_temp_charge( 1.0 )
-- player_super_power_set_temp_strength( "stomp", 1.0 )
player_super_power_set_regen_scalar_buff(5.0)
convo_start(mmStompTutorial_convo.intro)
convo_wait_for_end()
-- commented out all the functionality to force the player to choose the ability. They need to have it auto-equipped
--[[
-- local tutorial_to_play = "super_radial_select"
-- if game_is_active_input_gamepad() == false then
-- tutorial_to_play = "super_radial_select_pc"
-- end
-- Reset our power equipped global.
mmStompTutorial_PowerEquipped_Local = false
mmStompTutorial_PowerEquipped_Remote = false
-- tutorial_start(tutorial_to_play, 1, true, true, true)
on_superpower_equip("mmStompTutorial_stomp_equipped_cb", LOCAL_PLAYER)
on_superpower_equip("mmStompTutorial_stomp_equipped_cb", REMOTE_PLAYER)
if( coop_is_active() == false ) then
while not mmStompTutorial_PowerEquipped_Local do
thread_yield()
end
else
while not (mmStompTutorial_PowerEquipped_Local and mmStompTutorial_PowerEquipped_Remote ) do
thread_yield()
end
end
-- Blast equipped, clear the tutorial and start the process
on_superpower_equip("", LOCAL_PLAYER)
on_superpower_equip("", REMOTE_PLAYER)
-- tutorial_stop(tutorial_to_play)
]]--
objective_text( 0, "SRG_MMSTOMP_OBJECTIVE_ENEMIES", "", "", SYNC_ALL, OI_ASSET_POWER_STOMP )
hud_prompt(LOCAL_PLAYER, "SRG_MMSTOMP_USE_NAG", "", true)
-- Set up the first wave.
tutorial_stop_current()
local tutorial_name = "stomp_enemies"
local delay_ms = 0
local auto_unlock = false
local allow_redisplay = false
local infinite_display = true
tutorial_start(tutorial_name, delay_ms, auto_unlock, allow_redisplay, infinite_display)
mmStompTutorial_wave_grunt_setup( mmStompTutorial_group.wave_1 )
while mmStompTutorial_CurrentEnemyCount > 0 do
thread_yield()
end
-- Remove nag hud prompt
hud_prompt_clear()
convo_start(mmStompTutorial_convo.more_enemies)
delay(1.0)
-- Set up the second wave.
mmStompTutorial_wave_grunt_setup( mmStompTutorial_group.wave_2 )
while mmStompTutorial_CurrentEnemyCount > 0 do
thread_yield()
end
-- delay(1.0)
-- Set up the third wave.
-- mmStompTutorial_wave_grunt_setup( mmStompTutorial_group.wave_3 )
-- while mmStompTutorial_CurrentEnemyCount > 0 do
-- thread_yield()
-- end
tutorial_stop_current()
tutorial_name = "stomp_imps"
tutorial_start(tutorial_name, delay_ms, auto_unlock, allow_redisplay, infinite_display)
convo_start(mmStompTutorial_convo.more_imps)
convo_wait_for_end()
mmStompTutorial_wave_imp_setup( mmStompTutorial_group.wave_4 )
while mmStompTutorial_CurrentEnemyCount > 0 do
thread_yield()
end
convo_start(mmStompTutorial_convo.inciter)
delay(2.0)
objective_text_clear(0)
objective_text( 0, "SRG_MMSTOMP_OBJECTIVE_INCITER", "", "", SYNC_ALL, OI_ASSET_POWER_STOMP )
tutorial_stop_current()
tutorial_name = "stomp_inciter"
tutorial_start(tutorial_name, delay_ms, auto_unlock, allow_redisplay, infinite_display)
dark_inciter_ultra_shield_only_vulnerable_to_superpowers( true )
mmStompTutorial_final_wave_setup( mmStompTutorial_group.wave_5 )
while mmStompTutorial_CurrentEnemyCount > 0 do
thread_yield()
end
dark_inciter_ultra_shield_only_vulnerable_to_superpowers( false )
objective_text_clear(0)
--removes current subtitle if player kills Inciter quickly.
message_remove_all()
convo_start(mmStompTutorial_convo.success)
convo_wait_for_end()
-- Fade the screen so we can zone swap.
fade_out(0.0)
delay(2.0)
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 mmStompTutorial_fcp_cleanup(mission_exit)
-- turn back on all pickup drops
health_pickups_enable(true)
human_all_stop_dropping_weapons(false)
human_all_stop_dropping_cash(false)
-- Re-enable all weapon slots
inv_weapon_disable_all_slots( false, SYNC_ALL )
inv_weapon_remove_temporary( LOCAL_PLAYER, "Pistol-Gang" )
if coop_is_active() == true then
inv_weapon_remove_temporary( REMOTE_PLAYER, "Pistol-Gang" )
end
-- Re-enable access to the hub menu
cellphone_lock( false )
turn_vulnerable( LOCAL_PLAYER )
if coop_is_active() == true then
turn_vulnerable( REMOTE_PLAYER )
end
-- Enable warp to shore
player_warp_to_shore_enable( LOCAL_PLAYER )
if coop_is_active() == true then
player_warp_to_shore_enable( REMOTE_PLAYER )
end
-- Clean up superpower tweaks.
--on_superpower_equip( "", LOCAL_PLAYER )
--on_superpower_equip( "", REMOTE_PLAYER )
npc_respawn_dist_reset()
dark_inciter_ultra_shield_only_vulnerable_to_superpowers( false )
-- Re-enable melee
set_player_can_take_human_shields( LOCAL_PLAYER, true )
set_player_can_take_human_shields( REMOTE_PLAYER, true )
player_allow_weapon_melee( true )
-- Re-enable notoriety
notoriety_set_min_and_max( "luchadores", 0, MAX_NOTORIETY_LEVEL )
notoriety_set_min_and_max( "police", 0, MAX_NOTORIETY_LEVEL )
end
------------------------------------
--
-- Checkpoint helper functions
--
------------------------------------
function mmStompTutorial_wave_grunt_setup( wave_group )
-- Reset our enemy counter
mmStompTutorial_CurrentEnemyCount = 0
-- Create the wave
group_create( wave_group.name )
-- Set special tutorial wave properties.
for i, wave_member in pairs( wave_group.members ) do
-- Ensure they know about and see the players
ai_add_enemy_target( wave_member, LOCAL_PLAYER, ATTACK_ON_SIGHT, false, true )
character_set_never_catch_fire(wave_member)
if coop_is_active() then
ai_add_enemy_target( wave_member, REMOTE_PLAYER, ATTACK_ON_SIGHT, false, true )
end
--turn_invulnerable( wave_member )
--npc_respawn_after_death( wave_member, true )
--npc_respawn_after_death_time_override( wave_member, 10, true )
on_death( "mmStompTutorial_grunt_on_death_cb", wave_member )
on_take_damage( "mmStompTutorial_npc_stomped_cb", wave_member )
marker_add( wave_member, MINIMAP_ICON_STOMP, OI_ASSET_POWER_STOMP, OI_FLAGS_DEFAULT, SYNC_ALL )
mmStompTutorial_CurrentEnemyCount = mmStompTutorial_CurrentEnemyCount + 1
end
if coop_is_active() then
-- Create the co-op wave
group_create( wave_group.coop_name )
-- Set special tutorial wave properties.
for i, wave_member in pairs( wave_group.coop_only_members ) do
-- Ensure they know about and see the players
ai_add_enemy_target( wave_member, LOCAL_PLAYER, ATTACK_ON_SIGHT, false, true )
ai_add_enemy_target( wave_member, REMOTE_PLAYER, ATTACK_ON_SIGHT, false, true )
--turn_invulnerable( wave_member )
--npc_respawn_after_death( wave_member, true )
--npc_respawn_after_death_time_override( wave_member, 10, true )
on_death( "mmStompTutorial_grunt_on_death_cb", wave_member )
on_take_damage( "mmStompTutorial_npc_stomped_cb", wave_member )
marker_add( wave_member, MINIMAP_ICON_STOMP, OI_ASSET_POWER_STOMP, OI_FLAGS_DEFAULT, SYNC_ALL )
mmStompTutorial_CurrentEnemyCount = mmStompTutorial_CurrentEnemyCount + 1
end
end
end
function mmStompTutorial_wave_imp_setup( wave_group )
-- Reset our enemy counter
mmStompTutorial_CurrentEnemyCount = 0
-- Create the wave
group_create( wave_group.name )
-- Set special tutorial wave properties.
for i, wave_member in pairs( wave_group.members ) do
-- Ensure they know about and see the players
ai_add_enemy_target( wave_member, LOCAL_PLAYER, ATTACK_ON_SIGHT, false, true )
if coop_is_active() then
ai_add_enemy_target( wave_member, REMOTE_PLAYER, ATTACK_ON_SIGHT, false, true )
end
--turn_invulnerable( wave_member )
--npc_respawn_after_death( wave_member, true )
--npc_respawn_after_death_time_override( wave_member, 10, true )
on_death( "mmStompTutorial_imp_on_death_cb", wave_member )
on_take_damage( "mmStompTutorial_npc_stomped_cb", wave_member )
marker_add( wave_member, MINIMAP_ICON_STOMP, OI_ASSET_POWER_STOMP, OI_FLAGS_DEFAULT, SYNC_ALL )
mmStompTutorial_CurrentEnemyCount = mmStompTutorial_CurrentEnemyCount + 1
end
if coop_is_active() then
delay(.2)
-- Create the co-op wave
group_create( wave_group.coop_name )
-- Set special tutorial wave properties.
for i, wave_member in pairs( wave_group.coop_only_members ) do
-- Ensure they know about and see the players
ai_add_enemy_target( wave_member, LOCAL_PLAYER, ATTACK_ON_SIGHT, false, true )
ai_add_enemy_target( wave_member, REMOTE_PLAYER, ATTACK_ON_SIGHT, false, true )
--turn_invulnerable( wave_member )
--npc_respawn_after_death( wave_member, true )
--npc_respawn_after_death_time_override( wave_member, 10, true )
on_death( "mmStompTutorial_imp_on_death_cb", wave_member )
on_take_damage( "mmStompTutorial_npc_stomped_cb", wave_member )
marker_add( wave_member, MINIMAP_ICON_STOMP, OI_ASSET_POWER_STOMP, OI_FLAGS_DEFAULT, SYNC_ALL )
mmStompTutorial_CurrentEnemyCount = mmStompTutorial_CurrentEnemyCount + 1
end
end
end
function mmStompTutorial_final_wave_setup( wave_group )
-- Reset our enemy counter
mmStompTutorial_CurrentEnemyCount = 0
-- Create the wave
group_create( wave_group.name )
-- Set special tutorial wave properties.
for i, wave_member in pairs( wave_group.members ) do
-- Ensure they know about and see the players
ai_add_enemy_target( wave_member, LOCAL_PLAYER, ATTACK_ON_SIGHT, false, true )
if coop_is_active() then
ai_add_enemy_target( wave_member, REMOTE_PLAYER, ATTACK_ON_SIGHT, false, true )
end
--Set ultra shields to be invulnerable to non-superpowers
tutorial_ultra_shield_only_vulnerable_to_superpowers( wave_member, true)
on_death( "mmStompTutorial_on_final_wave_death_cb", wave_member )
marker_add( wave_member, MINIMAP_ICON_STOMP, OI_ASSET_POWER_STOMP, OI_FLAGS_DEFAULT, SYNC_ALL )
mmStompTutorial_CurrentEnemyCount = mmStompTutorial_CurrentEnemyCount + 1
end
if coop_is_active() then
-- Create the co-op wave
group_create( wave_group.coop_name )
-- Set special tutorial wave properties.
for i, wave_member in pairs( wave_group.coop_only_members ) do
-- Ensure they know about and see the players
ai_add_enemy_target( wave_member, LOCAL_PLAYER, ATTACK_ON_SIGHT, false, true )
ai_add_enemy_target( wave_member, REMOTE_PLAYER, ATTACK_ON_SIGHT, false, true )
tutorial_ultra_shield_only_vulnerable_to_superpowers( wave_member, true)
on_death( "mmStompTutorial_on_final_wave_death_cb", wave_member )
marker_add( wave_member, MINIMAP_ICON_STOMP, OI_ASSET_POWER_STOMP, OI_FLAGS_DEFAULT, SYNC_ALL )
mmStompTutorial_CurrentEnemyCount = mmStompTutorial_CurrentEnemyCount + 1
end
end
end
function mmStompTutorial_get_npc_respawn_navpoint( npc_name )
return mmStompTutorial_respawn_points[ npc_name ]
end
------------------------------------
--
-- Checkpoint callback functions
--
------------------------------------
function mmStompTutorial_grunt_on_death_cb( npc )
local remove_stomped_character = false
if( mmStompTutorial_killed_by_stomp_damage[ npc ] == true ) then
remove_stomped_character = true
else
delay( 0.2 )
-- sometimes we get the damaged message AFTER the kill message, so check again after the character faded out.
if( mmStompTutorial_killed_by_stomp_damage[ npc ] == true ) then
remove_stomped_character = true
else
-- Play the VFX at the death location
npc_fade_out( npc, 1.0, false, 0 )
delay( 1.0 )
-- Teleport them to their respawn navpoint
teleport( npc, mmStompTutorial_get_npc_respawn_navpoint( npc ) )
-- Respawn the character (teleport and revive)
npc_revive( npc )
-- Give him a decent weapon
inv_item_add( "Rifle-LavaBolter", 1, npc, true )
delay(1.0)
-- Play the VFX
effect_play_on_human( mmStompTutorial_effects.respawn_effect, npc )
if (convo_is_playing() == false) then
convo_start(mmStompTutorial_convo.chide)
end
-- Show the character and mark them as a target
character_show( npc )
marker_add( npc, MINIMAP_ICON_STOMP, OI_ASSET_POWER_STOMP, OI_FLAGS_DEFAULT, SYNC_ALL )
end
end
if (remove_stomped_character == true) then
mmStompTutorial_CurrentEnemyCount = mmStompTutorial_CurrentEnemyCount - 1
on_death( "", npc )
on_take_damage( "", npc )
marker_remove( npc )
end
end
function mmStompTutorial_imp_on_death_cb( npc )
local remove_stomped_character = false
if( mmStompTutorial_killed_by_stomp_damage[ npc ] == true ) then
remove_stomped_character = true
else
delay( 0.2 )
-- sometimes we get the damaged message AFTER the kill message, so check again after the character faded out.
if( mmStompTutorial_killed_by_stomp_damage[ npc ] == true ) then
remove_stomped_character = true
else
-- Play the VFX at the death location
npc_fade_out( npc, 1.0, false, 0 )
delay( 1.0 )
-- Teleport them to their respawn navpoint
teleport( npc, mmStompTutorial_get_npc_respawn_navpoint( npc ) )
-- Respawn the character (teleport and revive)
npc_revive( npc )
-- Give him a decent weapon
delay(1.0)
-- Play the VFX
effect_play_on_human( mmStompTutorial_effects.respawn_effect, npc )
-- Show the character and mark them as a target
character_show( npc )
marker_add( npc, MINIMAP_ICON_STOMP, OI_ASSET_POWER_STOMP, OI_FLAGS_DEFAULT, SYNC_ALL )
end
end
if (remove_stomped_character == true) then
mmStompTutorial_CurrentEnemyCount = mmStompTutorial_CurrentEnemyCount - 1
on_death( "", npc )
on_take_damage( "", npc )
marker_remove( npc )
end
end
function mmStompTutorial_npc_stomped_cb(npc, attacker, dam_pct, explosion, melee, vomit, dam, tk, dfa, energy, stomp, headshot, sidescroller, buff)
if stomp then
mmStompTutorial_killed_by_stomp_damage[ npc ] = true
on_take_damage( "", npc )
character_kill(npc, true)
else
-- mmStompTutorial_killed_by_stomp_damage[ npc ] = false
end
end
function mmStompTutorial_on_final_wave_death_cb( npc )
mmStompTutorial_CurrentEnemyCount = mmStompTutorial_CurrentEnemyCount - 1
on_death( "", npc )
on_take_damage( "", npc )
marker_remove( npc )
end
------------------------------------
--
-- Checkpoint thread functions
--
------------------------------------
--------------------------------------------------------------------------------------------------
--[[**********************]]--
--[[ ]]--
--[[ Common functions ]]--
--[[ ]]--
--[[**********************]]--
function mmStompTutorial_reset_kill_flags()
-- wave_1
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<001>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<002>" ] = false
-- wave 2
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<003>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<004>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<005>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<006>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<007>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<008>" ] = false
-- wave 3
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<009>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<010>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<011>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<012>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<013>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<014>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<015>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<016>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<017>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<018>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<019>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Demon_Grunt<020>" ] = false
-- wave_4
mmStompTutorial_killed_by_stomp_damage[ "Imp<001>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<002>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<003>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<004>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<005>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<006>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<007>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<008>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<009>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<010>" ] = false
--[[mmStompTutorial_killed_by_stomp_damage[ "Imp<011>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<012>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<013>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<014>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<015>" ] = false
mmStompTutorial_killed_by_stomp_damage[ "Imp<016>" ] = false]]--
end
--------------------------------------------------------------------------------------------------
--[[**********************]]--
--[[ ]]--
--[[ Callback functions ]]--
--[[ ]]--
--[[**********************]]--
function mmStompTutorial_stomp_equipped_cb( player, power )
-- if( power == "stomp" ) then
if player == LOCAL_PLAYER then
mmStompTutorial_PowerEquipped_Local = true
else
mmStompTutorial_PowerEquipped_Remote = true
end
-- end
end
local processing_lava_player_local = false
local processing_lava_player_remote = false
function mmTutorial_lava_trigger_callback( human, trigger )
if human == LOCAL_PLAYER then
if (processing_lava_player_local == false) then
-- if we aren't currently trying to warp the player, then warp them
processing_lava_player_local = true
delay(1.0)
fade_out( 0, 0, SYNC_LOCAL )
delay( 1.0 )
teleport( LOCAL_PLAYER, "Player_start_nav_host" )
fade_in( 0, 0, SYNC_LOCAL )
-- done warping the player
processing_lava_player_local = false
end
elseif human == REMOTE_PLAYER then
if (processing_lava_player_remote == false) then
processing_lava_player_remote = true
-- if we aren't currently trying to warp the player, then warp them
delay(1.0)
fade_out( 0, 0, SYNC_REMOTE )
delay( 1.0 )
teleport( REMOTE_PLAYER, "Player_start_nav_client" )
fade_in( 0, 0, SYNC_REMOTE )
-- done warping the player
processing_lava_player_remote = false
end
end
end
--------------------------------------------------------------------------------------------------
--[[**********************]]--
--[[ ]]--
--[[ Thread functions ]]--
--[[ ]]--
--[[**********************]]--