./mmsummontutorial.lua

  1. --[[ 
  2. 	mmSummonTutorial.lua 
  3. 	SR3 Mission Script 
  4. 	DATE: 3-3-2014 
  5. 	AUTHOR:	Arturo Mata 
  6. ]]-- 
  7.  
  8.  
  9. -- Debug flags -- 
  10.  
  11. -- Tweakable Parameters -- 
  12. INVALID_EFFECT_HANDLE = -1 
  13. -------------------------------------------------------------------------------------------------- 
  14. 																				--[[ GROUPS ]]-- 
  15. -------------------------------------------------------------------------------------------------- 
  16. 	mmSummonTutorial_group = { 
  17. 									--[[ startup GROUPS ]]--	 
  18. 									 
  19. 									--[[ Ultor GROUPS ]]--	 
  20. 		wave_1 =  
  21. 		{ 
  22. 			name = "wave_1", 
  23. 			members =  
  24. 			{ 
  25. 				"Demon_Grunt<001>", 
  26. 			},		 
  27. 		 
  28. 			coop_name = "coop_wave_1", 
  29. 			coop_only_members = 
  30. 			{ 
  31. 			"Demon_Grunt<002>", 
  32. 			}, 
  33.  
  34. 			-- On damage threads 
  35. 			damage_threads = {  }, 
  36.  
  37. 			-- The reticle triggers for this wave 
  38. 			--reticle_triggers =  
  39. 			--{ 
  40. 			--	-- The list of triggers 
  41. 			--	triggers = { 
  42. 			-- 
  43. 			--		--example_trigger =  
  44. 			--		--{ 
  45. 			--		--	name = "Summon_Reticle_Trigger<000>",		-- The trigger 
  46. 			--		--	ring_effect = "Vfx Spfc Ring<000>",			-- The name of the VFX associated with the trigger 
  47. 			--		--	ring_effect_handle = INVALID_EFFECT_HANDLE, -- Used in turning the effect off 
  48. 			--		--}, 
  49. 			-- 
  50. 			--		summon_reticle_trigger_1 =  
  51. 			--		{ 
  52. 			--			name = "Summon_Reticle_Trigger<001>", 
  53. 			--			ring_effect = "Vfx Spfc Ring<001>", 
  54. 			--			ring_effect_handle = INVALID_EFFECT_HANDLE, 
  55. 			--		}, 
  56. 			-- 
  57. 			--		summon_reticle_trigger_2 =  
  58. 			--		{ 
  59. 			--			name = "Summon_Reticle_Trigger<002>", 
  60. 			--			ring_effect = "Vfx Spfc Ring<002>", 
  61. 			--			ring_effect_handle = INVALID_EFFECT_HANDLE, 
  62. 			--		}, 
  63. 			--	}, 
  64. 			-- 
  65. 			--	-- This thread runs the "reticle in trigger" detection. 
  66. 			--	reticle_trigger_detection_thread = INVALID_THREAD_HANDLE, 
  67. 			-- 
  68. 			--}, 
  69.  
  70. 		}, 
  71.  
  72. 		wave_2 =  
  73. 		{ 
  74. 			name = "wave_2", 
  75. 			members =  
  76. 			{ 
  77. 				"Demon_Grunt<003>", 
  78.  
  79. 			},		 
  80. 		 
  81. 			coop_name = "coop_wave_2", 
  82. 			coop_only_members = 
  83. 			{ 
  84. 			"Demon_Grunt<004>", 
  85. 			}, 
  86.  
  87. 			damage_threads = {  }, 
  88. 		-- The reticle triggers for this wave 
  89. 			reticle_triggers =  
  90. 			{ 
  91. 				-- The list of triggers 
  92. 				triggers =  
  93. 				{ 
  94. 					summon_reticle_trigger_1 =  
  95. 					{ 
  96. 						name = "Summon_Reticle_Trigger<001>", 
  97. 						ring_effect = "Vfx Spfc Ring<001>", 
  98. 						ring_effect_handle = INVALID_EFFECT_HANDLE, 
  99. 					}, 
  100. 					summon_reticle_trigger_2 =  
  101. 					{ 
  102. 						name = "Summon_Reticle_Trigger<002>", 
  103. 						ring_effect = "Vfx Spfc Ring<002>", 
  104. 						ring_effect_handle = INVALID_EFFECT_HANDLE, 
  105. 					}, 
  106. 				}, 
  107.  
  108. 				-- This thread runs the "reticle in trigger" detection. 
  109. 				reticle_trigger_detection_thread = INVALID_THREAD_HANDLE, 
  110.  
  111. 			}, 
  112. 		}, 
  113. 			wave_3 =  
  114. 		{ 
  115. 			name = "wave_3", 
  116. 			members =  
  117. 			{ 
  118. 				"Demon_Grunt<005>", 
  119. 				"Demon_Grunt<006>", 
  120. 			},		 
  121. 		 
  122. 			coop_name = "coop_wave_3", 
  123. 			coop_only_members = 
  124. 			{ 
  125. 			}, 
  126.  
  127. 			damage_threads = {  }, 
  128. 	-- The reticle triggers for this wave 
  129. 			reticle_triggers =  
  130. 			{ 
  131. 				-- The list of triggers 
  132. 				triggers = { 
  133.  
  134. 					--example_trigger =  
  135. 					--{ 
  136. 					--	name = "Summon_Reticle_Trigger<000>",		-- The trigger 
  137. 					--	ring_effect = "Vfx Spfc Ring<000>",			-- The name of the VFX associated with the trigger 
  138. 					--	ring_effect_handle = INVALID_EFFECT_HANDLE, -- Used in turning the effect off 
  139. 					--}, 
  140.  
  141. 					summon_reticle_trigger_3 =  
  142. 					{ 
  143. 						name = "Summon_Reticle_Trigger<003>", 
  144. 						ring_effect = "Vfx Spfc Ring<003>", 
  145. 						ring_effect_handle = INVALID_EFFECT_HANDLE, 
  146. 					}, 
  147. 					summon_reticle_trigger_4 =  
  148. 					{ 
  149. 						name = "Summon_Reticle_Trigger<004>", 
  150. 						ring_effect = "Vfx Spfc Ring<004>", 
  151. 						ring_effect_handle = INVALID_EFFECT_HANDLE, 
  152. 					}, 
  153. 				}, 
  154.  
  155. 				-- This thread runs the "reticle in trigger" detection. 
  156. 				reticle_trigger_detection_thread = INVALID_THREAD_HANDLE, 
  157.  
  158. 			}, 
  159. 		}, 
  160.  
  161. 									--[[  GROUPS ]]-- 
  162. 	} 
  163.  
  164. 	 
  165. mmSummonTutorial_respawn_points =  
  166. { 
  167. 	-- wave_1 
  168. 	[ "Demon_Grunt<001>" ] = "Respawn_Navpoint<001>", 
  169. 	[ "Demon_Grunt<002>" ] = "Respawn_Navpoint<002>", 
  170.  
  171. 	-- wave_2 
  172. 	[ "Demon_Grunt<003>" ] = "Respawn_Navpoint<003>", 
  173. 	[ "Demon_Grunt<004>" ] = "Respawn_Navpoint<004>", 
  174. 	-- wave 3 
  175. 	[ "Demon_Grunt<005>" ] = "Respawn_Navpoint<005>", 
  176. 	[ "Demon_Grunt<006>" ] = "Respawn_Navpoint<006>",	 
  177. } 
  178.  
  179. -------------------------------------------------------------------------------------------------- 
  180. 																				--[[ THREADS ]]-- 
  181. -------------------------------------------------------------------------------------------------- 
  182. 	mmSummonTutorial_thread = { 
  183. 		-- = INVALID_THREAD_HANDLE, 
  184. 		summon_reticle_in_trigger_thread_local	= INVALID_THREAD_HANDLE, 
  185. 		summon_reticle_in_trigger_thread_remote = INVALID_THREAD_HANDLE, 
  186.  
  187.  
  188. 	} 
  189.  
  190. -------------------------------------------------------------------------------------------------- 
  191. 																			--[[ CHECKPOINTS ]]-- 
  192. -------------------------------------------------------------------------------------------------- 
  193. 	mmSummonTutorial_checkpoint = { 
  194. 		{ 
  195. 			name = MISSION_START_CHECKPOINT,		-- First Checkpoint (fcp) 
  196. 			init = "mmSummonTutorial_fcp_init",				-- init(bool mission_restart) 
  197. 			run = "mmSummonTutorial_fcp_run",					-- run() 
  198. 			cleanup = "mmSummonTutorial_fcp_cleanup",			-- cleanup(bool mission_exit) (+++MUST RETURN IMMEDIATELY+++) 
  199. 			--next_checkpoint = "mmSummonTutorial_", 
  200. 			next_checkpoint = nil, 
  201. 			host_start = "Player_start_nav_host", 
  202. 			client_start = "Player_start_nav_client", 
  203. 			p1_car_nav = "", 
  204. 			p2_car_nav = "", 
  205. 			start_groups = { }, 
  206. 			cp_only_groups = { }, 
  207. 		}, 
  208. 	} 
  209. 	 
  210. -------------------------------------------------------------------------------------------------- 
  211. 																			--[[ CUTSCENES ]]-- 
  212. -------------------------------------------------------------------------------------------------- 
  213. 	mmSummonTutorial_scene = 
  214. 	{ 
  215. 		intro = "", 
  216. 		outro = "" 
  217. 	} 
  218.  
  219. -------------------------------------------------------------------------------------------------- 
  220. 																			--[[ CONVERSATIONS ]]-- 
  221. -------------------------------------------------------------------------------------------------- 
  222.  
  223. 	mmSummon_persona =  
  224. 	{  
  225. 		Blackbeard = { 
  226. 			persona_name = "BLACKBEARD", 
  227. 			persona_id = INVALID_PERSONA_HANDLE 
  228. 		}, 
  229. 	} 
  230.  
  231. 	mmSummonTutorial_convo = { 
  232. 		--[[ = { 
  233. 			name = "file_name without voice (_bm, _wm, _bf...", 
  234. 			player_talks = true or false, 
  235. 			handle = INVALID_CONVERSATION_HANDLE, 
  236. 			convo_thread = INVALID_THREAD_HANDLE, 
  237. 			max_wait_seconds = 60,	-- if the conversation doesn't complete before this time, kill it 
  238. 			timer_thread = INVALID_THREAD_HANDLE, 
  239. 			priority = CONVO_PRIORITY_HIGH or CONVO_PRIORITY_NORMAL or CONVO_PRIORITY_OPTIONAL 
  240. 			(optional) persona_line = true,	-- this is a single line 
  241. 			(required if persona_line) speaker_name = "name of speaker",	-- single line speaker (might be set before call to play is made?) 
  242. 			(optional)phone_call = true,  -- this is a phone conversation (phone persona must be preloaded) 
  243. 			(required if phone_call) receiving_call = true or false  -- auto-answer is always true in missions (until proven otherwise) 
  244. 			 
  245. 		},]] 
  246. 			 
  247. 		--Time�to�summon�one�of�my�favorite�little�hellions,�the�imp,�to�the�Inferno�Room! To start off lets see you summon an imp to do your dirty work and take out those enemies. 
  248. 		intro =  
  249. 		{ 
  250. 			name = "mmSummonTutorial_Intro",  
  251. 			player_talks = false, 
  252. 			handle = INVALID_CONVERSATION_HANDLE, 
  253. 			convo_thread = INVALID_THREAD_HANDLE, 
  254. 			max_wait_seconds = 60, 
  255. 			timer_thread = INVALID_THREAD_HANDLE, 
  256. 			priority = CONVO_PRIORITY_NORMAL, 
  257. 		}, 
  258. 		-- Why don't you start off lets see you summon an imp to do your dirty work and take out those enemies. 
  259. 		wave =  
  260. 		{ 
  261. 			name = "mmSummonTutorial_Wave",  
  262. 			player_talks = false, 
  263. 			handle = INVALID_CONVERSATION_HANDLE, 
  264. 			convo_thread = INVALID_THREAD_HANDLE, 
  265. 			max_wait_seconds = 60, 
  266. 			timer_thread = INVALID_THREAD_HANDLE, 
  267. 			priority = CONVO_PRIORITY_NORMAL, 
  268. 		}, 
  269. 		-- Took�him�down!�See�if�you�can�take�out�one�more. 
  270. 		one_down =  
  271. 		{ 
  272. 			name = "mmSummonTutorial_OneDown",  
  273. 			player_talks = false, 
  274. 			handle = INVALID_CONVERSATION_HANDLE, 
  275. 			convo_thread = INVALID_THREAD_HANDLE, 
  276. 			max_wait_seconds = 60, 
  277. 			timer_thread = INVALID_THREAD_HANDLE, 
  278. 			priority = CONVO_PRIORITY_NORMAL, 
  279. 		}, 
  280.  
  281. 		-- Those�little�ankle�biters�are�viscous!�Now�lets�practice�your�aim. Take down the demons on those islands 
  282. 		distant =  
  283. 		{ 
  284. 			name = "mmSummonTutorial_Island",  
  285. 			player_talks = false, 
  286. 			handle = INVALID_CONVERSATION_HANDLE, 
  287. 			convo_thread = INVALID_THREAD_HANDLE, 
  288. 			max_wait_seconds = 60, 
  289. 			timer_thread = INVALID_THREAD_HANDLE, 
  290. 			priority = CONVO_PRIORITY_NORMAL, 
  291. 		}, 
  292.  
  293. 		--Took�him�down!�See�if�you�can�take�out�one�more. 
  294. 		encourage =  
  295. 		{ 
  296. 			name = "mm_summon_imp_encourage",  
  297. 			player_talks = false, 
  298. 			handle = INVALID_CONVERSATION_HANDLE, 
  299. 			convo_thread = INVALID_THREAD_HANDLE, 
  300. 			max_wait_seconds = 60, 
  301. 			timer_thread = INVALID_THREAD_HANDLE, 
  302. 			priority = CONVO_PRIORITY_NORMAL, 
  303. 		}, 
  304.  
  305. 		-- Never�took�you�for�the�spell-casting�type.�Well�done. 
  306. 		success =  
  307. 		{ 
  308. 			name = "mmSummonTutorial_Success",  
  309. 			player_talks = false, 
  310. 			handle = INVALID_CONVERSATION_HANDLE, 
  311. 			convo_thread = INVALID_THREAD_HANDLE, 
  312. 			max_wait_seconds = 60, 
  313. 			timer_thread = INVALID_THREAD_HANDLE, 
  314. 			priority = CONVO_PRIORITY_NORMAL, 
  315. 		}, 
  316.  
  317. 		-- I�know�it's�fun�to�punch�these�things�back�to...�hell,�but�you�will�need�to�Summon�an�Imp�to�do�your�work�for�you�in�order to�complete�this�exercise. 
  318. 		chide =  
  319. 		{ 
  320. 			name = "mmSummonTutorial_Chide",  
  321. 			player_talks = false, 
  322. 			handle = INVALID_CONVERSATION_HANDLE, 
  323. 			convo_thread = INVALID_THREAD_HANDLE, 
  324. 			max_wait_seconds = 60, 
  325. 			timer_thread = INVALID_THREAD_HANDLE, 
  326. 			priority = CONVO_PRIORITY_NORMAL, 
  327. 		}, 
  328. 	} 
  329. 	 
  330. 	mmSummonTutorial_convo_queue = { 
  331. 		--[[start_drive_queue = {  
  332. 			{ delay = 2.0, convo = mmSummonTutorial_convo.goto_Ultor }, 
  333. 			{ delay = 4.0, convo = mmSummonTutorial_convo.goto_Ultor2 }, 
  334. 			{ delay = 3.0, convo = mmSummonTutorial_convo.goto_Ultor3 }, 
  335. 			{ delay = 5.0, convo = mmSummonTutorial_convo.goto_Ultor4 } 
  336. 		}, 
  337. 		]]-- 
  338. 	} 
  339. 	 
  340. -------------------------------------------------------------------------------------------------- 
  341. 																			--[[ TRIGGERS ]]-- 
  342. -------------------------------------------------------------------------------------------------- 
  343. 	mmSummonTutorial_trigger = { 
  344. 		-- = { 
  345. 		--	name = "_trigger", 
  346. 		--	hit = false, 
  347. 		-- 	last_hit_by = nil, -- 	last_hit_human = nil (set to the last human to enter the trigger in the default trigger callback) 
  348. 		--  (optional)callback = "mmSummonTutorial_function_name_cb" 
  349. 		--	(optional)marker = TRIGGER_LOCATION or TRIGGER_USE or custom or don't include for no marker 
  350. 		--  (optional)waypoint = true, 
  351. 		--  (optional)teleport_to = { 
  352. 		--						host = "host_nav", 
  353. 		--						client = "client_nav"  
  354. 		--					},		 
  355. 		--	(optional)conversation = mmSummonTutorial_convo.convo_name  -- play a conversation 
  356. 		--	(optional)next_trigger = "next_trigger_name" sets up next trigger when triggered (breadcrumbs) 
  357. 		--}, 
  358. 		 
  359. 									--[[ Ultor TRIGGERS ]]-- 
  360. 		--summon_reticle_trigger_1 = { 
  361. 		--	name = "Summon_Reticle_Trigger<001>", 
  362. 		--	ring_effect = "Vfx Spfc Ring<001>", 
  363. 		--	reticle_detection_thread = INVALID_THREAD_HANDLE, 
  364. 		--}, 
  365.  
  366. 		lava_trigger = { 
  367. 			name = "lava_trigger", 
  368. 			callback = "mmTutorial_lava_trigger_callback", 
  369. 		}, 
  370. 									--[[  TRIGGERS ]]--	 
  371.  
  372. 	} 
  373. 	 
  374. -------------------------------------------------------------------------------------------------- 
  375. 																	  --[[ INTERROGATION DATA ]]-- 
  376. -------------------------------------------------------------------------------------------------- 
  377. 	--mmSummonTutorial_interrogate = { 
  378. 	--	leader = { 
  379. 	--		target = mmSummonTutorial_group.friendly_fire.owner, 
  380. 	--		persona = "Interrogation", 
  381. 	--		objective = "mmSummonTutorial_INTERROGATE_OWNER", 
  382. 	--	--	(optional)conversation = mmSummonTutorial_convo.convo_name  -- play a conversation while interrogating 
  383. 	--	}, 
  384. 	--} 
  385. 		 
  386. -------------------------------------------------------------------------------------------------- 
  387. 																				   --[[ OTHER ]]-- 
  388. -------------------------------------------------------------------------------------------------- 
  389. mmSummonTutorial_CurrentEnemyCount = 0 
  390. mmSummon_runtime =  
  391. { 
  392. 		bPersonaLoaded = false, 
  393. } 
  394. -------------------------------------------------------------------------------------------------- 
  395. 								--[[**********************]]-- 
  396. 								--[[                      ]]-- 
  397. 								--[[  Standard functions  ]]-- 
  398. 								--[[                      ]]-- 
  399. 								--[[**********************]]-- 
  400.  
  401. -- This is the primary entry point for the mission, and is responsible for starting up the mission 
  402. -- at the specified checkpoint. 
  403. -- CALLED FROM CODE 
  404. -- 
  405. -- start_checkpoint_name:	(string) The checkpoint the mission should begin at 
  406. -- is_restart:					(bool) TRUE if the mission is restarting, FALSE otherwise 
  407. -- 
  408. function mmSummonTutorial_start(start_checkpoint_name, is_restart) 
  409. 	mission_start_fade_out(0.0) 
  410. 	 
  411. 	disable_diversions(true) 
  412. 	ui_hud_set_current_challenge(-1) 
  413. 	 
  414. 	-- Swap to the training facility. 
  415. 	city_zone_swap( "u_train", true ) 
  416.  
  417. 	set_ped_override_density(.1) 
  418. 	set_traffic_density(.1) 
  419. 	parking_spot_disable_all(true) 
  420. 	-- Set up the warp trigger. 
  421. 	trigger_setup( mmSummonTutorial_trigger.lava_trigger ) 
  422.  
  423. 	-- initialize systems 
  424. 	mission_startup(mmSummonTutorial_trigger, mmSummonTutorial_convo) -- mmSummonTutorial_checkpoint 
  425. 	-- if using interrogations 
  426. 	--interrogate_startup(mmSummonTutorial_interrogate) 
  427. 	 
  428. 	local start_cp = get_table_by_name(mmSummonTutorial_checkpoint, MISSION_START_CHECKPOINT) 
  429.  
  430. 	-- Check if this mission starting from the beginning 
  431. 	if (start_checkpoint_name == start_cp.name) then 
  432. 		if (is_restart == false and mmSummonTutorial_scene.intro ~= "") then 
  433. 			-- First time playing mission 
  434. 			local fade_in_after = false 
  435. 			cutscene_play(mmSummonTutorial_scene.intro, nil, {start_cp.host_start, start_cp.client_start}, fade_in_after) 
  436. 		else 
  437. 			teleport_coop(start_cp.host_start, start_cp.client_start, true) 
  438. 		end 
  439. 		fade_out(0) 
  440. 	end 
  441.  
  442. 	-- Handle mission initialization for the current checkpoint 
  443. 	mmSummonTutorial_initialize(start_checkpoint_name) 
  444.  
  445. 	-- Run the mission from the current checkpoint 
  446. 	checkpoint_run_mission(mmSummonTutorial_checkpoint, start_checkpoint_name) 
  447. 		 
  448. 	mission_end_success("mmSummonTutorial", nil, { "player_end_nav_client", "player_end_nav_host" } ) 
  449. end 
  450.  
  451. -- This is the primary function responsible for cleaning up the entire mission 
  452. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
  453. -- 
  454. function mmSummonTutorial_cleanup() 
  455. 	--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]-- 
  456.  
  457. 	city_zone_swap( "u_train", false, true ) 
  458.  
  459. 	imp_aggressive_tutorial_ai_enable( false ) 
  460. 	 
  461. 	disable_diversions(false) 
  462. 	ui_hud_set_current_challenge(-2) 
  463.  
  464. 	-- reset the charge back to normal 
  465. 	player_super_power_set_regen_scalar_buff(1.0)	 
  466. 		 
  467. 	-- Re-enable all superpowers and weapon radial 
  468. 	inv_weapon_remove_temporary( LOCAL_PLAYER, "Pistol-Gang") 
  469. 	if coop_is_active() == true then 
  470. 		inv_weapon_remove_temporary( REMOTE_PLAYER, "Pistol-Gang") 
  471. 	end 
  472. 	set_ped_override_density(-1) 
  473. 	set_traffic_density(1) 
  474. 	parking_spot_disable_all(false) 
  475. 	hud_prompt_clear() 
  476.  
  477. 	local enable = true 
  478. 	player_super_attacks_enable( enable, "Stomp" ) 
  479. 	player_super_attacks_enable( enable, "Aura" ) 
  480. 	player_super_attacks_enable( enable, "Freeze" ) 
  481. 	player_super_power_lock_to_tutorial_element( false ) 
  482. 	hud_inventory_disable( false ) 
  483.  
  484. 	-- Stop controling the summoning from script 
  485. 	player_super_power_control_summon_through_script( LOCAL_PLAYER, false )	 
  486. 	if coop_is_active() then 
  487. 		player_super_power_control_summon_through_script( REMOTE_PLAYER, false ) 
  488. 	end 
  489.  
  490. 	--ensure warp to shore is back on 
  491. 	player_warp_to_shore_enable( LOCAL_PLAYER ) 
  492. 	if coop_is_active() == true then 
  493. 		player_warp_to_shore_enable( REMOTE_PLAYER ) 
  494. 	end 
  495.  
  496. 	-- cleanup all threads 
  497. 	cleanup_threads(mmSummonTutorial_thread) 
  498. 	 
  499. 	-- run checkpoint cleanups (move into mission_shutdown?) 
  500. 	checkpoint_cleanup_mission(mmSummonTutorial_checkpoint) 
  501. 	 
  502. 	-- cleanup triggers, convos, kill_list and interrogations 
  503. 	mission_shutdown() 
  504. 	 
  505. 	-- cleanup all groups 
  506. 	cleanup_groups(mmSummonTutorial_group)	 
  507. 		 
  508. end 
  509.  
  510. -- Called when the mission has ended with success 
  511. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
  512. -- 
  513. function mmSummonTutorial_success() 
  514. 	--[[ INSERT ANY MISSION SPECIFIC SUCCESS STUFF ]]-- 
  515. 	 
  516. end 
  517.  
  518. -------------------------------------------------------------------------------------------------- 
  519. 								--[[**********************]]-- 
  520. 								--[[                      ]]-- 
  521. 								--[[ Initialize functions ]]-- 
  522. 								--[[                      ]]-- 
  523. 								--[[**********************]]-- 
  524.  
  525. -- Initialize the mission for the specified checkpoint 
  526. -- 
  527. -- checkpoint_name:		(string) Checkpoint to initialize the mission to 
  528. -- 
  529. function mmSummonTutorial_initialize(checkpoint_name) 
  530. 	-- Common initialization 
  531. 	mmSummonTutorial_initialize_common() 
  532. 	 
  533. 	-- Checkpoint specific initialization 
  534. 	checkpoint_init(mmSummonTutorial_checkpoint, checkpoint_name) 
  535.  
  536. 	-- Remove any present subtitles 
  537. 	message_remove_all() 
  538.  
  539. 	-- Start fading in  
  540. 	mission_start_fade_in() 
  541. 	 
  542. 	audio_object_post_event( "Play_mmSummonTutorial" ) 
  543. end 
  544.  
  545. -- Handle any common initialization 
  546. -- 
  547. function mmSummonTutorial_initialize_common() 
  548. 	--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]-- 
  549. 	waypoint_remove() 
  550. 	imp_aggressive_tutorial_ai_enable( true ) 
  551.  
  552. 	mission_set_cancel_warp_location("player_end_nav_host", "player_end_nav_client") 
  553.  
  554. 	if mmSummon_runtime.bPersonaLoaded == false then 
  555. 		load_persona(mmSummon_persona.Blackbeard) 
  556. 		mmSummon_runtime.bPersonaLoaded = true 
  557. 	end  
  558. 	-- Disable all superpowers and weapon radial 
  559. 	local enable = false 
  560. 	player_super_attacks_enable( enable, "Stomp" ) 
  561. 	player_super_attacks_enable( enable, "Aura" ) 
  562. 	player_super_attacks_enable( enable, "Freeze" ) 
  563. 	player_super_power_lock_to_tutorial_element( true, "summon_imp", SYNC_ALL )		 
  564. 	player_super_power_select( "Summon", SYNC_ALL, "summon_imp" ) 
  565. 	hud_inventory_disable( true ) 
  566.  
  567. end 
  568.  
  569. -------------------------------------------------------------------------------------------------- 
  570. 								--[[**********************]]-- 
  571. 								--[[                      ]]-- 
  572. 								--[[ Checkpoint functions ]]-- 
  573. 								--[[                      ]]-- 
  574. 								--[[**********************]]-- 
  575.  
  576. -------------------------------------------------------------------------------------------------- 
  577. 																	--[[ First Checkpoint Name ]]-- 
  578. -------------------------------------------------------------------------------------------------- 
  579.  
  580. -- Initialize this checkpoint. 
  581. -- 
  582. -- mission_start: (bool) Whether we're initializing from a mission (re)start or from 
  583. --					a natural play-through. 
  584. -- 
  585. function mmSummonTutorial_fcp_init(mission_start) 
  586. 	 
  587. 	-- Turn off all pickup drops 
  588. 	health_pickups_enable(false) 
  589. 	human_all_stop_dropping_weapons(true) 
  590. 	human_all_stop_dropping_cash(true) 
  591.  
  592. 	 
  593. 	-- Disable access to the hub menu 
  594. 	cellphone_lock( true ) 
  595.  
  596. 	-- Set up the players as invulnerable 
  597. 	turn_invulnerable( LOCAL_PLAYER ) 
  598. 	if coop_is_active() == true then 
  599. 		turn_invulnerable( REMOTE_PLAYER ) 
  600. 	end 
  601.  
  602. 	-- Disable warp to shore 
  603. 	player_warp_to_shore_disable( LOCAL_PLAYER ) 
  604. 	if coop_is_active() == true then 
  605. 		player_warp_to_shore_disable( REMOTE_PLAYER ) 
  606. 	end 
  607.  
  608. 	--Remove all summons 
  609. 	player_super_power_clear_summons(LOCAL_PLAYER) 
  610.  
  611. 	-- In the case that this power isn't unlocked, unlock it. 
  612. 	-- Really only here for debug purposes when jumping into the mission at hvslice 0. 
  613. 	player_unlock_super_power( SUPERPOWER_SUMMON, LOCAL_PLAYER, true ) 
  614. 	if coop_is_active() then 
  615. 		player_unlock_super_power( SUPERPOWER_SUMMON, REMOTE_PLAYER, true ) 
  616. 	end 
  617.  
  618. 	-- Enable superpower stuffsmmSummon_convo 
  619. 	player_super_movement_enable( true ) 
  620. 	player_super_attacks_enable( true ) 
  621.  
  622. 	-- Disable melee (because if the co-op client melees, they gain ownership of the enemy and that messes up our death callbacks) 
  623. 	set_player_can_take_human_shields( LOCAL_PLAYER, false ) 
  624. 	set_player_can_take_human_shields( REMOTE_PLAYER, false ) 
  625. 	player_allow_weapon_melee( false ) 
  626. 	 
  627. 	-- Disable notoriety 
  628. 	notoriety_set_min_and_max( "luchadores", 0, 0 ) 
  629. 	notoriety_set_min_and_max( "police", 0, 0 ) 
  630.  
  631.  
  632. end 
  633.  
  634. -- The first objective 
  635. -- 
  636. function mmSummonTutorial_fcp_run() 
  637.  
  638.  
  639. 	-- Give the player a pistol and make it the only available weapon 
  640. 	inv_weapon_add_temporary( LOCAL_PLAYER, "Pistol-Gang", 100, true, true, false, true ) 
  641. 	inv_item_equip("Pistol-Gang", LOCAL_PLAYER) 
  642. 	if coop_is_active() == true then 
  643. 		inv_weapon_add_temporary( REMOTE_PLAYER, "Pistol-Gang", 100, true, true, false, true ) 
  644. 		inv_item_equip("Pistol-Gang", REMOTE_PLAYER) 
  645. 	end 
  646. 	inv_weapon_disable_all_but_this_slot( WEAPON_SLOT_PISTOL, true, SYNC_ALL ) 
  647.  
  648. 	player_super_power_set_regen_scalar_buff(5.0)	 
  649. 	convo_start(mmSummonTutorial_convo.intro) 
  650. 	convo_wait_for_end() 
  651. 	convo_start(mmSummonTutorial_convo.wave) 
  652. 	-- Create Wave 1 
  653. 	objective_text( 0, "SRG_MMSUMMON_OBJECTIVE_ENEMIES", "", "", SYNC_ALL, OI_ASSET_POWER_SUMMON ) 
  654.  
  655. 	hud_prompt(LOCAL_PLAYER, "SRG_MMSUMMON_USE_NAG", "", true) 
  656. 	 
  657. 	-- Play the tutorial text 
  658. 	tutorial_stop_current() 
  659. 	local tutorial_name = "summon_enemies" 
  660. 	local delay_ms = 0 
  661. 	local auto_unlock = false 
  662. 	local allow_redisplay = false 
  663. 	local infinite_display = true 
  664. 	tutorial_start(tutorial_name, delay_ms, auto_unlock, allow_redisplay, infinite_display) 
  665. 	mmSummonTutorial_wave_setup( mmSummonTutorial_group.wave_1, false ) 
  666.  
  667. 	npc_leash_to_nav("Demon_Grunt<001>", "Respawn_Navpoint<001>", 1.0, false) 
  668. 	if coop_is_active() then 
  669. 	npc_leash_to_nav("Demon_Grunt<002>", "Respawn_Navpoint<002>", 1.0, false) 
  670. 	end 
  671. 	while mmSummonTutorial_CurrentEnemyCount > 0 do 
  672. 		thread_yield() 
  673. 	end 
  674. 	hud_prompt_clear() 
  675. 	 
  676. 	-- Create Wave 2	 
  677. 	convo_start(mmSummonTutorial_convo.one_down)	 
  678. 	player_super_power_clear_summons( LOCAL_PLAYER ) 
  679. 	if coop_is_active() then		 
  680. 		player_super_power_clear_summons( REMOTE_PLAYER ) 
  681. 	end 
  682. 	mmSummonTutorial_wave_setup( mmSummonTutorial_group.wave_2, false ) 
  683. 	-- make sure everybody spawns before leashing them 
  684.  
  685. 	npc_leash_to_nav("Demon_Grunt<003>", "Respawn_Navpoint<003>", 0.5, false) 
  686. 	if coop_is_active() then	 
  687. 		npc_leash_to_nav("Demon_Grunt<004>", "Respawn_Navpoint<004>", 0.5, false) 
  688. 	end 
  689. 	while mmSummonTutorial_CurrentEnemyCount > 0 do 
  690. 		thread_yield() 
  691. 	end 
  692. 	 
  693. 	objective_text_clear(0)	 
  694. 	objective_text( 0, "SRG_MMSUMMON_OBJECTIVE_DISTANCE", "", "", SYNC_ALL, OI_ASSET_POWER_SUMMON ) 
  695. 	-- Create Wave 3	 
  696. 	convo_start(mmSummonTutorial_convo.distant)		 
  697. 	-- Clear out any summons. 
  698. 	player_super_power_clear_summons( LOCAL_PLAYER ) 
  699. 	if coop_is_active() then		 
  700. 		player_super_power_clear_summons( REMOTE_PLAYER ) 
  701. 	end 
  702. 	-- Set up the summon reticle triggers 
  703. 	mmSummonTutorial_setup_summon_reticle_triggers( mmSummonTutorial_group.wave_3.reticle_triggers ) 
  704. 	-- Control the summoning from script 
  705. 	player_super_power_control_summon_through_script( LOCAL_PLAYER, true ) 
  706. 	if coop_is_active() then 
  707. 		player_super_power_control_summon_through_script( REMOTE_PLAYER, true ) 
  708. 	end 
  709. 	tutorial_stop_current()	 
  710. 	tutorial_name = "summon_distance" 
  711. 	tutorial_start(tutorial_name, delay_ms, auto_unlock, allow_redisplay, infinite_display) 
  712. 	mmSummonTutorial_wave_setup( mmSummonTutorial_group.wave_3, true ) 
  713. 	ai_attack_region("Demon_Grunt<005>", "Respawn_Navpoint<005>", 1.8) 
  714. 	ai_attack_region("Demon_Grunt<006>", "Respawn_Navpoint<006>", 1.8) 
  715.  
  716. 	while mmSummonTutorial_CurrentEnemyCount > 0 do 
  717. 		thread_yield() 
  718. 	end 
  719. 		 
  720. 	-- Clean up the summon reticle triggers 
  721. 	mmSummonTutorial_cleanup_summon_reticle_trigger( mmSummonTutorial_group.wave_3.reticle_triggers ) 
  722. 	 
  723. 	-- Clear out any summons. 
  724. 	player_super_power_clear_summons( LOCAL_PLAYER ) 
  725. 	if coop_is_active() then		 
  726. 		player_super_power_clear_summons( REMOTE_PLAYER ) 
  727. 	end 
  728. 	-- Stop controlling the summoning from script 
  729. 	player_super_power_control_summon_through_script( LOCAL_PLAYER, false )	 
  730. 	if coop_is_active() then 
  731. 		player_super_power_control_summon_through_script( REMOTE_PLAYER, false ) 
  732. 	end 
  733. 		 
  734. 	tutorial_stop_current() 
  735. 	objective_text_clear(0)	 
  736. 	convo_start(mmSummonTutorial_convo.success) 
  737. 	convo_wait_for_end()	 
  738. 	delay(1.0)	 
  739.  
  740. 	-- Fade the screen so we can zone swap. 
  741. 	fade_out(0.0) 
  742. 	delay(2.0) 
  743.  
  744. end 
  745.  
  746. -- Do any cleanup for this checkpoint. 
  747. -- 
  748. -- (+++THIS IS CALLED FROM MISSION CLEANUP, MUST RETURN IMMEDIATELY+++) 
  749. -- 
  750. -- mission_exit: (bool) Whether we're exiting the mission entirely, or just 
  751. --					moving on to the next checkpoint. 
  752. -- 
  753. function mmSummonTutorial_fcp_cleanup(mission_exit) 
  754.  
  755. 	-- Cleanup all of the enemies 
  756. 	mmTutorial_cleanup_enemies( mmSummonTutorial_group.wave_1 ) 
  757. 	mmTutorial_cleanup_enemies( mmSummonTutorial_group.wave_2 ) 
  758. 	mmTutorial_cleanup_enemies( mmSummonTutorial_group.wave_3 ) 
  759.  
  760. 	-- turn back on all pickup drops 
  761. 	health_pickups_enable(true) 
  762. 	human_all_stop_dropping_weapons(false) 
  763. 	human_all_stop_dropping_cash(false) 
  764.  
  765. 	-- Re-enable all weapon slots 
  766. 	inv_weapon_disable_all_slots( false, SYNC_ALL ) 
  767. 		 
  768. 	-- Re-enable access to the hub menu 
  769. 	cellphone_lock( false ) 
  770.  
  771. 	turn_vulnerable( LOCAL_PLAYER ) 
  772. 	if coop_is_active() == true then 
  773. 		turn_vulnerable( REMOTE_PLAYER ) 
  774. 	end 
  775.  
  776. 	-- Enable warp to shore 
  777. 	player_warp_to_shore_enable( LOCAL_PLAYER ) 
  778. 	if coop_is_active() == true then 
  779. 		player_warp_to_shore_enable( REMOTE_PLAYER ) 
  780. 	end 
  781.  
  782. 	-- Clean up superpower tweaks. 
  783. 	on_superpower_equip( "", LOCAL_PLAYER ) 
  784. 	on_superpower_equip( "", REMOTE_PLAYER ) 
  785. 	npc_respawn_dist_reset() 
  786.  
  787. 	-- Re-enable melee 
  788. 	set_player_can_take_human_shields( LOCAL_PLAYER, true ) 
  789. 	set_player_can_take_human_shields( REMOTE_PLAYER, true ) 
  790. 	player_allow_weapon_melee( true ) 
  791. 	 
  792. 	-- Re-enable notoriety 
  793. 	notoriety_set_min_and_max( "luchadores", 0, MAX_NOTORIETY_LEVEL ) 
  794. 	notoriety_set_min_and_max( "police", 0, MAX_NOTORIETY_LEVEL ) 
  795.  
  796. end 
  797.  
  798. ------------------------------------ 
  799. -- 
  800. -- Checkpoint helper functions 
  801. -- 
  802. ------------------------------------ 
  803. function mmSummonTutorial_wave_setup( wave_group, ignore_coop_wave ) 
  804.  
  805. 	-- Reset our enemy counter 
  806. 	mmSummonTutorial_CurrentEnemyCount = 0 
  807. 	 
  808. 	-- Allow respawning at a close distance 
  809. 	npc_respawn_dist_override( 100000.0 ) 
  810.  
  811. 	-- Create the wave 
  812. 	group_create( wave_group.name, true ) 
  813.  
  814. 	-- Set special tutorial wave properties. 
  815. 	for i, wave_member in pairs( wave_group.members ) do 
  816.  
  817. 		-- Ensure they know about and see the players 
  818. 		--ai_add_enemy_target( wave_member, LOCAL_PLAYER, ATTACK_ON_SIGHT, false, true ) 
  819. 		--if coop_is_active() then 
  820. 		--	ai_add_enemy_target( wave_member, REMOTE_PLAYER, ATTACK_ON_SIGHT, false, true ) 
  821. 		--end 
  822.  
  823. 		 
  824. 		turn_invulnerable( wave_member ) 
  825. 		character_set_never_catch_fire( wave_member, true ) 
  826. 		on_death( "mmSummonTutorial_on_death_cb", wave_member ) 
  827. 		character_prevent_explosion_fling( wave_member, true ) 
  828.  
  829. 		wave_group.damage_threads[ wave_member ] = thread_new("mmSummonTutorial_imp_attach_thread", wave_member ) 
  830.  
  831. 		marker_add( wave_member, MINIMAP_ICON_SUMMON, OI_ASSET_POWER_SUMMON, OI_FLAGS_DEFAULT, SYNC_ALL ) 
  832. 		mmSummonTutorial_CurrentEnemyCount = mmSummonTutorial_CurrentEnemyCount + 1 
  833. 	end 
  834.  
  835. 	if coop_is_active() and ignore_coop_wave == false then 
  836. 		 
  837. 		-- Create the co-op wave 
  838. 		group_create( wave_group.coop_name ) 
  839.  
  840. 		-- Set special tutorial wave properties. 
  841. 		for i, wave_member in pairs( wave_group.coop_only_members ) do 
  842.  
  843. 			-- Ensure they know about and see the players 
  844. 	--		ai_add_enemy_target( wave_member, LOCAL_PLAYER, ATTACK_ON_SIGHT, false, true ) 
  845. 			if coop_is_active() then 
  846. 	--			ai_add_enemy_target( wave_member, REMOTE_PLAYER, ATTACK_ON_SIGHT, false, true ) 
  847. 			end 
  848. 			 
  849. 			turn_invulnerable( wave_member ) 
  850.  
  851. 			on_death( "mmSummonTutorial_on_death_cb", wave_member ) 
  852. 			wave_group.damage_threads[ wave_member ] = thread_new("mmSummonTutorial_imp_attach_thread", wave_member ) 
  853. 			 
  854. 			character_prevent_explosion_fling( wave_member, true ) 
  855.  
  856. 			marker_add( wave_member, MINIMAP_ICON_SUMMON, OI_ASSET_POWER_SUMMON, OI_FLAGS_DEFAULT, SYNC_ALL ) 
  857. 			mmSummonTutorial_CurrentEnemyCount = mmSummonTutorial_CurrentEnemyCount + 1 
  858. 		end 
  859. 	end 
  860.  
  861. end 
  862.  
  863. function mmSummonTutorial_get_npc_respawn_navpoint( npc_name ) 
  864. 	 
  865. 	return mmSummonTutorial_respawn_points[ npc_name ] 
  866.  
  867. end 
  868.  
  869. function mmSummonTutorial_setup_summon_reticle_triggers( reticle_triggers ) 
  870. 	 
  871. 	-- For each trigger in this group of triggers 
  872. 	for i, trigger in pairs( reticle_triggers.triggers ) do 
  873.  
  874. 		-- Set up the summon spawn trigger 
  875. 		trigger_enable( trigger.name, true) 
  876. 			 
  877. 		-- Show the marker 
  878. 		trigger.ring_effect_handle = effect_play( trigger.ring_effect, true ) 
  879. 	 
  880. 	end 
  881.  
  882. 	-- Start the thread for detecting if the player has summoned in the trigger 
  883. 	reticle_triggers.reticle_detection_thread = thread_new( "mmSummonTutorial_summon_reticle_trigger_thread_func", reticle_triggers ) 
  884. 	 
  885. end 
  886.  
  887.  
  888. function mmSummonTutorial_cleanup_summon_reticle_trigger( reticle_triggers ) 
  889. 	 
  890. 	-- For each trigger in this group of triggers 
  891. 	for i, trigger in pairs( reticle_triggers.triggers ) do 
  892.  
  893. 		-- Stop the effect 
  894. 		effect_stop( trigger.ring_effect_handle ) 
  895.  
  896. 		-- Disable the trigger 
  897. 		trigger_enable( trigger.name, false ) 
  898. 	 
  899. 	end 
  900.  
  901. 	cleanup_threads( reticle_triggers.reticle_trigger_detection_thread ) 
  902.  
  903. end 
  904.  
  905. ------------------------------------ 
  906. -- 
  907. -- Checkpoint callback functions 
  908. -- 
  909. ------------------------------------ 
  910. function mmSummonTutorial_on_death_cb( npc ) 
  911.  
  912. 	if( character_has_imp_attached( npc ) == true ) then 
  913. 		mmSummonTutorial_CurrentEnemyCount = mmSummonTutorial_CurrentEnemyCount - 1 
  914. 		on_death( "", npc ) 
  915. 		marker_remove( npc ) 
  916. 	else 
  917. 			 
  918. 		-- Play the VFX at the death location 
  919. 		npc_fade_out( npc, 1.0, false, 0 )  
  920. 		 
  921. 		delay( 1.0 ) 
  922. 				 
  923. 		-- TODO: Play the VO for an unsuccessful kill. 
  924. 		if (convo_is_playing() == false) then 
  925. 			convo_start(mmSummonTutorial_convo.chide) 
  926. 		end	 
  927. 		-- Teleport them to their respawn navpoint 
  928. 		teleport( npc, mmSummonTutorial_get_npc_respawn_navpoint( npc ) ) 
  929. 		 
  930. 		-- Play the VFX 
  931. 		--effect_play_on_human( mmBlastTutorial_effects.respawn_effect, npc )  
  932.  
  933. 		-- Respawn the character (teleport and revive) 
  934. 		npc_revive( npc ) 
  935. 		 
  936. 		-- Show the character and mark them as a target 
  937. 		character_show( npc ) 
  938. 		 
  939. 		-- Give him a decent weapon 
  940. 		inv_item_add( "Rifle-LavaBolter", 1, npc, true ) 
  941. 		--COMEBACK 
  942. 		npc_leash_to_nav(npc, mmSummonTutorial_get_npc_respawn_navpoint(npc), 0.5, false ) 
  943.  
  944. 		marker_add( npc, MINIMAP_ICON_SUMMON, OI_ASSET_POWER_SUMMON, OI_FLAGS_DEFAULT, SYNC_ALL ) 
  945. 		 
  946.  
  947. 	end 
  948.  
  949.  
  950.  
  951. end 
  952.  
  953. ------------------------------------ 
  954. -- 
  955. -- Checkpoint thread functions 
  956. -- 
  957. ------------------------------------ 
  958. function mmSummonTutorial_imp_attach_thread( npc ) 
  959.  
  960. 	while( true )do 
  961. 		if( character_has_imp_attached( npc ) == true ) then 
  962. 			turn_vulnerable( npc ) 
  963. 		else 
  964. 			turn_invulnerable( npc ) 
  965. 		end 
  966.  
  967. 		-- Catches npcs which fall into the lava 
  968. 		-- To make extra sure we catch them, also process enemies near the lava (the lava is at about y: 882) 
  969. 		if character_is_in_lava( npc ) or (human_get_pos_y(npc) < 883.0) then 
  970. 			turn_vulnerable( npc ) 
  971. 			character_kill( npc ) 
  972. 		end 
  973.  
  974. 		thread_yield() 
  975. 	end 
  976.  
  977. end 
  978.  
  979. -------------------------------------------------------------------------------------------------- 
  980. 								--[[**********************]]-- 
  981. 								--[[                      ]]-- 
  982. 								--[[   Common functions   ]]-- 
  983. 								--[[                      ]]-- 
  984. 								--[[**********************]]-- 
  985.  
  986. function mmTutorial_cleanup_enemies( wave ) 
  987. 	 
  988. 	-- Cleanup the damage threads 
  989. 	cleanup_threads( wave.damage_threads ) 
  990.  
  991. 	-- Cleanup individual wave members 
  992. 	for i, wave_member in pairs( wave.members ) do 
  993. 		 
  994. 		-- Remove the death callback 
  995. 		on_death( "", wave_member )		 
  996.  
  997. 		-- Remove the respawn callback 
  998. 		on_respawn( "", wave_member ) 
  999. 		on_revived( "", wave_member ) 
  1000.  
  1001. 		-- Remove any object indicators 
  1002. 		marker_remove( wave_member ) 
  1003.  
  1004. 	end 
  1005.  
  1006. 	-- Cleanup individual coop wave members 
  1007. 	for i, wave_member in pairs( wave.coop_only_members ) do	 
  1008.  
  1009. 		-- Remove the death callback 
  1010. 		on_death( "", wave_member )		 
  1011.  
  1012. 		-- Remove the respawn callback 
  1013. 		on_respawn( "", wave_member ) 
  1014. 		on_revived( "", wave_member ) 
  1015.  
  1016. 		-- Remove any object indicators 
  1017. 		marker_remove( wave_member ) 
  1018.  
  1019. 	end 
  1020.  
  1021. end 
  1022.  
  1023. -------------------------------------------------------------------------------------------------- 
  1024. 								--[[**********************]]-- 
  1025. 								--[[                      ]]-- 
  1026. 								--[[  Callback functions  ]]-- 
  1027. 								--[[                      ]]-- 
  1028. 								--[[**********************]]-- 
  1029. local processing_lava_player_local = false 
  1030. local processing_lava_player_remote = false		 
  1031. function mmTutorial_lava_trigger_callback( human, trigger ) 
  1032.  
  1033. 	if human == LOCAL_PLAYER then 
  1034. 		if (processing_lava_player_local == false) then 
  1035. 			-- if we aren't currently trying to warp the player, then warp them 
  1036. 			processing_lava_player_local = true 
  1037.  
  1038. 			delay( 1.0 ) 
  1039. 			fade_out( 0, 0, SYNC_LOCAL ) 
  1040. 			delay( 1.0 ) 
  1041. 			teleport( LOCAL_PLAYER, "Player_start_nav_host" ) 
  1042. 			fade_in( 0, 0, SYNC_LOCAL ) 
  1043. 			 
  1044. 			-- done warping the player 
  1045. 			processing_lava_player_local = false 
  1046. 		end 
  1047.  
  1048. 	elseif human == REMOTE_PLAYER then 
  1049. 		if (processing_lava_player_remote == false) then 
  1050. 			processing_lava_player_remote = true 
  1051. 			-- if we aren't currently trying to warp the player, then warp them 
  1052. 			 
  1053. 			delay( 1.0 ) 
  1054. 			fade_out( 0, 0, SYNC_REMOTE ) 
  1055. 			delay( 1.0 ) 
  1056. 			teleport( REMOTE_PLAYER, "Player_start_nav_client" ) 
  1057. 			fade_in( 0, 0, SYNC_REMOTE ) 
  1058.  
  1059. 			-- done warping the player 
  1060. 			processing_lava_player_remote = false 
  1061. 		end 
  1062. 	end 
  1063. end 
  1064.  
  1065. -------------------------------------------------------------------------------------------------- 
  1066. 								--[[**********************]]-- 
  1067. 								--[[                      ]]-- 
  1068. 								--[[   Thread functions   ]]-- 
  1069. 								--[[                      ]]-- 
  1070. 								--[[**********************]]-- 
  1071. function mmSummonTutorial_summon_reticle_trigger_thread_func( reticle_triggers ) 
  1072.  
  1073. 	while( true )do 
  1074.  
  1075. 		local local_player_reticle_in_trigger = false 
  1076. 		local remote_player_reticle_in_trigger = false 
  1077.  
  1078. 		for i, trigger in pairs( reticle_triggers.triggers ) do 
  1079.  
  1080. 			-- Only test the reticle if we're still false. 
  1081. 			-- That way, if we hit a trigger, and test against another trigger 
  1082. 			-- it won't override the summon permission. 
  1083. 			if local_player_reticle_in_trigger == false then 
  1084. 				local_player_reticle_in_trigger = player_super_power_is_summon_reticle_in_trigger( LOCAL_PLAYER, trigger.name ) 
  1085. 			end 
  1086. 			 
  1087. 			-- Check the co-op player 
  1088. 			if coop_is_active() and remote_player_reticle_in_trigger == false then 
  1089. 				remote_player_reticle_in_trigger = player_super_power_is_summon_reticle_in_trigger( REMOTE_PLAYER, trigger.name ) 
  1090. 			end 
  1091.  
  1092. 		end 
  1093.  
  1094. 		-- Set our "can summon" permissions 
  1095. 		player_super_power_can_summon( LOCAL_PLAYER, local_player_reticle_in_trigger ) 
  1096. 		if coop_is_active() then 
  1097. 			player_super_power_can_summon( REMOTE_PLAYER, remote_player_reticle_in_trigger ) 
  1098. 		end 
  1099. 		 
  1100. 		thread_yield() 
  1101. 	end 
  1102. end