./mflighttutorial.lua

  1.  
  2. --[[ USING THE MISSION START TEMPLATE  
  3. 		1.	Read "SR3 Mission Scripting Standards" if you haven't already. 
  4. 		2.	Save this file as "mFlightTutorial.lua" in the missions directory. 
  5. 		3.	Replace "mFlightTutorial" with the name of your mission (must use the same name as your mission start node). 
  6. 		3a.	Replace "mFlightTutorial" with the capitalized name of your mission 
  7. 		4.	Replace "1-31-2014" with today's date. 
  8. 		5.	Replace "Arturo Mata" with your name. 
  9. 		6.	Replace "Altar" with the name of the first location to go tomFlightTutorial_doflaporbs_collected_1 
  10. 		7.	Replace "fcp with a 3-4 letter abbreviation for the first checkpoint. 
  11. 		8.	Replace "" with the second checkpoint name (first is named start) 
  12. 		9.	Replace "" with a 3-4 letter abbreviation for the next checkpoint. 
  13. 		10.	If you find an error with this template, fix it and check it in!!!! 
  14. 		11.	Remove these instructions.  You're on your own now! 
  15. ]]-- 
  16.  
  17. --[[ 
  18. 	mFlightTutorial.lua 
  19. 	SR3 Mission Script 
  20. 	DATE: 1-31-2014 
  21. 	AUTHOR:	Arturo Mata 
  22. ]]-- 
  23.  
  24.  
  25. -- Tweakable Parameters -- 
  26. MM_1_2_SUPERPOWER_SPRINT = 5 
  27. MM_1_2_SUPERPOWER_JUMP = 6 
  28. SUPERPOWER_BLAST = 3 
  29. PLAYER_SUPERPOWER_BLAST_STONE = 12 
  30. MFLIGHTTUTORIAL_NUM_CLUSTERS = 4 
  31. mImpfest_leash_distance = 400 
  32. -- not tweakable 
  33. iNumberOfFlapsAtStartRemote = 0 
  34. iStartFlapsLocal = 0 
  35. iCurrentFlapsLocal = 0 
  36. iCurrentFlapsRemote = 0 
  37. bMissedFlapOrb_Remote = true 
  38. bMissedFlapOrb_Local = true 
  39. mFlightTutorial_clusters_collected = 0 
  40. mFlightTutorial_FlapVFX_1 = 1 
  41. mFlightTutorial_FlapVFX_2 = 2 
  42. mFlightTutorial_BreadCrumb_1 = 3 
  43. mFlightTutorial_BreadCrumb_2 = 4 
  44. mFlightTutorial_BreadCrumb_3 = 5 
  45. mFlightTutorial_BreadCrumb_4 = 6 
  46. mFlightTutorial_BreadCrumb_5 = 7 
  47. mFlightTutorial_BreadCrumb_6 = 8 
  48. mFlightTutorial_BreadCrumb_7 = 9 
  49. mFlightTutorial_BreadCrumb_8 = 10 
  50. mFlightTutorial_BreadCrumb_9 = 11 
  51. mFlightTutorial_BreadCrumb_10 = 12 
  52. mFlightTutorial_BreadCrumb_11 = 13 
  53. mFlightTutorial_BreadCrumb_12 = 14 
  54. mFlightTutorial_BreadCrumb_13 = 15 
  55. mFlightTutorial_BreadCrumb_14 = 16 
  56. mFlightTutorial_BreadCrumb_15 = 17 
  57. mFlightTutorial_BreadCrumb_16 = 18 
  58. mFlightTutorial_BreadCrumb_17 = 19 
  59. mFlightTutorial_BreadCrumb_18 = 20 
  60. mFlightTutorial_BreadCrumb_19 = 21 
  61. mFlightTutorial_BreadCrumb_20 = 22 
  62. bLOCAL_PLAYER_FLAPPED = false 
  63. bREMOTE_PLAYER_FLAPPED = false 
  64. -------------------------------------------------------------------------------------------------- 
  65. --   _____                            
  66. --  / ____|                           
  67. -- | |  __ _ __ ___  _   _ _ __  ___  
  68. -- | | |_ | '__/ _ \| | | | '_ \/ __| 
  69. -- | |__| | | | (_) | |_| | |_) \__ \ 
  70. --  \_____|_|  \___/ \__,_| .__/|___/ 
  71. --                        | |         
  72. --                        |_|         
  73. -------------------------------------------------------------------------------------------------- 
  74. mFlightTutorial_group =  
  75. { 
  76. 									--[[ startup GROUPS ]]--	 
  77. 									 
  78. 									--[[ Altar GROUPS ]]--	 
  79. 		soul_clusters =  
  80. 		{ 
  81. 			cluster01 = { name = "soul_cluster<001>", }, 
  82. 			cluster02 = { name = "soul_cluster<002>", }, 
  83. 			cluster03 = { name = "soul_cluster<003>", }, 
  84. 			cluster04 = { name = "soul_cluster<004>", }, 
  85. 		}, 
  86.  
  87. 		damned_soul = { 
  88. 			name = "damned_soul_group", 
  89. 			npc = "npc_DamnedSoul", 
  90. 		}, 
  91. 		start_navs = 
  92. 		{ 
  93. 			altar_nav_host = "altar_nav_host", 
  94. 			altar_nav_client = "altar_nav_client", 
  95. 		}, 
  96. 		end_navs = 
  97. 		{ 
  98. 			end_nav_host = "end_nav_host", 
  99. 			end_nav_client = "end_nav_client", 
  100. 		}, 
  101. 		use_flap_orbs = 
  102. 		{ 
  103. 			use_flap_orb_1 = "give_flap_trigger_01", 
  104. 			use_flap_orb_2 = "give_flap_trigger_02", 
  105. 		} 
  106. } 
  107.  
  108. -------------------------------------------------------------------------------------------------- 
  109. --  _______ _                        _      
  110. -- |__   __| |                      | |     
  111. --    | |  | |__  _ __ ___  __ _  __| |___  
  112. --    | |  | '_ \| '__/ _ \/ _` |/ _` / __| 
  113. --    | |  | | | | | |  __/ (_| | (_| \__ \ 
  114. --    |_|  |_| |_|_|  \___|\__,_|\__,_|___/ 
  115. --                                          
  116. -------------------------------------------------------------------------------------------------- 
  117. 	mFlightTutorial_thread = { 
  118. 		lava_trigger_threads = { INVALID_THREAD_HANDLE, INVALID_THREAD_HANDLE }, 
  119. 		tutorial_triggers_threads = { INVALID_THREAD_HANDLE, INVALID_THREAD_HANDLE }, 
  120. 		leash_thread = {INVALID_THREAD_HANDLE, INVALID_THREAD_HANDLE}, 
  121. 		flight_state_machine = {INVALID_THREAD_HANDLE, INVALID_THREAD_HANDLE}, 
  122. 	} 
  123.  
  124. -------------------------------------------------------------------------------------------------- 
  125. --   _____ _               _                _       _        
  126. --  / ____| |             | |              (_)     | |       
  127. -- | |    | |__   ___  ___| | ___ __   ___  _ _ __ | |_ ___  
  128. -- | |    | '_ \ / _ \/ __| |/ / '_ \ / _ \| | '_ \| __/ __| 
  129. -- | |____| | | |  __/ (__|   <| |_) | (_) | | | | | |_\__ \ 
  130. --  \_____|_| |_|\___|\___|_|\_\ .__/ \___/|_|_| |_|\__|___/ 
  131. --                             | |                           
  132. --                             |_|                           
  133. -------------------------------------------------------------------------------------------------- 
  134. 	mFlightTutorial_checkpoint = { 
  135. 		--{ 
  136. 		--	name = MISSION_START_CHECKPOINT,		-- First Checkpoint (fcp) 
  137. 		--	init = "mFlightTutorial_fcp_init",				-- init(bool mission_restart) 
  138. 		--	run = "mFlightTutorial_fcp_run",					-- run() 
  139. 		--	cleanup = "mFlightTutorial_fcp_cleanup",			-- cleanup(bool mission_exit) (+++MUST RETURN IMMEDIATELY+++) 
  140. 		--	next_checkpoint = "mFlightTutorial_orb_nav", 
  141. 		--	host_start = "Player_start_nav_host", 
  142. 		--	client_start = "Player_start_nav_client", 
  143. 		--	p1_car_nav = "", 
  144. 		--	p2_car_nav = "", 
  145. 		--	start_groups = { }, 
  146. 		--	cp_only_groups = { }, 
  147. 		--}, 
  148. 		 
  149. 		{ 
  150. 			name = MISSION_START_CHECKPOINT,		-- Collect Orbs (orb) 
  151. 			init = "mFlightTutorial_orb_init",				-- init(bool mission_restart) 
  152. 			run = "mFlightTutorial_orb_run",					-- run() 
  153. 			cleanup = "mFlightTutorial_orb_cleanup",			-- cleanup(bool mission_exit) (+++MUST RETURN IMMEDIATELY+++) 
  154. 			next_checkpoint = "nil", 
  155. 			host_start = "altar_nav_host", 
  156. 			client_start = "altar_nav_client", 
  157. 			p1_car_nav = "", 
  158. 			p2_car_nav = "", 
  159. 			start_groups = { }, 
  160. 			cp_only_groups = { }, 
  161. 		}, 
  162. 		 
  163. 	} 
  164. 	 
  165. -------------------------------------------------------------------------------------------------- 
  166. --   _____      _                                 
  167. --  / ____|    | |                                
  168. -- | |    _   _| |_ ___  ___ ___ _ __   ___  ___  
  169. -- | |   | | | | __/ __|/ __/ _ \ '_ \ / _ \/ __| 
  170. -- | |___| |_| | |_\__ \ (_|  __/ | | |  __/\__ \ 
  171. --  \_____\__,_|\__|___/\___\___|_| |_|\___||___/ 
  172. --                                                
  173. -------------------------------------------------------------------------------------------------- 
  174. 	mFlightTutorial_scene = { 
  175. 		intro = "", 
  176. 		outro = "Bink_Intro_Hell" 
  177. 	} 
  178.  
  179. -------------------------------------------------------------------------------------------------- 
  180. --   _____                                    _   _                  
  181. --  / ____|                                  | | (_)                 
  182. -- | |     ___  _ ____   _____ _ __ ___  __ _| |_ _  ___  _ __  ___  
  183. -- | |    / _ \| '_ \ \ / / _ \ '__/ __|/ _` | __| |/ _ \| '_ \/ __| 
  184. -- | |___| (_) | | | \ V /  __/ |  \__ \ (_| | |_| | (_) | | | \__ \ 
  185. --  \_____\___/|_| |_|\_/ \___|_|  |___/\__,_|\__|_|\___/|_| |_|___/ 
  186. --                                                                   
  187. -------------------------------------------------------------------------------------------------- 
  188.  
  189. 	mFlightTutorial_persona = {  
  190. 		Johnny = { 
  191. 			persona_name = "Johnny_Gat", 
  192. 			persona_id = INVALID_PERSONA_HANDLE 
  193. 		}, 
  194. 		Dane = { 
  195. 			persona_name = "Dane", 
  196. 			persona_id = INVALID_PERSONA_HANDLE 
  197. 		}, 
  198. 	} 
  199.  
  200. 	mFlightTutorial_convo = { 
  201. 		--[[ = { 
  202. 			name = "file_name without voice (_bm, _wm, _bf...", 
  203. 			player_talks = true or false, 
  204. 			handle = INVALID_CONVERSATION_HANDLE, 
  205. 			convo_thread = INVALID_THREAD_HANDLE, 
  206. 			max_wait_seconds = 60,	-- if the conversation doesn't complete before this time, kill it 
  207. 			timer_thread = INVALID_THREAD_HANDLE, 
  208. 			priority = CONVO_PRIORITY_HIGH or CONVO_PRIORITY_NORMAL or CONVO_PRIORITY_OPTIONAL 
  209. 			(optional) persona_line = true,	-- this is a single line 
  210. 			(required if persona_line) speaker_name = "name of speaker",	-- single line speaker (might be set before call to play is made?) 
  211. 			(optional)phone_call = true,  -- this is a phone conversation (phone persona must be preloaded) 
  212. 			(required if phone_call) receiving_call = true or false  -- auto-answer is always true in missions (until proven otherwise) 
  213. 			 
  214. 		},]] 
  215. 		 
  216. 		charge = { 
  217. 			name = "mFlightTutorial_Charge",  
  218. 			player_talks = false, 
  219. 			handle = INVALID_CONVERSATION_HANDLE, 
  220. 			convo_thread = INVALID_THREAD_HANDLE, 
  221. 			max_wait_seconds = 60, 
  222. 			timer_thread = INVALID_THREAD_HANDLE, 
  223. 			priority = CONVO_PRIORITY_NORMAL, 
  224. 			sync = SYNC_ALL, 
  225. 		}, 
  226. 		-- for top of wall ledge I think "you didn't fuck it up" 
  227. 		dash_end = { 
  228. 			name = "mFlightTutorial_Dash_End",  
  229. 			player_talks = false, 
  230. 			handle = INVALID_CONVERSATION_HANDLE, 
  231. 			convo_thread = INVALID_THREAD_HANDLE, 
  232. 			max_wait_seconds = 60, 
  233. 			timer_thread = INVALID_THREAD_HANDLE, 
  234. 			priority = CONVO_PRIORITY_NORMAL, 
  235. 			sync = SYNC_ALL, 
  236. 		}, 
  237.  
  238. 		dive_start = { 
  239. 			name = "mFlightTutorial_Dive_Start",  
  240. 			player_talks = false, 
  241. 			handle = INVALID_CONVERSATION_HANDLE, 
  242. 			convo_thread = INVALID_THREAD_HANDLE, 
  243. 			max_wait_seconds = 60, 
  244. 			timer_thread = INVALID_THREAD_HANDLE, 
  245. 			priority = CONVO_PRIORITY_NORMAL, 
  246. 			sync = SYNC_ALL, 
  247. 		}, 
  248.  
  249. 		flight_end = { 
  250. 			name = "mFlightTutorial_End",  
  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. 			sync = SYNC_ALL, 
  258. 		}, 
  259. 		fail_a = { 
  260. 			name = "mFlightTutorial_FailA",  
  261. 			player_talks = false, 
  262. 			handle = INVALID_CONVERSATION_HANDLE, 
  263. 			convo_thread = INVALID_THREAD_HANDLE, 
  264. 			max_wait_seconds = 60, 
  265. 			timer_thread = INVALID_THREAD_HANDLE, 
  266. 			priority = CONVO_PRIORITY_NORMAL, 
  267. 			sync = SYNC_ALL, 
  268. 		}, 
  269. 		fail_b = { 
  270. 			name = "mFlightTutorial_FailB",  
  271. 			player_talks = false, 
  272. 			handle = INVALID_CONVERSATION_HANDLE, 
  273. 			convo_thread = INVALID_THREAD_HANDLE, 
  274. 			max_wait_seconds = 60, 
  275. 			timer_thread = INVALID_THREAD_HANDLE, 
  276. 			priority = CONVO_PRIORITY_NORMAL, 
  277. 			sync = SYNC_ALL, 
  278. 		}, 
  279. 		fall = { 
  280. 			name = "mFlightTutorial_Fall",  
  281. 			player_talks = false, 
  282. 			handle = INVALID_CONVERSATION_HANDLE, 
  283. 			convo_thread = INVALID_THREAD_HANDLE, 
  284. 			max_wait_seconds = 60, 
  285. 			timer_thread = INVALID_THREAD_HANDLE, 
  286. 			priority = CONVO_PRIORITY_NORMAL, 
  287. 			sync = SYNC_ALL, 
  288. 		}, 
  289. 		flap = { 
  290. 			name = "mFlightTutorial_Flap",  
  291. 			player_talks = false, 
  292. 			handle = INVALID_CONVERSATION_HANDLE, 
  293. 			convo_thread = INVALID_THREAD_HANDLE, 
  294. 			max_wait_seconds = 60, 
  295. 			timer_thread = INVALID_THREAD_HANDLE, 
  296. 			priority = CONVO_PRIORITY_NORMAL, 
  297. 			sync = SYNC_ALL, 
  298. 		}, 
  299. 		flap_nag = { 
  300. 			name = "mFlightTutorial_Flap_Nag",  
  301. 			player_talks = false, 
  302. 			handle = INVALID_CONVERSATION_HANDLE, 
  303. 			convo_thread = INVALID_THREAD_HANDLE, 
  304. 			max_wait_seconds = 60, 
  305. 			timer_thread = INVALID_THREAD_HANDLE, 
  306. 			priority = CONVO_PRIORITY_NORMAL, 
  307. 			sync = SYNC_ALL, 
  308. 		}, 
  309. 		flight_nag = { 
  310. 			name = "mFlightTutorial_Flight_Nag",  
  311. 			player_talks = false, 
  312. 			handle = INVALID_CONVERSATION_HANDLE, 
  313. 			convo_thread = INVALID_THREAD_HANDLE, 
  314. 			max_wait_seconds = 60, 
  315. 			timer_thread = INVALID_THREAD_HANDLE, 
  316. 			priority = CONVO_PRIORITY_NORMAL, 
  317. 			sync = SYNC_ALL, 
  318. 		}, 
  319. 		flight_start = { 
  320. 			name = "mFlightTutorial_Flight_Start",  
  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. 			sync = SYNC_ALL, 
  328. 		}, 
  329. 		flight_variant = { 
  330. 			name = "mFlightTutorial_Flight_Variant",  
  331. 			player_talks = false, 
  332. 			handle = INVALID_CONVERSATION_HANDLE, 
  333. 			convo_thread = INVALID_THREAD_HANDLE, 
  334. 			max_wait_seconds = 60, 
  335. 			timer_thread = INVALID_THREAD_HANDLE, 
  336. 			priority = CONVO_PRIORITY_NORMAL, 
  337. 			sync = SYNC_ALL, 
  338. 		}, 
  339. 		get_boost = { 
  340. 			name = "mFlightTutorial_Get_Boost",  
  341. 			player_talks = false, 
  342. 			handle = INVALID_CONVERSATION_HANDLE, 
  343. 			convo_thread = INVALID_THREAD_HANDLE, 
  344. 			max_wait_seconds = 60, 
  345. 			timer_thread = INVALID_THREAD_HANDLE, 
  346. 			priority = CONVO_PRIORITY_NORMAL, 
  347. 			sync = SYNC_ALL, 
  348. 		}, 
  349. 		give_flap = { 
  350. 			name = "mFlightTutorial_GiveFlap",  
  351. 			player_talks = false, 
  352. 			handle = INVALID_CONVERSATION_HANDLE, 
  353. 			convo_thread = INVALID_THREAD_HANDLE, 
  354. 			max_wait_seconds = 60, 
  355. 			timer_thread = INVALID_THREAD_HANDLE, 
  356. 			priority = CONVO_PRIORITY_NORMAL, 
  357. 			sync = SYNC_ALL, 
  358. 		}, 
  359. 		helper_first = { 
  360. 			name = "mFlightTutorial_Helper_First",  
  361. 			player_talks = false, 
  362. 			handle = INVALID_CONVERSATION_HANDLE, 
  363. 			convo_thread = INVALID_THREAD_HANDLE, 
  364. 			max_wait_seconds = 60, 
  365. 			timer_thread = INVALID_THREAD_HANDLE, 
  366. 			priority = CONVO_PRIORITY_NORMAL, 
  367. 			sync = SYNC_ALL, 
  368. 		}, 
  369. 		helper_nag = { 
  370. 			name = "mFlightTutorial_Helper_Nag",  
  371. 			player_talks = false, 
  372. 			handle = INVALID_CONVERSATION_HANDLE, 
  373. 			convo_thread = INVALID_THREAD_HANDLE, 
  374. 			max_wait_seconds = 60, 
  375. 			timer_thread = INVALID_THREAD_HANDLE, 
  376. 			priority = CONVO_PRIORITY_NORMAL, 
  377. 			sync = SYNC_ALL, 
  378. 		}, 
  379. 		helper_second = { 
  380. 			name = "mFlightTutorial_Helper_Second",  
  381. 			player_talks = false, 
  382. 			handle = INVALID_CONVERSATION_HANDLE, 
  383. 			convo_thread = INVALID_THREAD_HANDLE, 
  384. 			max_wait_seconds = 60, 
  385. 			timer_thread = INVALID_THREAD_HANDLE, 
  386. 			priority = CONVO_PRIORITY_NORMAL, 
  387. 			sync = SYNC_ALL, 
  388. 		}, 
  389. 		missed_boost = { 
  390. 			name = "mFlightTutorial_Missed_Boost",  
  391. 			player_talks = false, 
  392. 			handle = INVALID_CONVERSATION_HANDLE, 
  393. 			convo_thread = INVALID_THREAD_HANDLE, 
  394. 			max_wait_seconds = 60, 
  395. 			timer_thread = INVALID_THREAD_HANDLE, 
  396. 			priority = CONVO_PRIORITY_NORMAL, 
  397. 			sync = SYNC_ALL,		 
  398. 		}, 
  399. 		powerup = { 
  400. 			name = "mFlightTutorial_Powerup",  
  401. 			player_talks = false, 
  402. 			handle = INVALID_CONVERSATION_HANDLE, 
  403. 			convo_thread = INVALID_THREAD_HANDLE, 
  404. 			max_wait_seconds = 60, 
  405. 			timer_thread = INVALID_THREAD_HANDLE, 
  406. 			priority = CONVO_PRIORITY_NORMAL, 
  407. 			sync = SYNC_ALL,		 
  408. 		}, 
  409. 		start = { 
  410. 			name = "mFlightTutorial_Start",  
  411. 			player_talks = false, 
  412. 			handle = INVALID_CONVERSATION_HANDLE, 
  413. 			convo_thread = INVALID_THREAD_HANDLE, 
  414. 			max_wait_seconds = 60, 
  415. 			timer_thread = INVALID_THREAD_HANDLE, 
  416. 			priority = CONVO_PRIORITY_NORMAL, 
  417. 			sync = SYNC_ALL,		 
  418. 		}, 
  419. 		turn = { 
  420. 			name = "mFlightTutorial_Turn",  
  421. 			player_talks = false, 
  422. 			handle = INVALID_CONVERSATION_HANDLE, 
  423. 			convo_thread = INVALID_THREAD_HANDLE, 
  424. 			max_wait_seconds = 60, 
  425. 			timer_thread = INVALID_THREAD_HANDLE, 
  426. 			priority = CONVO_PRIORITY_NORMAL, 
  427. 			sync = SYNC_ALL, 
  428. 		}, 
  429. 		use_flap = { 
  430. 			name = "mFlightTutorial_Use_Flap",  
  431. 			player_talks = false, 
  432. 			handle = INVALID_CONVERSATION_HANDLE, 
  433. 			convo_thread = INVALID_THREAD_HANDLE, 
  434. 			max_wait_seconds = 60, 
  435. 			timer_thread = INVALID_THREAD_HANDLE, 
  436. 			priority = CONVO_PRIORITY_NORMAL, 
  437. 			sync = SYNC_ALL, 
  438. 		}, 
  439. 		wall_jump = { 
  440. 			name = "mFlightTutorial_Wall_Jump",  
  441. 			player_talks = false, 
  442. 			handle = INVALID_CONVERSATION_HANDLE, 
  443. 			convo_thread = INVALID_THREAD_HANDLE, 
  444. 			max_wait_seconds = 60, 
  445. 			timer_thread = INVALID_THREAD_HANDLE, 
  446. 			priority = CONVO_PRIORITY_NORMAL, 
  447. 			sync = SYNC_ALL, 
  448. 		}, 
  449. 		transition = { 
  450. 			name = "mFlightTutorial_Transition",  
  451. 			player_talks = false, 
  452. 			handle = INVALID_CONVERSATION_HANDLE, 
  453. 			convo_thread = INVALID_THREAD_HANDLE, 
  454. 			max_wait_seconds = 60, 
  455. 			timer_thread = INVALID_THREAD_HANDLE, 
  456. 			priority = CONVO_PRIORITY_NORMAL, 
  457. 			sync = SYNC_ALL, 
  458. 		},		 
  459. 		--fail_gat = { 
  460. 		--	name = "mFlightTutorial_Fail_Gat",  
  461. 		--	player_talks = false, 
  462. 		--	handle = INVALID_CONVERSATION_HANDLE, 
  463. 		--	convo_thread = INVALID_THREAD_HANDLE, 
  464. 		--	max_wait_seconds = 60, 
  465. 		--	timer_thread = INVALID_THREAD_HANDLE, 
  466. 		--	priority = CONVO_PRIORITY_NORMAL, 
  467. 		--}, 
  468. 		--	 
  469. 		--fail_kinzie = { 
  470. 		--	name = "mFlightTutorial_Fail_KZ",  
  471. 		--	player_talks = false, 
  472. 		--	handle = INVALID_CONVERSATION_HANDLE, 
  473. 		--	convo_thread = INVALID_THREAD_HANDLE, 
  474. 		--	max_wait_seconds = 60, 
  475. 		--	timer_thread = INVALID_THREAD_HANDLE, 
  476. 		--	priority = CONVO_PRIORITY_NORMAL, 
  477. 		--}, 
  478. 		--	 
  479. 		--leash_gat = { 
  480. 		--	name = "mFlightTutorial_Leash_Gat",  
  481. 		--	player_talks = false, 
  482. 		--	handle = INVALID_CONVERSATION_HANDLE, 
  483. 		--	convo_thread = INVALID_THREAD_HANDLE, 
  484. 		--	max_wait_seconds = 60, 
  485. 		--	timer_thread = INVALID_THREAD_HANDLE, 
  486. 		--	priority = CONVO_PRIORITY_NORMAL, 
  487. 		--}, 
  488. 		--	 
  489. 		--leash_kinzie = { 
  490. 		--	name = "mFlightTutorial_Leash_KZ",  
  491. 		--	player_talks = false, 
  492. 		--	handle = INVALID_CONVERSATION_HANDLE, 
  493. 		--	convo_thread = INVALID_THREAD_HANDLE, 
  494. 		--	max_wait_seconds = 60, 
  495. 		--	timer_thread = INVALID_THREAD_HANDLE, 
  496. 		--	priority = CONVO_PRIORITY_NORMAL, 
  497. 		--}, 
  498. 	} 
  499. 	 
  500. 	mFlightTutorial_convo_queue = { 
  501. 		--[[start_drive_queue = {  
  502. 			{ delay = 2.0, convo = mFlightTutorial_convo.goto_Altar }, 
  503. 			{ delay = 4.0, convo = mFlightTutorial_convo.goto_Altar2 }, 
  504. 			{ delay = 3.0, convo = mFlightTutorial_convo.goto_Altar3 }, 
  505. 			{ delay = 5.0, convo = mFlightTutorial_convo.goto_Altar4 } 
  506. 		}, 
  507. 		]]-- 
  508. 	} 
  509. 	 
  510. -------------------------------------------------------------------------------------------------- 
  511. --  _______   _                            
  512. -- |__   __| (_)                           
  513. --    | |_ __ _  __ _  __ _  ___ _ __ ___  
  514. --    | | '__| |/ _` |/ _` |/ _ \ '__/ __| 
  515. --    | | |  | | (_| | (_| |  __/ |  \__ \ 
  516. --    |_|_|  |_|\__, |\__, |\___|_|  |___/ 
  517. --               __/ | __/ |               
  518. --              |___/ |___/     
  519. -------------------------------------------------------------------------------------------------- 
  520. 	 
  521. 	-- Custom waypoint marker for triggers which isn't synced 
  522. 	-- so that each player can see their progress independently. 
  523. 	FLIGHTTUT_CUSTOM_TRIGGER_LOCATION = { 
  524. 		minimap_icon_name = MINIMAP_ICON_LOCATION, 
  525. 		ingame_effect_name = INGAME_EFFECT_LOCATION, 
  526. 		object_indicator_id = OI_ASSET_LOCATION, 
  527. 		object_indicator_flags = OI_FLAGS_LOCATION, 
  528. 	} 
  529.  
  530. 	mFlightTutorial_trigger = { 
  531. 		-- = { 
  532. 		--	name = "_trigger", 
  533. 		--	hit = false, 
  534. 		-- 	last_hit_by = nil, -- 	last_hit_human = nil (set to the last human to enter the trigger in the default trigger callback) 
  535. 		--  (optional)callback = "mFlightTutorial_function_name_cb" 
  536. 		--	(optional)marker = TRIGGER_LOCATION or TRIGGER_USE or custom or don't include for no marker 
  537. 		--  (optional)waypoint = true, 
  538. 		--  (optional)teleport_to = { 
  539. 		--						host = "host_nav", 
  540. 		--						client = "client_nav"  
  541. 		--					},		 
  542. 		--	(optional)conversation = mFlightTutorial_convo.convo_name  -- play a conversation 
  543. 		--	(optional)next_trigger = "next_trigger_name" sets up next trigger when triggered (breadcrumbs) 
  544. 		--}, 
  545. 		 
  546. 		 
  547. 						--[[ Ultor TRIGGERS ]]-- 
  548. 									 
  549. 			ultor_jump_off_trigger = { 
  550. 			name = "ultor_jump_off_trigger", 
  551. 			hit = false, 
  552. 			waypoint = false, 
  553. 			callback = "mFlightTutorial_ultor_jump_off_trigger_callback", 
  554. 			},	 
  555.  
  556. 									 
  557. 			ultor_teleport_trigger = { 
  558. 			name = "ultor_teleport_trigger", 
  559. 			hit = false, 
  560. 			waypoint = false, 
  561. 			callback = "mFlightTutorial_ultor_teleport_trigger_cb", 
  562. 			},	 
  563.  
  564. 			ultor_super_movement_trigger = { 
  565. 			name = "ultor_super_movement_trigger", 
  566. 			hit = false, 
  567. 			waypoint = false, 
  568. 			}, 
  569.  
  570. 						--[[ Lava TRIGGERS ]]-- 
  571. 									 
  572. 			lava_trigger = { 
  573. 			name = "lava_trigger", 
  574. 			hit = false, 
  575. 			waypoint = false, 
  576. 			callback = "mFlightTutorial_lava_trigger_callback", 
  577. 			}, 
  578. 			missed_flap_trigger_1 = { 
  579. 			name = "missed_flap_trigger_01", 
  580. 			hit = false, 
  581. 			waypoint = false, 
  582. 			callback = "mFlightTutorial_missed_flap_trigger_1_cb", 
  583. 			},	 
  584. 						--[[ Altar TRIGGERS ]]-- 
  585. 									 
  586. 			--altar_trigger = { 
  587. 			--name = "altar_trigger", 
  588. 			--hit = false, 
  589. 			--marker = TRIGGER_USE, 
  590. 			--disabled = true, 
  591. 			--anim_action = "hadouken", 
  592. 			--callback = "mFlightTutorial_altar_trigger_cb", 
  593. 			--}, 
  594.  
  595. 						--[[ Jump TRIGGERS ]]--									 
  596. 			jump_trigger_01 = { 
  597. 			name = "jump_trigger_01", 
  598. 			hit = false, 
  599. 			waypoint = false, 
  600. 			callback = "mFlightTutorial_trigger_cb" 
  601. 			}, 
  602.  
  603. 					--[[ Run-Jump TRIGGERS ]]--									 
  604. 			runningjump_trigger_01 = { 
  605. 			name = "runningjump_trigger_01", 
  606. 			hit = false, 
  607. 			waypoint = false, 
  608. 			callback = "mFlightTutorial_trigger_cb" 
  609. 			}, 
  610.  
  611. 					--[[ Wall Jump TRIGGERS ]]--									 
  612. 			walljump_trigger_01 = { 
  613. 			name = "walljump_trigger_01", 
  614. 			hit = false, 
  615. 			waypoint = false, 
  616. 			callback = "mFlightTutorial_trigger_cb" 
  617. 			}, 
  618.  
  619. 			--orb triggers 
  620. 			Bread_Crumb_Trigger_01 = { 
  621. 				name = "Bread_Crumb_Trigger<001>", 
  622. 				hit = false, 
  623. 				waypoint = false, 
  624. 				callback = "mFlighTutorial_breadcrumb_1" 
  625. 			}, 
  626. 			Bread_Crumb_Trigger_02 = { 
  627. 				name = "Bread_Crumb_Trigger<002>", 
  628. 				hit = false, 
  629. 				waypoint = false, 
  630. 				callback = "mFlighTutorial_breadcrumb_2" 
  631. 			}, 
  632. 			Bread_Crumb_Trigger_03 = { 
  633. 				name = "Bread_Crumb_Trigger<003>", 
  634. 				hit = false, 
  635. 				waypoint = false, 
  636. 				callback = "mFlighTutorial_breadcrumb_3" 
  637. 			}, 
  638. 			Bread_Crumb_Trigger_04 = { 
  639. 				name = "Bread_Crumb_Trigger<004>", 
  640. 				hit = false, 
  641. 				waypoint = false, 
  642. 				callback = "mFlighTutorial_breadcrumb_4" 
  643. 			}, 
  644. 			Bread_Crumb_Trigger_05 = { 
  645. 				name = "Bread_Crumb_Trigger<005>", 
  646. 				hit = false, 
  647. 				waypoint = false, 
  648. 				callback = "mFlighTutorial_breadcrumb_5" 
  649. 			}, 
  650. 			Bread_Crumb_Trigger_06 = { 
  651. 				name = "Bread_Crumb_Trigger<006>", 
  652. 				hit = false, 
  653. 				waypoint = false, 
  654. 				callback = "mFlighTutorial_breadcrumb_6" 
  655. 			}, 
  656. 			Bread_Crumb_Trigger_07 = { 
  657. 				name = "Bread_Crumb_Trigger<007>", 
  658. 				hit = false, 
  659. 				waypoint = false, 
  660. 				callback = "mFlighTutorial_breadcrumb_7" 
  661. 			}, 
  662. 			Bread_Crumb_Trigger_08 = { 
  663. 				name = "Bread_Crumb_Trigger<008>", 
  664. 				hit = false, 
  665. 				waypoint = false, 
  666. 				callback = "mFlighTutorial_breadcrumb_8" 
  667. 			}, 
  668. 			Bread_Crumb_Trigger_09 = { 
  669. 				name = "Bread_Crumb_Trigger<009>", 
  670. 				hit = false, 
  671. 				waypoint = false, 
  672. 				callback = "mFlighTutorial_breadcrumb_9" 
  673. 			}, 
  674. 			Bread_Crumb_Trigger_10 = { 
  675. 				name = "Bread_Crumb_Trigger<010>", 
  676. 				hit = false, 
  677. 				waypoint = false, 
  678. 				callback = "mFlighTutorial_breadcrumb_10" 
  679. 			}, 
  680. 			Bread_Crumb_Trigger_11 = { 
  681. 				name = "Bread_Crumb_Trigger<011>", 
  682. 				hit = false, 
  683. 				waypoint = false, 
  684. 				callback = "mFlighTutorial_breadcrumb_11" 
  685. 			}, 
  686. 			Bread_Crumb_Trigger_12 = { 
  687. 				name = "Bread_Crumb_Trigger<012>", 
  688. 				hit = false, 
  689. 				waypoint = false, 
  690. 				callback = "mFlighTutorial_breadcrumb_12" 
  691. 			}, 
  692. 			Bread_Crumb_Trigger_13 = { 
  693. 				name = "Bread_Crumb_Trigger<013>", 
  694. 				hit = false, 
  695. 				waypoint = false, 
  696. 				callback = "mFlighTutorial_breadcrumb_13" 
  697. 			}, 
  698. 			Bread_Crumb_Trigger_14 = { 
  699. 				name = "Bread_Crumb_Trigger<014>", 
  700. 				hit = false, 
  701. 				waypoint = false, 
  702. 				callback = "mFlighTutorial_breadcrumb_14" 
  703. 			}, 
  704. 			Bread_Crumb_Trigger_15 = { 
  705. 				name = "Bread_Crumb_Trigger<015>", 
  706. 				hit = false, 
  707. 				waypoint = false, 
  708. 				callback = "mFlighTutorial_breadcrumb_15" 
  709. 			}, 
  710. 			Bread_Crumb_Trigger_16 = { 
  711. 				name = "Bread_Crumb_Trigger<016>", 
  712. 				hit = false, 
  713. 				waypoint = false, 
  714. 				callback = "mFlighTutorial_breadcrumb_16" 
  715. 			}, 
  716. 			Bread_Crumb_Trigger_17 = { 
  717. 				name = "Bread_Crumb_Trigger<017>", 
  718. 				hit = false, 
  719. 				waypoint = false, 
  720. 				callback = "mFlighTutorial_breadcrumb_17" 
  721. 			}, 
  722. 			Bread_Crumb_Trigger_18 = { 
  723. 				name = "Bread_Crumb_Trigger<018>", 
  724. 				hit = false, 
  725. 				waypoint = false, 
  726. 				callback = "mFlighTutorial_breadcrumb_18" 
  727. 			}, 
  728. 			Bread_Crumb_Trigger_19 = { 
  729. 				name = "Bread_Crumb_Trigger<019>", 
  730. 				hit = false, 
  731. 				waypoint = false, 
  732. 				callback = "mFlighTutorial_breadcrumb_19" 
  733. 			}, 
  734. 			Bread_Crumb_Trigger_20 = { 
  735. 				name = "Bread_Crumb_Trigger<020>", 
  736. 				hit = false, 
  737. 				waypoint = false, 
  738. 				callback = "mFlighTutorial_breadcrumb_20" 
  739. 			}, 
  740. 			--[[ Glide TRIGGERS ]]-- 
  741. 			glide_trigger_01 = { 
  742. 			name = "glide_trigger_01", 
  743. 			hit = false, 
  744. 			waypoint = false, 
  745. 			callback = "mFlightTutorial_trigger_cb" 
  746. 			}, 
  747.  
  748. 			give_flap_trigger_01 = { 
  749. 			name = "give_flap_trigger_01", 
  750. 			hit = false, 
  751. 			waypoint = false, 
  752. 			callback = "mFlightTutorial_do_flap_cb_1", 
  753.  
  754. 			}, 
  755. 			give_flap_trigger_02 = { 
  756. 			name = "give_flap_trigger_02", 
  757. 			hit = false, 
  758. 			waypoint = false, 
  759. 			callback = "mFlightTutorial_do_flap_cb_2", 
  760.  
  761. 			}, 
  762. 						--[[ Flap TRIGGERS ]]-- 
  763. 			flap_trigger_01 = { 
  764. 			name = "flap_trigger_01", 
  765. 			hit = false, 
  766. 			waypoint = false, 
  767. 			callback = "mFlightTutorial_trigger_cb" 
  768. 			}, 
  769.  
  770. 						--[[ Dive TRIGGERS ]]-- 
  771. 			dive_trigger_01 = { 
  772. 			name = "dive_trigger_01", 
  773. 			hit = false, 
  774. 			waypoint = false, 
  775. 			callback = "mFlightTutorial_trigger_cb" 
  776. 			}, 
  777.  
  778. 						--[[ Climb TRIGGERS ]]-- 
  779. 			climb_trigger_01 = { 
  780. 			name = "climb_trigger_01", 
  781. 			hit = false, 
  782. 			waypoint = false, 
  783. 			callback = "mFlightTutorial_trigger_cb" 
  784. 			}, 
  785. 						--[[ Turn TRIGGERS ]]-- 
  786. 			turn_trigger_01 = { 
  787. 			name = "turn_trigger_01", 
  788. 			hit = false, 
  789. 			waypoint = false, 
  790. 			callback = "mFlightTutorial_trigger_cb" 
  791. 			}, 
  792. 			 
  793. 						--[[ End TRIGGERS ]]-- 
  794. 			end_trigger = { 
  795. 			name = "end_mission_trigger", 
  796. 			hit = false, 
  797. 			marker = TRIGGER_LOCATION, 
  798. 			waypoint = false, 
  799. 			}, 
  800.  
  801. 	} 
  802. 	 
  803. -------------------------------------------------------------------------------------------------- 
  804. --   _____ _       _           _      
  805. --  / ____| |     | |         | |     
  806. -- | |  __| | ___ | |__   __ _| |___  
  807. -- | | |_ | |/ _ \| '_ \ / _` | / __| 
  808. -- | |__| | | (_) | |_) | (_| | \__ \ 
  809. --  \_____|_|\___/|_.__/ \__,_|_|___/ 
  810. --                                    
  811. --                                    
  812. -------------------------------------------------------------------------------------------------- 
  813. mFlightTutorial_players = {} 
  814. mLastIslandTriggered_Local = "altar_nav_host" 
  815. mLastIslandTriggered_Remote = "altar_nav_client" 
  816. mLocalTurnTriggerHit = false 
  817. mRemoteTurnTriggerHit = false 
  818. mFlightTutorial_UsePlayerLeash = true 
  819.  
  820. -- Indicates which is the farthest island we've reached 
  821. g_nCurrentNavpointNumber = 0 
  822. mFlightTutorial_RespawnNavpoints = { 
  823. 	["jump_respawn_nav_host"]			= 1, 
  824. 	["walljump_respawn_nav_host"]		= 2, 
  825. 	["runningjump_respawn_nav_host"]	= 3, 
  826. 	["glide_respawn_nav_host"]			= 4, 
  827. 	["give_flap_nav_host"]				= 5, 
  828. 	["dive_respawn_nav_host"]			= 6, 
  829. 	["flap_respawn_nav_host"]			= 7, 
  830. 	["climb_respawn_nav_host"]			= 8, 
  831. 	["turn_respawn_nav_host"]			= 9, 
  832. } 
  833.  
  834. mFlightTutorial_powers_tutorial = { 
  835. 	{ 
  836. 		purchased = false, 
  837. 		finished = false, 
  838. 	}, 
  839. 	{ 
  840. 		purchased = true, 
  841. 		finished = true, 
  842. 	}, 
  843. } 
  844.  
  845.  
  846. -------------------------------------------------------------------------------------------------- 
  847. -- __      __________   __ 
  848. -- \ \    / /  ____\ \ / / 
  849. --  \ \  / /| |__   \ V /  
  850. --   \ \/ / |  __|   > <   
  851. --    \  /  | |     / . \  
  852. --     \/   |_|    /_/ \_\ 
  853. --                         
  854. --------------------------------------------------------------------------------------------------	 
  855. mFlightTutorial_vfx_list = { 
  856.  
  857. 	power_up = { name = "vfx_Altars_PowerUp", handle = "" }, 
  858. 	teleport = { name = "Vfx_Hell_Teleport", handle = "" }, 
  859. } 
  860.  
  861. -------------------------------------------------------------------------------------------------- 
  862. --                 _                 _   _                  
  863. --     /\         (_)               | | (_)                 
  864. --    /  \   _ __  _ _ __ ___   __ _| |_ _  ___  _ __  ___  
  865. --   / /\ \ | '_ \| | '_ ` _ \ / _` | __| |/ _ \| '_ \/ __| 
  866. --  / ____ \| | | | | | | | | | (_| | |_| | (_) | | | \__ \ 
  867. -- /_/    \_\_| |_|_|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/ 
  868. --                                                          
  869. --------------------------------------------------------------------------------------------------	 
  870. mFlightTutorial_animation_list = { 
  871.  
  872. 	clusters_collected = { anim_action_name = "hadouken" }, 
  873.  
  874. } 
  875.  
  876. -------------------------------------------------------------------------------------------------- 
  877. 								--[[**********************]]-- 
  878. 								--[[                      ]]-- 
  879. 								--[[  Standard functions  ]]-- 
  880. 								--[[                      ]]-- 
  881. 								--[[**********************]]-- 
  882.  
  883. -- This is the primary entry point for the mission, and is responsible for starting up the mission 
  884. -- at the specified checkpoint. 
  885. -- CALLED FROM CODE 
  886. -- 
  887. -- start_checkpoint_name:	(string) The checkpoint the mission should begin at 
  888. -- is_restart:					(bool) TRUE if the mission is restarting, FALSE otherwise 
  889. -- 
  890. function mFlightTutorial_start(start_checkpoint_name, is_restart) 
  891. 	mission_start_fade_out(0.0) 
  892. 	collectible_hide_orbs(true) 
  893.  
  894. 	-- Disable the default tutorial nags 
  895. 	tutorial_lock("super_jump_1") 
  896. 	tutorial_lock("super_jump_2") 
  897. 	tutorial_lock("jump_climb") 
  898.  
  899. 	-- initialize systems 
  900. 	mission_startup(mFlightTutorial_trigger, mFlightTutorial_convo) -- mFlightTutorial_checkpoint 
  901. 	load_persona(mFlightTutorial_persona.Dane) 
  902. 	 
  903. 	-- HVS_BDF: we don't necessarily want to call load_persona() because this creates a 2D 
  904. 	-- version, which can prevent actual in-game characters from lip syncing their VO if 
  905. 	-- the 2D persona was loaded prior to their character being spawned. 
  906. 	-- In the case of PC characters, they are present in the world and should lip sync their VO. 
  907. 	--load_persona(mIntro_persona.Johnny) 
  908.  
  909. 	-- if using interrogations 
  910. 	--interrogate_startup(mFlightTutorial_interrogate) 
  911. 	 
  912. 	local start_cp = get_table_by_name(mFlightTutorial_checkpoint, MISSION_START_CHECKPOINT) 
  913.  
  914. 	-- Check if this mission starting from the beginning 
  915. 	if (start_checkpoint_name == start_cp.name) then 
  916. 		if (is_restart == false and mFlightTutorial_scene.intro ~= "") then 
  917. 			-- First time playing mission 
  918. 			local fade_in_after = false 
  919. 			cutscene_play(mFlightTutorial_scene.intro, nil, {"altar_nav_host", "altar_nav_client" }, fade_in_after) 
  920. 		else 
  921. 		teleport_coop(mFlightTutorial_group.start_navs.altar_nav_host, mFlightTutorial_group.start_navs.altar_nav_client, true) 
  922. 		end 
  923. 		fade_out(0) 
  924. 	end 
  925.  
  926. 	-- Remove any flaps we awarded. 
  927. --	super_jump_set_flap_max( 0, SYNC_LOCAL, false ) 
  928. 	 
  929. 	if coop_is_active() then 
  930. --		super_jump_set_flap_max( 0, SYNC_REMOTE, false ) 
  931. 	end 
  932.  
  933. 	-- Handle mission initialization for the current checkpoint 
  934. 	mFlightTutorial_initialize(start_checkpoint_name) 
  935.  
  936. 	-- Run the mission from the current checkpoint 
  937. 	checkpoint_run_mission(mFlightTutorial_checkpoint, start_checkpoint_name) 
  938. 	 
  939. 	mFlightTutorial_success() 
  940.  
  941. 	mission_end_success("mFlightTutorial")--, nil, "end_nav_host", "end_nav_remote") 
  942. end 
  943.  
  944. -- This is the primary function responsible for cleaning up the entire mission 
  945. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
  946. -- 
  947. function mFlightTutorial_cleanup() 
  948. 	--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]--	 
  949.  
  950. 		-- Enable the default tutorial nags 
  951. 	tutorial_unlock("super_jump_1") 
  952. 	tutorial_unlock("super_jump_2") 
  953. 	tutorial_unlock("jump_climb") 
  954.  
  955.  
  956. 	flight_tutorial_stamina(false, LOCAL_PLAYER) 
  957. 	if(coop_is_active()) then 
  958. 		flight_tutorial_stamina(false, REMOTE_PLAYER) 
  959. 	end 
  960. 	-- restore normal jump height 
  961. 	tweak_table_restore_value ("Jump_super_max_height_scripted") 
  962. 	player_super_power_set_wall_jump_and_sprint_disabled(false, false, LOCAL_PLAYER) 
  963. 	if(coop_is_active()) then 
  964. 		player_super_power_set_wall_jump_and_sprint_disabled(false, false, REMOTE_PLAYER) 
  965. 	end 
  966. 	player_super_movement_enable(true) 
  967. 	player_super_attacks_enable(true) 
  968. 	unlockable_lock("Glide_Power_2", SYNC_ALL) 
  969. 	temp_restore_flight_power() 
  970. 	if(coop_is_active()) then 
  971. 		if (iNumberOfFlapsAtStartRemote > 1) then 
  972. 			--iCurrentFlapsRemote = iNumberOfFlapsAtStartRemote 
  973. 			super_jump_set_flap_max( iNumberOfFlapsAtStartRemote, SYNC_REMOTE, true ) 
  974.  
  975. 		end 
  976. 		 
  977. 	end 
  978. 	 
  979. 	if (iStartFlapsLocal > 1) then 
  980. 		super_jump_set_flap_max( iStartFlapsLocal, SYNC_LOCAL, true ) 
  981. 	end 
  982. 	-- Swap back to the city 
  983. 	city_zone_swap( "u_train", false ) 
  984.  
  985. 	-- cleanup all threads 
  986. 	cleanup_threads(mFlightTutorial_thread) 
  987. 	 
  988. 	-- run checkpoint cleanups (move into mission_shutdown?) 
  989. 	checkpoint_cleanup_mission(mFlightTutorial_checkpoint) 
  990.  
  991. 	-- HVS_RCK - This is intentional. We want to start the challenges tutorial as this mission is ending. That unlocks the challenges menu. 
  992. 	if not mission_is_failed() then 
  993. 		hud_prompt(LOCAL_PLAYER, "MM_1_1_OBJ_ACCESS_HUB", "", true) 
  994. 		if coop_is_active() then 
  995. 			hud_prompt(REMOTE_PLAYER, "MM_1_1_OBJ_ACCESS_HUB", "", true) 
  996. 		end 
  997. 		challenge_tutorial_set_active(true) 
  998. 	end 
  999.  
  1000. 	-- cleanup triggers, convos, kill_list and interrogations 
  1001. 	mission_shutdown() 
  1002. 	 
  1003. 	-- cleanup all groups 
  1004. 	cleanup_groups(mFlightTutorial_group) 
  1005.  
  1006. end 
  1007.  
  1008. -- Called when the mission has ended with success 
  1009. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
  1010. -- 
  1011. function mFlightTutorial_success() 
  1012. 	--[[ INSERT ANY MISSION SPECIFIC SUCCESS STUFF ]]-- 
  1013.  
  1014. 	-- Equip the superpower if we finished successfully 
  1015. 	--player_super_power_select( "freeze", SYNC_ALL, "blast_stone" ) 
  1016. 	collectible_hide_orbs(false) 
  1017.  
  1018. end 
  1019.  
  1020. -------------------------------------------------------------------------------------------------- 
  1021. 								--[[**********************]]-- 
  1022. 								--[[                      ]]-- 
  1023. 								--[[ Initialize functions ]]-- 
  1024. 								--[[                      ]]-- 
  1025. 								--[[**********************]]-- 
  1026.  
  1027. -- Initialize the mission for the specified checkpoint 
  1028. -- 
  1029. -- checkpoint_name:		(string) Checkpoint to initialize the mission to 
  1030. -- 
  1031. function mFlightTutorial_initialize(checkpoint_name) 
  1032. 	-- Common initialization 
  1033. 	mFlightTutorial_initialize_common() 
  1034.  
  1035. 	flight_tutorial_stamina(true, LOCAL_PLAYER) 
  1036. 	if(coop_is_active()) then 
  1037. 	flight_tutorial_stamina(true, REMOTE_PLAYER) 
  1038. 	end 
  1039. 	 
  1040. 	-- Get the player names 
  1041. 	mFlightTutorial_players = player_names_get_all() 
  1042.  
  1043. 	-- Checkpoint specific initialization 
  1044. 	checkpoint_init(mFlightTutorial_checkpoint, checkpoint_name) 
  1045.  
  1046. 	-- Setup the lava trigger 
  1047. 	trigger_setup( mFlightTutorial_trigger.lava_trigger ) 
  1048.  
  1049. 	-- Start the lava thread 
  1050. 	for i, player in pairs( mFlightTutorial_players ) do 
  1051. 		mFlightTutorial_thread.lava_trigger_threads[ i ] = thread_new( "mFlightTutorial_lava_trigger_thread_func", player ) 
  1052. 	end 
  1053.  
  1054. 	-- Remove any present subtitles 
  1055. 	message_remove_all() 
  1056.  
  1057. 	-- Start fading in  
  1058. 	mission_start_fade_in() 
  1059. end 
  1060.  
  1061.  
  1062. bFlightPower2Unlocked = false 
  1063.  
  1064.  
  1065. -- Handle any common initialization 
  1066. function mFlightTutorial_initialize_common() 
  1067. 	--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]-- 
  1068. 	audio_object_post_event( "Play_FlightMusic" ) 
  1069. 	audio_object_post_event( "Play_amb_mFlightTutorial" ) 
  1070. 		 
  1071. 	-- Lets check to see if the remote player has more flaps 
  1072. 	if(coop_is_active()) then 
  1073. 		if (player_get_num_flaps(REMOTE_PLAYER) > 0) then 
  1074. 			iNumberOfFlapsAtStartRemote = player_get_num_flaps(REMOTE_PLAYER) 
  1075. 			super_jump_set_flap_max( 0, SYNC_REMOTE, true ) 
  1076. 			iCurrentFlapsRemote = 0 
  1077. 		end 
  1078. 	end 
  1079. 	iStartFlapsLocal = player_get_num_flaps(LOCAL_PLAYER) 
  1080. 	temp_save_flight_power() 
  1081. 	unlockable_unlock("Glide_Power_2", true, SYNC_ALL) 
  1082. 	 
  1083. 	-- remove any flaps 
  1084. 	super_jump_set_flap_max( 0, SYNC_LOCAL, true ) 
  1085. 	--iCurrentFlapsRemote = iNumberOfFlapsAtStartRemote 
  1086. 	flight_tutorial_stamina(true, LOCAL_PLAYER) 
  1087. 	if(coop_is_active()) then 
  1088. 	flight_tutorial_stamina(true, REMOTE_PLAYER) 
  1089. 	end 
  1090. end 
  1091.  
  1092. -------------------------------------------------------------------------------------------------- 
  1093. 								--[[**********************]]-- 
  1094. 								--[[                      ]]-- 
  1095. 								--[[ Checkpoint functions ]]-- 
  1096. 								--[[                      ]]-- 
  1097. 								--[[**********************]]-- 
  1098.  
  1099. -------------------------------------------------------------------------------------------------- 
  1100. --[[ 
  1101.   ______ _          _      _____ _               _                _       _    
  1102.  |  ____(_)        | |    / ____| |             | |              (_)     | |   
  1103.  | |__   _ _ __ ___| |_  | |    | |__   ___  ___| | ___ __   ___  _ _ __ | |_  
  1104.  |  __| | | '__/ __| __| | |    | '_ \ / _ \/ __| |/ / '_ \ / _ \| | '_ \| __| 
  1105.  | |    | | |  \__ \ |_  | |____| | | |  __/ (__|   <| |_) | (_) | | | | | |_  
  1106.  |_|    |_|_|  |___/\__|  \_____|_| |_|\___|\___|_|\_\ .__/ \___/|_|_| |_|\__| 
  1107. 													 | |                       
  1108. 													 |_|                       
  1109. ]]-- 
  1110. -------------------------------------------------------------------------------------------------- 
  1111.  
  1112. -- Initialize this checkpoint. 
  1113. -- 
  1114. -- mission_start: (bool) Whether we're initializing from a mission (re)start or from 
  1115. --					a natural play-through. 
  1116. -- 
  1117. function mFlightTutorial_fcp_init(mission_start) 
  1118.  
  1119. 	-- Enable super movement, but not super attacks 
  1120. 	player_super_movement_enable( false ) 
  1121. 	player_super_attacks_enable( false ) 
  1122. 	--human_allow_freefall( false ) 
  1123.  
  1124. end 
  1125.  
  1126. -- The first objective 
  1127. -- 
  1128. function mFlightTutorial_fcp_run() 
  1129.  
  1130. 	-- Disable super powers 
  1131. 	--player_super_movement_enable( false ) 
  1132. 	--player_super_attacks_enable( false ) 
  1133. 	--human_allow_freefall( true )	 
  1134.  
  1135. 	mFlightTutorial_allow_player_controls( false ) 
  1136. 	 
  1137. 	-- Tell the player to jump off of the building 
  1138. 	objective_text( 0, "GM_FLIGHTTUT_OBJ_FLY_TO_CLUSTER", "", "", SYNC_ALL, OI_ASSET_LOCATION ) 
  1139. 	player_wings_force_open( LOCAL_PLAYER, true )	 
  1140. 	mFlightTutorial_allow_player_controls( true ) 
  1141.  
  1142. 	-- Set up our super movement trigger 
  1143. 	--trigger_enable( mFlightTutorial_trigger.ultor_super_movement_trigger.name ) 
  1144. 	--on_trigger_exit( "mFlightTutorial_ultor_super_movement_trigger_callback", mFlightTutorial_trigger.ultor_super_movement_trigger.name ) 
  1145.  
  1146.  
  1147.  
  1148. 	delay( 2.0 ) 
  1149.  
  1150. 	--  Set up the fake waypoint marker 
  1151. 	object_indicator_add( "fake_goal_navpoint", OI_ASSET_LOCATION ) 
  1152.  
  1153. 	-- Set up the jump off trigger 
  1154. 	trigger_setup( mFlightTutorial_trigger.ultor_teleport_trigger ) 
  1155. 	trigger_setup( mFlightTutorial_trigger.ultor_jump_off_trigger ) 
  1156. 	while not mFlightTutorial_trigger.ultor_teleport_trigger.hit do 
  1157. 		thread_yield() 
  1158. 	end 
  1159. 	-- TODO: Play SAM 
  1160.  
  1161. 	-- Block until the SAM is done 
  1162. 	delay(2.0) 
  1163.  
  1164. 	-- Fade to black and teleport. 
  1165. 	fade_out( 0.0 ) 
  1166. 	fade_out_block() 
  1167. 	 
  1168. 	--  Remove the fake waypoint marker and text 
  1169. 	object_indicator_remove( "fake_goal_navpoint" ) 
  1170. 	objective_text_clear( 0 ) 
  1171. 	message_remove_all() 
  1172.  
  1173. 	-- Disable warp to shore and un-force the player's wings 
  1174. 	for i, player in pairs( mFlightTutorial_players ) do 
  1175. 		player_warp_to_shore_disable( player ) 
  1176. 	end 
  1177. 	 
  1178. 	-- Swap to the training area and bring our players with 
  1179. 	--city_zone_swap( "f_train", true ) 
  1180. 	if coop_is_active() == false then 
  1181. 		teleport( LOCAL_PLAYER, "altar_nav_host" ) 
  1182. 		character_show( LOCAL_PLAYER ) 
  1183. 		human_gravity_enable( LOCAL_PLAYER, true ) 
  1184. 		player_wings_force_open( LOCAL_PLAYER, false ) 
  1185. 	else 
  1186. 		teleport_coop( "altar_nav_host", "altar_nav_client" ) 
  1187. 		character_show( LOCAL_PLAYER )	 
  1188. 		character_show( REMOTE_PLAYER ) 
  1189. 		human_gravity_enable( LOCAL_PLAYER, true ) 
  1190. 		human_gravity_enable( REMOTE_PLAYER, true ) 
  1191. 		camera_set_target( LOCAL_PLAYER, true, SYNC_LOCAL ) 
  1192. 		camera_set_target( REMOTE_PLAYER, true, SYNC_REMOTE ) 
  1193. 		player_wings_force_open( LOCAL_PLAYER, false ) 
  1194. 		player_wings_force_open( REMOTE_PLAYER, false ) 
  1195. 	end 
  1196.  
  1197. 		-- Disable superpowers (Mostly here so that if we restart the mission, it'll play as it should.) 
  1198. 	player_lock_super_power(MM_1_2_SUPERPOWER_SPRINT, LOCAL_PLAYER) 
  1199. 	player_lock_super_power(MM_1_2_SUPERPOWER_JUMP, LOCAL_PLAYER) 
  1200. 	player_flight_unlock( LOCAL_PLAYER, false ) 
  1201. 	if coop_is_active() then 
  1202. 		player_lock_super_power(MM_1_2_SUPERPOWER_SPRINT, REMOTE_PLAYER) 
  1203. 		player_lock_super_power(MM_1_2_SUPERPOWER_JUMP, REMOTE_PLAYER) 
  1204. 		player_flight_unlock( REMOTE_PLAYER, false ) 
  1205. 	end 
  1206.  
  1207.  
  1208. 	-- Create our soul clusters 
  1209. 	group_create( "soul_cluster_group" ) 
  1210.  
  1211. 	marker_add(mFlightTutorial_group.soul_clusters, MINIMAP_ICON_LOCATION,OI_ASSET_LOCATION)  
  1212. 	 
  1213. 	-- Reset the current navpoint counter 
  1214. 	g_nCurrentNavpointNumber = 0 
  1215.  
  1216. 	delay( 4.0 )  
  1217.  
  1218. 	fade_in( 0.0 ) 
  1219. 	 
  1220. 	--group_create( mFlightTutorial_group.damned_soul.name ) 
  1221. 	--on_death( "mFlightTutorial_damned_soul_on_death_cb", mFlightTutorial_group.damned_soul.npc ) 
  1222.  
  1223. 	mFlightTutorial_allow_player_controls( true ) 
  1224. end 
  1225.  
  1226. -- Do any cleanup for this checkpoint. 
  1227. -- 
  1228. -- (+++THIS IS CALLED FROM MISSION CLEANUP, MUST RETURN IMMEDIATELY+++) 
  1229. -- 
  1230. -- mission_exit: (bool) Whether we're exiting the mission entirely, or just 
  1231. --					moving on to the next checkpoint. 
  1232. -- 
  1233. function mFlightTutorial_fcp_cleanup(mission_exit) 
  1234. 	 
  1235. 	-- Clean up damned soul callback 
  1236. 	if mission_exit then 
  1237. 		on_death( "", mFlightTutorial_group.damned_soul.npc ) 
  1238. 	end 
  1239.  
  1240. 	if mission_is_failed() then 
  1241.  
  1242. 		player_super_movement_enable(false) 
  1243. 		player_lock_super_power(MM_1_2_SUPERPOWER_SPRINT, LOCAL_PLAYER) 
  1244. 		player_lock_super_power(MM_1_2_SUPERPOWER_JUMP, LOCAL_PLAYER) 
  1245. 		player_flight_unlock( LOCAL_PLAYER, false ) 
  1246.  
  1247. 		if coop_is_active() then 
  1248. 			player_lock_super_power(MM_1_2_SUPERPOWER_SPRINT, REMOTE_PLAYER) 
  1249. 			player_lock_super_power(MM_1_2_SUPERPOWER_JUMP, REMOTE_PLAYER) 
  1250. 			player_flight_unlock( REMOTE_PLAYER, false ) 
  1251. 		end 
  1252.  
  1253. 		player_super_attacks_enable( false ) 
  1254. 	end 
  1255. 	flight_tutorial_stamina(false, LOCAL_PLAYER) 
  1256. 	if(coop_is_active()) then 
  1257. 	flight_tutorial_stamina(false, REMOTE_PLAYER) 
  1258. 	end 
  1259. end 
  1260.  
  1261. ------------------------------------ 
  1262. -- 
  1263. -- Checkpoint helper functions 
  1264. -- 
  1265. ------------------------------------ 
  1266.  
  1267. ------------------------------------ 
  1268. -- 
  1269. -- Checkpoint thread functions 
  1270. -- 
  1271. ------------------------------------ 
  1272.  
  1273. ------------------------------------ 
  1274. -- 
  1275. -- Checkpoint callback functions 
  1276. -- 
  1277. ------------------------------------ 
  1278.  
  1279. -------------------------------------------------------------------------------------------------- 
  1280. --[[ 
  1281.    _____      _ _           _      ____       _          
  1282.   / ____|    | | |         | |    / __ \     | |         
  1283.  | |     ___ | | | ___  ___| |_  | |  | |_ __| |__  ___  
  1284.  | |    / _ \| | |/ _ \/ __| __| | |  | | '__| '_ \/ __| 
  1285.  | |___| (_) | | |  __/ (__| |_  | |__| | |  | |_) \__ \ 
  1286.   \_____\___/|_|_|\___|\___|\__|  \____/|_|  |_.__/|___/ 
  1287. 																											   
  1288. ]]-- 
  1289. -------------------------------------------------------------------------------------------------- 
  1290. function mFlightTutorial_orb_init(mission_start) 
  1291.  
  1292. 	-- Disable warp to shore and un-force the player's wings 
  1293. 	for i, player in pairs( mFlightTutorial_players ) do 
  1294. 		player_warp_to_shore_disable( player ) 
  1295. 	end 
  1296. 	 
  1297. 	-- Swap to the training area and bring our players with 
  1298. 	--city_zone_swap( "f_train", true ) 
  1299. 	if coop_is_active() == false then 
  1300. 		teleport( LOCAL_PLAYER, "altar_nav_host" ) 
  1301. 		character_show( LOCAL_PLAYER ) 
  1302. 		human_gravity_enable( LOCAL_PLAYER, true ) 
  1303. 		player_wings_force_open( LOCAL_PLAYER, false ) 
  1304. 	else 
  1305. 		teleport_coop( "altar_nav_host", "altar_nav_client" ) 
  1306. 		character_show( LOCAL_PLAYER )	 
  1307. 		character_show( REMOTE_PLAYER ) 
  1308. 		human_gravity_enable( LOCAL_PLAYER, true ) 
  1309. 		human_gravity_enable( REMOTE_PLAYER, true ) 
  1310. 		camera_set_target( LOCAL_PLAYER, true, SYNC_LOCAL ) 
  1311. 		camera_set_target( REMOTE_PLAYER, true, SYNC_REMOTE ) 
  1312. 		player_wings_force_open( LOCAL_PLAYER, false ) 
  1313. 		player_wings_force_open( REMOTE_PLAYER, false ) 
  1314. 	end 
  1315.  
  1316. 		-- Disable superpowers (Mostly here so that if we restart the mission, it'll play as it should.) 
  1317. 	player_lock_super_power(MM_1_2_SUPERPOWER_SPRINT, LOCAL_PLAYER) 
  1318. 	player_lock_super_power(MM_1_2_SUPERPOWER_JUMP, LOCAL_PLAYER) 
  1319. 	player_flight_unlock( LOCAL_PLAYER, false ) 
  1320. 	if coop_is_active() then 
  1321. 		player_lock_super_power(MM_1_2_SUPERPOWER_SPRINT, REMOTE_PLAYER) 
  1322. 		player_lock_super_power(MM_1_2_SUPERPOWER_JUMP, REMOTE_PLAYER) 
  1323. 		player_flight_unlock( REMOTE_PLAYER, false ) 
  1324. 	end 
  1325.  
  1326.  
  1327. 	-- Create our soul clusters and hide the fourth one 
  1328. 	group_create( "soul_cluster_group" ) 
  1329. 	--item_hide( mFlightTutorial_group.soul_clusters.cluster04.name ) 
  1330. 	marker_add(mFlightTutorial_group.soul_clusters, MINIMAP_ICON_LOCATION,OI_ASSET_LOCATION)  
  1331. 	-- Reset the current navpoint counter 
  1332. 	g_nCurrentNavpointNumber = 0 
  1333. 	 
  1334. 	delay( 4.0 )  
  1335.  
  1336. 	fade_in( 0.0 ) 
  1337. 	 
  1338. 	--group_create( mFlightTutorial_group.damned_soul.name ) 
  1339. 	--on_death( "mFlightTutorial_damned_soul_on_death_cb", mFlightTutorial_group.damned_soul.npc ) 
  1340.  
  1341. 	mFlightTutorial_allow_player_controls( true ) 
  1342.  
  1343. 	-- Disable super movement 
  1344. 	player_super_movement_enable( false ) 
  1345. 	player_super_attacks_enable( false ) 
  1346. 	--human_allow_freefall( false ) 
  1347.  
  1348. 	-- Set up the soul cluster item call back 
  1349. 	for i, cluster in pairs( mFlightTutorial_group.soul_clusters ) do	 
  1350. 		on_pickup( "mFlightTutorial_cluster_collected", cluster.name ) 
  1351. 		object_indicator_add( cluster.name, OI_ASSET_LOCATION ) 
  1352. 	end 
  1353. end 
  1354.  
  1355. function mFlightTutorial_orb_run() 
  1356.  
  1357. 	tweak_table_override_value("Jump_super_max_height_scripted",24) 
  1358.  
  1359.  
  1360. 	objective_text( 0, "GM_FLIGHTTUT_OBJ_COLLECT_SOUL_CLUSTERS", "", "", SYNC_ALL, OI_ASSET_LOCATION ) 
  1361. 	-- Set indicators on every soul cluster 
  1362. --	for i, cluster in pairs( mFlightTutorial_group.soul_clusters ) do	 
  1363. 		 
  1364. --	end 
  1365. 	convo_end_all() 
  1366. 	convo_start(mFlightTutorial_convo.start)	 
  1367. 	for i, player in pairs( mFlightTutorial_players ) do 
  1368. 		mFlightTutorial_thread.leash_thread[ i ] = thread_new("mFlightTutorial_leash_thread", player) 
  1369. 	end 
  1370.  
  1371. 	 
  1372.  
  1373. 	 
  1374. 	while mFlightTutorial_clusters_collected ~= MFLIGHTTUTORIAL_NUM_CLUSTERS do 
  1375. 		thread_yield() 
  1376. 	end 
  1377. 	 
  1378. 	convo_end_all() 
  1379. 	convo_start(mFlightTutorial_convo.powerup) 
  1380. 	 
  1381. 	message_remove_all() 
  1382.  
  1383. 	--while not mFlightTutorial_trigger.altar_trigger.hit do 
  1384. 	--	thread_yield() 
  1385. 	--end 
  1386. 	objective_text_clear( 0 ) 
  1387. 	-- Go through the power purchase tutorial 
  1388. 	human_allow_freefall( false )	 
  1389. 	objective_text(0, "GM_FLIGHTTUT_OBJ_ACCESS_POWERS", nil, nil, SYNC_LOCAL, OI_ASSET_USE) 
  1390. 	mFlightTutorial_purchase_powers() 
  1391. 	 
  1392. 	-- Start the tutorial trigger threads 
  1393. 	objective_text_clear( 0 ) 
  1394. 	objective_text( 0, "GM_FLIGHTTUT_OBJ_COMPLETE_TRAINING", nil, nil, SYNC_LOCAL, OI_ASSET_LOCATION ) 
  1395. 	if coop_is_active() then 
  1396. 		objective_text( 1, "GM_FLIGHTTUT_OBJ_COMPLETE_TRAINING", nil, nil, SYNC_REMOTE, OI_ASSET_LOCATION )		 
  1397. 	end 
  1398. 	message_remove_all() 
  1399. 	for i, player in pairs( mFlightTutorial_players ) do 
  1400. 		mFlightTutorial_thread.tutorial_triggers_threads[ i ] = thread_new( "mFlightTutorial_tutorial_triggers_thread_func", player ) 
  1401. 	end 
  1402. 	 
  1403. 	-- Wait until the turn trigger is properly hit.	 
  1404. 	if( coop_is_active() ) then 
  1405. 		 
  1406. 		local turn_trigger_hit = false 
  1407. 		while not ( turn_trigger_hit ) do 			 
  1408. 			if(  mLocalTurnTriggerHit == true or mRemoteTurnTriggerHit == true )then 
  1409. 				turn_trigger_hit = true 
  1410. 			end 
  1411. 			thread_yield() 
  1412. 		end 
  1413. 	else 
  1414. 		while not ( mLocalTurnTriggerHit == true ) do 
  1415. 			thread_yield() 
  1416. 		end 
  1417. 	end 
  1418. 	 
  1419. 	-- Set up the last trigger. 
  1420. 	if( coop_is_active() ) then 
  1421. 		local local_player_hit_last_trigger = false 
  1422. 		local remote_player_hit_last_trigger = false 
  1423.  
  1424. 		while( local_player_hit_last_trigger == false or remote_player_hit_last_trigger == false )do  
  1425. 			 
  1426. 			-- For the last trigger, tell the player who finished first to wait for their buddy. 
  1427. 			if local_player_hit_last_trigger == false and object_is_in_trigger( mFlightTutorial_trigger.end_trigger.name, LOCAL_PLAYER ) and player_is_standing( LOCAL_PLAYER ) then 
  1428. 				objective_text( 0, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_LOCAL, OI_ASSET_LOCATION ) 
  1429. 				marker_remove_trigger( mFlightTutorial_trigger.end_trigger.name, SYNC_LOCAL )		 
  1430. 				local_player_hit_last_trigger = true 
  1431. 			end 
  1432. 			 
  1433. 			if remote_player_hit_last_trigger == false and object_is_in_trigger( mFlightTutorial_trigger.end_trigger.name, REMOTE_PLAYER ) and player_is_standing( REMOTE_PLAYER ) then 
  1434. 				objective_text( 1, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_REMOTE, OI_ASSET_LOCATION )	 
  1435. 				marker_remove_trigger( mFlightTutorial_trigger.end_trigger.name, SYNC_REMOTE ) 
  1436. 				remote_player_hit_last_trigger = true 
  1437. 			end 
  1438. 			 
  1439. 			thread_yield() 
  1440. 		end 
  1441. 	else 
  1442. 		while not ( object_is_in_trigger( mFlightTutorial_trigger.end_trigger.name, LOCAL_PLAYER ) and player_is_standing( LOCAL_PLAYER ) ) do 
  1443. 			thread_yield() 
  1444. 		end 
  1445. 	end 
  1446. 	 
  1447. 	-- Last trigger, both players should be here for the mission to complete. 
  1448. 	-- Otherwise, complete the mission. 
  1449. 	--if coop_is_active() then 
  1450. 	--	while get_num_humans_in_trigger( mFlightTutorial_trigger.end_trigger.name ) ~= 2 do 
  1451. 	--		thread_yield() 
  1452. 	--	end 
  1453. 	--end 
  1454. 	 
  1455.  
  1456. 	tutorial_stop_current() 
  1457. 	objective_text_clear(0) 
  1458. 	objective_text_clear(1) 
  1459. 	marker_remove_trigger( mFlightTutorial_trigger.end_trigger.name, SYNC_ALL ) 
  1460. 	mFlightTutorial_UsePlayerLeash = false 
  1461. 	convo_end_all() 
  1462.  
  1463. 	audio_object_post_event( "Stop_FlightMusic" ) 
  1464. 	audio_object_post_event( "Stop_amb_mFlightTutorial" ) 
  1465. 	mFlightTutorial_convo.transition.sync = SYNC_ALL 
  1466. 	convo_start(mFlightTutorial_convo.transition)	 
  1467. 	convo_wait_for_end() 
  1468. 	cutscene_play(mFlightTutorial_scene.outro, nil, {"player_start_nav_host", "player_start_nav_client"}, true ) 
  1469.  
  1470. 	-- Send the players back to Ultor per Volition's request 
  1471. 	--fade_out(1.0) 
  1472. 	--teleport_coop("player_start_nav_host", "player_start_nav_client") 
  1473. 	--delay(3.0) 
  1474. 	--fade_in(1.0) 
  1475. end 
  1476.  
  1477. function mFlightTutorial_orb_cleanup(mission_exit) 
  1478. 	 
  1479. 	 
  1480. 	-- Clear purchase powers callback 
  1481. 	on_powers_tutorial_completed("") 
  1482. 	 
  1483. 	-- Disable super powers tutorial 
  1484. 	cellphone_enable_powers_tutorial(false) 
  1485. 	 
  1486. 	-- Clear HUD prompt 
  1487. 	hud_prompt_clear() 
  1488. 	 
  1489.  
  1490. 	-- Clean up triggers	 
  1491. 	on_trigger_exit( "", mFlightTutorial_trigger.ultor_super_movement_trigger.name ) 
  1492. 	trigger_cb( "", mFlightTutorial_trigger.lava_trigger  ) 
  1493.  
  1494. 	-- Clean up clusters 
  1495. 	on_pickup( "", mFlightTutorial_group.soul_clusters.cluster01.name ) 
  1496. 	on_pickup( "", mFlightTutorial_group.soul_clusters.cluster02.name ) 
  1497. 	on_pickup( "", mFlightTutorial_group.soul_clusters.cluster03.name ) 
  1498. 	on_pickup( "", mFlightTutorial_group.soul_clusters.cluster04.name ) 
  1499.  
  1500. 	-- Re-enable warp to shore	 
  1501. 	for i, player in pairs( mFlightTutorial_players ) do 
  1502. 		player_warp_to_shore_enable( player ) 
  1503. 	end 
  1504. 		 
  1505. 	if mission_is_failed() then 
  1506.  
  1507. 		player_super_movement_enable(false) 
  1508. 		player_lock_super_power(MM_1_2_SUPERPOWER_SPRINT, LOCAL_PLAYER) 
  1509. 		player_lock_super_power(MM_1_2_SUPERPOWER_JUMP, LOCAL_PLAYER) 
  1510. 		player_flight_unlock( LOCAL_PLAYER, false ) 
  1511. 		if coop_is_active() then 
  1512. 			player_lock_super_power(MM_1_2_SUPERPOWER_SPRINT, REMOTE_PLAYER) 
  1513. 			player_lock_super_power(MM_1_2_SUPERPOWER_JUMP, REMOTE_PLAYER) 
  1514. 			player_flight_unlock( REMOTE_PLAYER, false ) 
  1515. 		end 
  1516.  
  1517. 		player_super_attacks_enable( false ) 
  1518. 	else	 
  1519.  
  1520. 		--player_unlock_super_power( SUPERPOWER_BLAST, LOCAL_PLAYER, true ) 
  1521. 		--if coop_is_active() then 
  1522. 		--	player_unlock_super_power( SUPERPOWER_BLAST, REMOTE_PLAYER, true ) 
  1523. 		--end 
  1524. 		-- 
  1525. 		----player_unlock_element( PLAYER_SUPERPOWER_BLAST_STONE ) 
  1526. 		--player_super_attacks_enable( true ) 
  1527. 	end 
  1528. end 
  1529.  
  1530. ------------------------------------ 
  1531. -- 
  1532. -- Checkpoint helper functions 
  1533. -- 
  1534. ------------------------------------ 
  1535. function mFlightTutorial_purchase_powers() 
  1536.  
  1537. 	-- "That should be enough. Let's see what I can do here... Check your HUB." 
  1538. 	 
  1539. 	-- Wait for Kinzie to call out HUB (end of convo) 
  1540. 	--convo_wait_for_end() 
  1541. 	 
  1542. 	-- Setup callback to track if powers were purchased 
  1543. 	on_powers_tutorial_completed("mFlightTutorial_powers_purchased_cb") 
  1544. 	 
  1545. 	-- Enable super powers tutorial 
  1546. 	cellphone_enable_powers_tutorial(true) 
  1547. 	 
  1548. 	-- Have player(s) purchase Sprint/Jump powers (local/remote separate) 
  1549. 	hud_prompt(LOCAL_PLAYER, "MM_1_2_ACT_ACCESS_HUB", "mFlightTutorial_empty_cb") 
  1550. 	if coop_is_active() then 
  1551. 		mFlightTutorial_powers_tutorial[SYNC_REMOTE].purchased = false 
  1552. 		mFlightTutorial_powers_tutorial[SYNC_REMOTE].finished = false 
  1553. 		objective_text( 1, "GM_FLIGHTTUT_OBJ_ACCESS_POWERS", nil, nil, SYNC_REMOTE, OI_ASSET_USE) 
  1554. 		hud_prompt(REMOTE_PLAYER, "MM_1_2_ACT_ACCESS_HUB", "mFlightTutorial_empty_cb") 
  1555. 	end 
  1556. 	 
  1557. 	-- Wait for player(s) to purchase Sprint/Jump powers (local/remote separate) 
  1558. 	while ((mFlightTutorial_powers_tutorial[SYNC_LOCAL].finished == false)  
  1559. 	or (mFlightTutorial_powers_tutorial[SYNC_REMOTE].finished == false)) do 
  1560. 	 
  1561. 		-- Check if local player purchased powers 
  1562. 		if (mFlightTutorial_powers_tutorial[SYNC_LOCAL].purchased == true) then 
  1563. 		 
  1564. 			-- If local player just finished, have them wait for remote player, if needed 
  1565. 			if (mFlightTutorial_powers_tutorial[SYNC_LOCAL].finished == false) then 
  1566. 				if (mFlightTutorial_powers_tutorial[SYNC_REMOTE].finished == false) then 
  1567. 					objective_text(0, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_LOCAL, OI_ASSET_LOCATION) 
  1568. 					hud_prompt_clear(LOCAL_PLAYER) 
  1569. 				end 
  1570. 				mFlightTutorial_powers_tutorial[SYNC_LOCAL].finished = true 
  1571. 			end 
  1572. 			 
  1573. 		end 
  1574. 		 
  1575. 		-- Check if remote player purchased powers 
  1576. 		if (mFlightTutorial_powers_tutorial[SYNC_REMOTE].purchased == true) then 
  1577. 		 
  1578. 			-- If remote player just finished, have them wait for local player, if needed 
  1579. 			if (mFlightTutorial_powers_tutorial[SYNC_REMOTE].finished == false) then 
  1580. 				if (mFlightTutorial_powers_tutorial[SYNC_LOCAL].finished == false) then 
  1581. 					objective_text(1, "MM_1_1_OBJ_WAIT_FOR_PLAYER", nil, nil, SYNC_REMOTE, OI_ASSET_LOCATION) 
  1582. 					hud_prompt_clear(REMOTE_PLAYER) 
  1583. 				end 
  1584. 				mFlightTutorial_powers_tutorial[SYNC_REMOTE].finished = true 
  1585. 			end 
  1586. 			 
  1587. 		end 
  1588. 		 
  1589. 		-- Let other threads run 
  1590. 		thread_yield() 
  1591. 		 
  1592. 	end 
  1593. 	 
  1594. 	-- Clear purchase powers callback 
  1595. 	on_powers_tutorial_completed("") 
  1596. 	 
  1597. 	-- Disable super powers tutorial 
  1598. 	cellphone_enable_powers_tutorial(false) 
  1599. 	 
  1600. 	-- Clear objective text (local/remote separate) 
  1601. 	objective_text_clear(0) 
  1602. 	hud_prompt_clear(LOCAL_PLAYER) 
  1603. 	if coop_is_active() then 
  1604. 		objective_text_clear(1) 
  1605. 		hud_prompt_clear(REMOTE_PLAYER) 
  1606. 	end 
  1607. 	 
  1608. 	-- Evacuate player(s) from vehicle(s), just in case 
  1609. 	--character_evacuate_from_all_vehicles(LOCAL_PLAYER) 
  1610. 	--if coop_is_active() then 
  1611. 	--	character_evacuate_from_all_vehicles(REMOTE_PLAYER) 
  1612. 	--end 
  1613. 	 
  1614. 	-- Wait for evacuating vehicles, just in case 
  1615. 	--delay(1) 
  1616. 	 
  1617. 	-- Have player(s) fully power up (non-blocking) 
  1618. 	local anim_name = "altars_powerup" 
  1619. 	local morph_name = anim_name 
  1620. 	local force_play = false 
  1621. 	local stand_still = true 
  1622. 	local zero_movement = true 
  1623. 	effect_play_on_human( mFlightTutorial_vfx_list.power_up.name, LOCAL_PLAYER, "spine2" ) 
  1624. 	action_play_non_blocking(LOCAL_PLAYER, anim_name, morph_name, force_play, stand_still, zero_movement) 
  1625. 	if coop_is_active() then 
  1626. 		effect_play_on_human( mFlightTutorial_vfx_list.power_up.name, REMOTE_PLAYER, "spine2"  ) 
  1627. 		action_play_non_blocking(REMOTE_PLAYER, anim_name, morph_name, force_play, stand_still, zero_movement) 
  1628. 	end 
  1629. 	 
  1630. 	-- Wait for player to react 
  1631. 	delay(2) 
  1632. 	 
  1633. 	-- "This feels AWESOME!" 
  1634. 	 
  1635. 	-- Wait for player(s) to finish animating before continuing 
  1636. 	while not action_play_is_finished(LOCAL_PLAYER, 1.0) do 
  1637. 		thread_yield() 
  1638. 	end 
  1639. 	if coop_is_active() then 
  1640. 		while not action_play_is_finished(REMOTE_PLAYER, 1.0) do 
  1641. 			thread_yield() 
  1642. 		end 
  1643. 	end 
  1644. 	 
  1645. 	-- Enable super movement 
  1646. 	player_super_movement_enable(true) 
  1647. 	 
  1648. 	 
  1649. 	audio_object_post_event( "Play_FlightMusic" ) 
  1650. 	audio_object_post_event( "Play_amb_mFlightTutorial" ) 
  1651.  
  1652. 	-- Give player(s) Sprint/Jump super powers (no UI message) 
  1653. 	player_unlock_super_power(MM_1_2_SUPERPOWER_SPRINT, LOCAL_PLAYER, true) 
  1654. 	player_unlock_super_power(MM_1_2_SUPERPOWER_JUMP, LOCAL_PLAYER, true) 
  1655. 	if coop_is_active() then 
  1656. 		player_unlock_super_power(MM_1_2_SUPERPOWER_SPRINT, REMOTE_PLAYER, true) 
  1657. 		player_unlock_super_power(MM_1_2_SUPERPOWER_JUMP, REMOTE_PLAYER, true) 
  1658. 	end 
  1659. 	 
  1660. 	-- Wait for convo to finish before continuing 
  1661. 	convo_wait_for_end() 
  1662.  
  1663. end 
  1664.  
  1665. ------------------------------------ 
  1666. -- 
  1667. -- Checkpoint thread functions 
  1668. -- 
  1669. ------------------------------------ 
  1670.  
  1671. ------------------------------------ 
  1672. -- 
  1673. -- Checkpoint callback functions 
  1674. -- 
  1675. ------------------------------------ 
  1676. function mFlightTutorial_powers_purchased_cb( player_name )  
  1677. 	 
  1678. 	-- Track which player purchased powers 
  1679. 	if (player_name == LOCAL_PLAYER) then 
  1680. 		mFlightTutorial_powers_tutorial[SYNC_LOCAL].purchased = true 
  1681. 	else 
  1682. 		mFlightTutorial_powers_tutorial[SYNC_REMOTE].purchased = true 
  1683. 	end 
  1684.  
  1685. end 
  1686. -------------------------------------------------------------------------------------------------- 
  1687. 								--[[**********************]]-- 
  1688. 								--[[                      ]]-- 
  1689. 								--[[   Common functions   ]]-- 
  1690. 								--[[                      ]]-- 
  1691. 								--[[**********************]]-- 
  1692. -- Enables or disables player controls 
  1693. function mFlightTutorial_allow_player_controls( allow_controls ) 
  1694. 	if allow_controls then 
  1695. 		player_controls_enable(LOCAL_PLAYER) 
  1696. 		if coop_is_active() then 
  1697. 			player_controls_enable(REMOTE_PLAYER) 
  1698. 		end 
  1699. 	else 
  1700. 		player_controls_disable(LOCAL_PLAYER) 
  1701. 		if coop_is_active() then 
  1702. 			player_controls_disable(REMOTE_PLAYER) 
  1703. 		end 
  1704. 	end 
  1705. end 
  1706.  
  1707. -- Sets a trigger marker for the machine requesting it 
  1708. function mFlightTutorial_set_trigger_marker( trigger_name, sync_type ) 
  1709. 	 
  1710. 	marker_add_trigger( trigger_name, FLIGHTTUT_CUSTOM_TRIGGER_LOCATION.minimap_icon_name, FLIGHTTUT_CUSTOM_TRIGGER_LOCATION.ingame_effect_name, FLIGHTTUT_CUSTOM_TRIGGER_LOCATION.object_indicator_id, FLIGHTTUT_CUSTOM_TRIGGER_LOCATION.object_indicator_flags, sync_type ) 
  1711.  
  1712. end 
  1713.  
  1714. -- Cleans up the trigger marker for the machine requesting it 
  1715. function mFlightTutorial_cleanup_trigger_marker( trigger_name, sync_type ) 
  1716.  
  1717. 	marker_remove( trigger_name, sync_type ) 
  1718.  
  1719. end 
  1720.  
  1721. function mFlightTutorial_try_update_farthest_waypoint_marker( navpoint_number, next_trigger_name, sync_type ) 
  1722.  
  1723. 	if navpoint_number > g_nCurrentNavpointNumber then 
  1724. 		g_nCurrentNavpointNumber = navpoint_number 
  1725. 	end 
  1726. 	 
  1727. 	mFlightTutorial_set_trigger_marker( next_trigger_name, sync_type ) 
  1728.  
  1729. end 
  1730.  
  1731. function mFlightTutorial_trigger_transition( player, island_navpoint_name, next_trigger_name ) 
  1732.  
  1733. 	local sync_type = SYNC_LOCAL	 
  1734. 	if player == LOCAL_PLAYER then 
  1735. 		mLastIslandTriggered_Local = island_navpoint_name 
  1736. 	else 
  1737. 		mLastIslandTriggered_Remote = island_navpoint_name 
  1738. 		sync_type = SYNC_REMOTE 
  1739. 	end 
  1740.  
  1741. 	mFlightTutorial_try_update_farthest_waypoint_marker( mFlightTutorial_RespawnNavpoints[ island_navpoint_name ], next_trigger_name, sync_type ) 
  1742.  
  1743. end 
  1744.  
  1745. function mFlightTutorial_set_tutorial_text( message_text, player_name ) 
  1746.  
  1747. 	-- Clear out any previous text 
  1748. 	-- Set the next message and store it as the latest message 
  1749. 	 
  1750. 	--hud_prompt_clear( player_name ) 
  1751. 	--hud_prompt( player_name, message_text, "mFlightTutorial_empty_cb" ) 
  1752. 	 
  1753. 	local sync_type = SYNC_LOCAL 
  1754. 	if player_name == REMOTE_PLAYER then 
  1755. 		sync_type = SYNC_REMOTE 
  1756. 	end 
  1757.  
  1758. 	tutorial_stop_current( sync_type ) 
  1759.  
  1760. 	tutorial_start( message_text, 0, false, true, true, sync_type ) 
  1761.  
  1762. end 
  1763.  
  1764. function mFlightTutorial_flight_stall_detected() 
  1765.  
  1766. 	-- Play VO 
  1767.  
  1768. 	-- TODO: Remove this when VO is in. 
  1769. 	 
  1770. 	message_remove_all() 
  1771. 	--message( "PLACEHOLDER: Vogel lets Johnny know that he needs to flap his wings in order to reach the higher island.", 50.0, false ) 
  1772.  
  1773. end 
  1774.  
  1775. function mFlightTutorial_final_trigger_setup( trigger_table, sync_type ) 
  1776.  
  1777. 	if( trigger_is_enabled( trigger_table.name ) == false )then 
  1778. 		trigger_enable( trigger_table.name ) 
  1779. 	end 
  1780.  
  1781. 	mFlightTutorial_set_trigger_marker( trigger_table.name, sync_type ) 
  1782.  
  1783.  
  1784. 	--marker_add_trigger(trigger_table.name, trigger_table.marker.minimap_icon_name, trigger_table.marker.ingame_effect_name, trigger_table.marker.object_indicator_id, trigger_table.marker.object_indicator_flags, trigger_table.marker.sync_type, trigger_table.marker.fade_dist) 
  1785. 	 
  1786. 	--mission_waypoint_add( trigger_table.name ) 
  1787.  
  1788. end 
  1789.  
  1790. -------------------------------------------------------------------------------------------------- 
  1791. 								--[[**********************]]-- 
  1792. 								--[[                      ]]-- 
  1793. 								--[[  Callback functions  ]]-- 
  1794. 								--[[                      ]]-- 
  1795. 								--[[**********************]]-- 
  1796.  
  1797. -- Callback function for the ultor super movement trigger which  
  1798. -- disables super movement when any player leaves it. 
  1799. function mFlightTutorial_ultor_super_movement_trigger_callback( character_name, trigger_name ) 
  1800. 	 
  1801. 	-- Disable super movement 
  1802. 	player_super_movement_enable( false ) 
  1803. 	human_allow_freefall( true ) 
  1804. 	 
  1805. 	-- Kind of a hack to stop the character from moving, without taking control away. 
  1806. 	character_ragdoll( character_name ) 
  1807. 	character_ragdoll_stop( character_name ) 
  1808. 	character_collision_enable( character_name, true ) 
  1809.  
  1810. end 
  1811.  
  1812. -- Callback function for the ultor jump off trigger which throws the player 
  1813. -- into a SAM so where they tumble to the bottom. 
  1814. function mFlightTutorial_ultor_jump_off_trigger_callback( character_name, trigger_name ) 
  1815. 	 
  1816. 	-- Coop work 
  1817. 	local other_player = "" 
  1818. 	local sync_flag_for_other_player = "" 
  1819. 	if coop_is_active() then 
  1820. 		if( character_name == LOCAL_PLAYER )then 
  1821. 			other_player = REMOTE_PLAYER 
  1822. 			sync_flag_for_other_player = SYNC_REMOTE 
  1823. 		else 
  1824. 			other_player = LOCAL_PLAYER 
  1825. 			sync_flag_for_other_player = SYNC_LOCAL 
  1826. 		end 
  1827. 	end 
  1828. 				 
  1829. 	-- Make the player play the freefall animation 
  1830. 	local anim_name = "freefall fail" 
  1831. 	set_animation_state( character_name, anim_name )	 
  1832. 	camera_set_target( character_name ) 
  1833. 		 
  1834. 	-- Make the wings play the freefall animation 
  1835. 	local anim_action_name = "" 
  1836. 	local anim_state_name = anim_name 
  1837. 	local use_high_priority = true 
  1838. 	local sync_flags = SYNC_LOCAL 
  1839. 	if coop_is_active() then 
  1840. 		sync_flags = SYNC_ALL 
  1841. 	end 
  1842.  
  1843. 	wings_play_anim( character_name, anim_action_name, anim_state_name, use_high_priority, sync_flags ) 
  1844. 	 
  1845.  
  1846. 	-- Disable player control 
  1847. 	player_controls_disable( character_name ) 
  1848. 	if( coop_is_active() )then 
  1849. 		player_controls_disable( other_player ) 
  1850. 	end 
  1851. 		 
  1852. 	local trigger_table = trigger_get_table( trigger_name ) 
  1853. 	trigger_table.hit = true 
  1854. 		 
  1855. end 
  1856.  
  1857. -- Callabck 
  1858. function mFlightTutorial_ultor_teleport_trigger_cb( character_name, trigger_name ) 
  1859.  
  1860. 	-- Play vfx 
  1861. 	effect_play_on_human( mFlightTutorial_vfx_list.teleport.name, character_name ) 
  1862. 	delay( 0.75 ) 
  1863.  
  1864. 	-- Hide the character 
  1865. 	human_gravity_enable( character_name, false ) 
  1866. 	player_wings_force_open( character_name, false ) 
  1867. 	character_hide( character_name ) 
  1868. 	clear_animation_state( character_name ) 
  1869.  
  1870. 	delay( 1.0 ) 
  1871.  
  1872. 	-- Trigger the trigger 
  1873. 	local trigger_table = trigger_get_table( trigger_name ) 
  1874. 	trigger_table.hit = true 
  1875.  
  1876. end 
  1877.  
  1878. Local_CollectedOrb_A = false 
  1879. Local_CollectedOrb_B = false 
  1880. Remote_CollectedOrb_A = false 
  1881. Remote_CollectedOrb_B = false 
  1882. FlapsCollected = 0 
  1883. function mFlightTutorial_do_flap_cb_1(player_name) 
  1884.  
  1885. 	--HVS_BAS - only for local player 
  1886. 	if (player_name == LOCAL_PLAYER) then 
  1887. 		-- Play the orb collect VFX 
  1888. 		FlapsCollected = FlapsCollected + 1 
  1889. 		force_flap_player(player_name) 
  1890. 	--	effect_play_on_human("Vfx_soul_collect", player) 
  1891. 		trigger_clear(mFlightTutorial_trigger.give_flap_trigger_01.name) 
  1892. 		effect_stop(mFlightTutorial_FlapVFX_1) 
  1893. 		trigger_clear(mFlightTutorial_trigger.missed_flap_trigger_1.name) 
  1894. 		Local_CollectedOrb_A = true 
  1895. 	end 
  1896. end 
  1897. function mFlightTutorial_do_flap_cb_2(player_name) 
  1898. 	if (player_name == REMOTE_PLAYER) then 
  1899. 		FlapsCollected = FlapsCollected + 1 
  1900. 		-- Play the orb collect VFX 
  1901. 		force_flap_player(player_name) 
  1902. 	--	effect_play_on_human("Vfx_soul_collect", player) 
  1903. 		trigger_clear(mFlightTutorial_trigger.give_flap_trigger_02.name) 
  1904. 		effect_stop(mFlightTutorial_FlapVFX_2) 
  1905. 		Remote_CollectedOrb_B = true 
  1906. 	end 
  1907. end 
  1908. function mFlightTutorial_missed_flap_trigger_1_cb(player) 
  1909. 			if (player == LOCAL_PLAYER and Local_CollectedOrb_A == false) then 
  1910. 				--convo_start(mFlightTutorial_convo.fail_gat) then	 
  1911. 				fade_out( 0, 0, SYNC_LOCAL ) 
  1912. 				delay( 1.0 ) 
  1913. 				teleport( LOCAL_PLAYER, mLastIslandTriggered_Local ) 
  1914. 				fade_in( 0, 0, SYNC_LOCAL ) 
  1915. 				delay( 1.0 ) 
  1916. 				mFlightTutorial_convo.charge.sync = SYNC_LOCAL 
  1917. 				mFlightTutorial_convo.dash_end.sync = SYNC_LOCAL 
  1918. 				mFlightTutorial_convo.dive_start.sync = SYNC_LOCAL 
  1919. 				mFlightTutorial_convo.flight_end.sync = SYNC_LOCAL 
  1920. 				mFlightTutorial_convo.fail_a.sync = SYNC_LOCAL 
  1921. 				mFlightTutorial_convo.fail_b.sync = SYNC_LOCAL 
  1922. 				mFlightTutorial_convo.fall.sync = SYNC_LOCAL 
  1923. 				mFlightTutorial_convo.flap.sync = SYNC_LOCAL 
  1924. 				mFlightTutorial_convo.flap_nag.sync = SYNC_LOCAL 
  1925. 				mFlightTutorial_convo.flight_start.sync = SYNC_LOCAL 
  1926. 				mFlightTutorial_convo.flight_variant.sync = SYNC_LOCAL 
  1927. 				mFlightTutorial_convo.get_boost.sync = SYNC_LOCAL 
  1928. 				mFlightTutorial_convo.give_flap.sync = SYNC_LOCAL 
  1929. 				mFlightTutorial_convo.helper_first.sync = SYNC_LOCAL 
  1930. 				mFlightTutorial_convo.helper_second.sync = SYNC_LOCAL 
  1931. 				mFlightTutorial_convo.missed_boost.sync = SYNC_LOCAL 
  1932. 				mFlightTutorial_convo.powerup.sync = SYNC_LOCAL 
  1933. 				mFlightTutorial_convo.start.sync = SYNC_LOCAL 
  1934. 				mFlightTutorial_convo.turn.sync = SYNC_LOCAL 
  1935. 				mFlightTutorial_convo.use_flap.sync = SYNC_LOCAL 
  1936. 				mFlightTutorial_convo.wall_jump.sync = SYNC_LOCAL 
  1937. 				mFlightTutorial_convo.transition.sync = SYNC_LOCAL 
  1938. 				convo_end(mFlightTutorial_convo.charge) 
  1939. 				convo_end(mFlightTutorial_convo.dash_end) 
  1940. 				convo_end(mFlightTutorial_convo.dive_start) 
  1941. 				convo_end(mFlightTutorial_convo.flight_end) 
  1942. 				convo_end(mFlightTutorial_convo.fail_a) 
  1943. 				convo_end(mFlightTutorial_convo.fail_b) 
  1944. 				convo_end(mFlightTutorial_convo.fall) 
  1945. 				convo_end(mFlightTutorial_convo.flap) 
  1946. 				convo_end(mFlightTutorial_convo.flap_nag) 
  1947. 				convo_end(mFlightTutorial_convo.flight_start) 
  1948. 				convo_end(mFlightTutorial_convo.flight_variant) 
  1949. 				convo_end(mFlightTutorial_convo.get_boost) 
  1950. 				convo_end(mFlightTutorial_convo.give_flap) 
  1951. 				convo_end(mFlightTutorial_convo.helper_first) 
  1952. 				convo_end(mFlightTutorial_convo.helper_second) 
  1953. 				convo_end(mFlightTutorial_convo.missed_boost) 
  1954. 				convo_end(mFlightTutorial_convo.powerup) 
  1955. 				convo_end(mFlightTutorial_convo.start) 
  1956. 				convo_end(mFlightTutorial_convo.turn) 
  1957. 				convo_end(mFlightTutorial_convo.use_flap) 
  1958. 				convo_end(mFlightTutorial_convo.wall_jump) 
  1959. 				convo_end(mFlightTutorial_convo.transition) 
  1960. 				delay( 1.0 ) 
  1961. 				mFlightTutorial_convo.missed_boost.sync = SYNC_LOCAL 
  1962. 				convo_start(mFlightTutorial_convo.missed_boost) 
  1963. 			elseif (player == REMOTE_PLAYER and Remote_CollectedOrb_B == false)  then 
  1964. 				fade_out( 0, 0, SYNC_REMOTE ) 
  1965. 				delay( 1.0 ) 
  1966. 				teleport( REMOTE_PLAYER, mLastIslandTriggered_Remote ) 
  1967. 				delay( 1.0 ) 
  1968. 				fade_in( 0, 0, SYNC_REMOTE ) 
  1969. 				mFlightTutorial_convo.charge.sync = SYNC_REMOTE 
  1970. 				mFlightTutorial_convo.dash_end.sync = SYNC_REMOTE 
  1971. 				mFlightTutorial_convo.dive_start.sync = SYNC_REMOTE 
  1972. 				mFlightTutorial_convo.flight_end.sync = SYNC_REMOTE 
  1973. 				mFlightTutorial_convo.fail_a.sync = SYNC_REMOTE 
  1974. 				mFlightTutorial_convo.fail_b.sync = SYNC_REMOTE 
  1975. 				mFlightTutorial_convo.fall.sync = SYNC_REMOTE 
  1976. 				mFlightTutorial_convo.flap.sync = SYNC_REMOTE 
  1977. 				mFlightTutorial_convo.flap_nag.sync = SYNC_REMOTE 
  1978. 				mFlightTutorial_convo.flight_start.sync = SYNC_REMOTE 
  1979. 				mFlightTutorial_convo.flight_variant.sync = SYNC_REMOTE 
  1980. 				mFlightTutorial_convo.get_boost.sync = SYNC_REMOTE 
  1981. 				mFlightTutorial_convo.give_flap.sync = SYNC_REMOTE 
  1982. 				mFlightTutorial_convo.helper_first.sync = SYNC_REMOTE 
  1983. 				mFlightTutorial_convo.helper_second.sync = SYNC_REMOTE 
  1984. 				mFlightTutorial_convo.missed_boost.sync = SYNC_REMOTE 
  1985. 				mFlightTutorial_convo.powerup.sync = SYNC_REMOTE 
  1986. 				mFlightTutorial_convo.start.sync = SYNC_REMOTE 
  1987. 				mFlightTutorial_convo.turn.sync = SYNC_REMOTE 
  1988. 				mFlightTutorial_convo.use_flap.sync = SYNC_REMOTE 
  1989. 				mFlightTutorial_convo.wall_jump.sync = SYNC_REMOTE 
  1990. 				mFlightTutorial_convo.transition.sync = SYNC_REMOTE 
  1991. 				convo_end(mFlightTutorial_convo.charge) 
  1992. 				convo_end(mFlightTutorial_convo.dash_end) 
  1993. 				convo_end(mFlightTutorial_convo.dive_start) 
  1994. 				convo_end(mFlightTutorial_convo.flight_end) 
  1995. 				convo_end(mFlightTutorial_convo.fail_a) 
  1996. 				convo_end(mFlightTutorial_convo.fail_b) 
  1997. 				convo_end(mFlightTutorial_convo.fall) 
  1998. 				convo_end(mFlightTutorial_convo.flap) 
  1999. 				convo_end(mFlightTutorial_convo.flap_nag) 
  2000. 				convo_end(mFlightTutorial_convo.flight_start) 
  2001. 				convo_end(mFlightTutorial_convo.flight_variant) 
  2002. 				convo_end(mFlightTutorial_convo.get_boost) 
  2003. 				convo_end(mFlightTutorial_convo.give_flap) 
  2004. 				convo_end(mFlightTutorial_convo.helper_first) 
  2005. 				convo_end(mFlightTutorial_convo.helper_second) 
  2006. 				convo_end(mFlightTutorial_convo.missed_boost) 
  2007. 				convo_end(mFlightTutorial_convo.powerup) 
  2008. 				convo_end(mFlightTutorial_convo.start) 
  2009. 				convo_end(mFlightTutorial_convo.turn) 
  2010. 				convo_end(mFlightTutorial_convo.use_flap) 
  2011. 				convo_end(mFlightTutorial_convo.wall_jump) 
  2012. 				convo_end(mFlightTutorial_convo.transition) 
  2013. 				delay( 1.0 ) 
  2014. 				mFlightTutorial_convo.missed_boost.sync = SYNC_REMOTE 
  2015. 				convo_start(mFlightTutorial_convo.missed_boost) 
  2016. 			end 
  2017. end 
  2018. -- last trigger they tripped. 
  2019. bFailedAlternate = true 
  2020.  
  2021. bLavaReadyLocal = true 
  2022. bLavaReadyRemote = true 
  2023. -- Callback function for the lava trigger to teleport the player back to the 
  2024. function mFlightTutorial_lava_trigger_callback(player_name) 
  2025. 	 
  2026. 	--delay(1.0) 
  2027. 	 
  2028. 	if( mFlightTutorial_UsePlayerLeash )then 
  2029. 		 
  2030. 		if (player_name == LOCAL_PLAYER) then 
  2031. 		  if(bLavaReadyLocal == true ) then	 
  2032. 				bLavaReadyLocal = false 
  2033. 				-- ResetLocalPlayer stuff 
  2034. 				ResetLocalPlayerStuff() 
  2035. 		  end 
  2036. 		elseif (bLavaReadyRemote == true) then 
  2037. 			bLavaReadyRemote = false 
  2038. 			ResetRemotePlayerStuff() 
  2039. 		end 
  2040. 	end 
  2041. end 
  2042. function ResetLocalPlayerStuff() 
  2043. 	fade_out( 0, 0, SYNC_LOCAL ) 
  2044. 	delay( 1.0 ) 
  2045. 		mFlightTutorial_convo.charge.sync = SYNC_LOCAL 
  2046. 		mFlightTutorial_convo.dash_end.sync = SYNC_LOCAL 
  2047. 		mFlightTutorial_convo.dive_start.sync = SYNC_LOCAL 
  2048. 		mFlightTutorial_convo.flight_end.sync = SYNC_LOCAL 
  2049. 		mFlightTutorial_convo.fail_a.sync = SYNC_LOCAL 
  2050. 		mFlightTutorial_convo.fail_b.sync = SYNC_LOCAL 
  2051. 		mFlightTutorial_convo.fall.sync = SYNC_LOCAL 
  2052. 		mFlightTutorial_convo.flap.sync = SYNC_LOCAL 
  2053. 		mFlightTutorial_convo.flap_nag.sync = SYNC_LOCAL 
  2054. 		mFlightTutorial_convo.flight_start.sync = SYNC_LOCAL 
  2055. 		mFlightTutorial_convo.flight_variant.sync = SYNC_LOCAL 
  2056. 		mFlightTutorial_convo.get_boost.sync = SYNC_LOCAL 
  2057. 		mFlightTutorial_convo.give_flap.sync = SYNC_LOCAL 
  2058. 		mFlightTutorial_convo.helper_first.sync = SYNC_LOCAL 
  2059. 		mFlightTutorial_convo.helper_second.sync = SYNC_LOCAL 
  2060. 		mFlightTutorial_convo.missed_boost.sync = SYNC_LOCAL 
  2061. 		mFlightTutorial_convo.powerup.sync = SYNC_LOCAL 
  2062. 		mFlightTutorial_convo.start.sync = SYNC_LOCAL 
  2063. 		mFlightTutorial_convo.turn.sync = SYNC_LOCAL 
  2064. 		mFlightTutorial_convo.use_flap.sync = SYNC_LOCAL 
  2065. 		mFlightTutorial_convo.wall_jump.sync = SYNC_LOCAL 
  2066. 		mFlightTutorial_convo.transition.sync = SYNC_LOCAL 
  2067. 		convo_end(mFlightTutorial_convo.charge) 
  2068. 		convo_end(mFlightTutorial_convo.dash_end) 
  2069. 		convo_end(mFlightTutorial_convo.dive_start) 
  2070. 		convo_end(mFlightTutorial_convo.flight_end) 
  2071. 		convo_end(mFlightTutorial_convo.fail_a) 
  2072. 		convo_end(mFlightTutorial_convo.fail_b) 
  2073. 		convo_end(mFlightTutorial_convo.fall) 
  2074. 		convo_end(mFlightTutorial_convo.flap) 
  2075. 		convo_end(mFlightTutorial_convo.flap_nag) 
  2076. 		convo_end(mFlightTutorial_convo.flight_start) 
  2077. 		convo_end(mFlightTutorial_convo.flight_variant) 
  2078. 		convo_end(mFlightTutorial_convo.get_boost) 
  2079. 		convo_end(mFlightTutorial_convo.give_flap) 
  2080. 		convo_end(mFlightTutorial_convo.helper_first) 
  2081. 		convo_end(mFlightTutorial_convo.helper_second) 
  2082. 		convo_end(mFlightTutorial_convo.missed_boost) 
  2083. 		convo_end(mFlightTutorial_convo.powerup) 
  2084. 		convo_end(mFlightTutorial_convo.start) 
  2085. 		convo_end(mFlightTutorial_convo.turn) 
  2086. 		convo_end(mFlightTutorial_convo.use_flap) 
  2087. 		convo_end(mFlightTutorial_convo.wall_jump) 
  2088. 		convo_end(mFlightTutorial_convo.transition) 
  2089. 	teleport( LOCAL_PLAYER, mLastIslandTriggered_Local ) 
  2090. 	fade_in( 0, 0, SYNC_LOCAL ) 
  2091. 	-- Set the FLAP orb if the player fell at that one! 
  2092. 	if (mLastIslandTriggered_Local == "dive_respawn_nav_host") then 
  2093. 		if (Local_CollectedOrb_A == true) then 
  2094. 			mFlightTutorial_FlapVFX_1 = effect_play("Vfx Hb Xtraflap 01<001>", true, SYNC_LOCAL) 
  2095. 			trigger_setup( mFlightTutorial_trigger.give_flap_trigger_01) 
  2096. 			trigger_setup(mFlightTutorial_trigger.missed_flap_trigger_1) 
  2097. 			marker_add(mFlightTutorial_group.use_flap_orbs.use_flap_orb_1, MINIMAP_ICON_LOCATION,OI_ASSET_LOCATION, OI_FLAGS_DEFAULT, SYNC_LOCAL)  
  2098. 			object_indicator_add( mFlightTutorial_group.use_flap_orbs.use_flap_orb_1, OI_ASSET_LOCATION, OI_FLAGS_DEFAULT, SYNC_LOCAL ) 
  2099. 		 
  2100. 			Local_CollectedOrb_A = false 
  2101. 			FlapsCollected = FlapsCollected - 1 
  2102. 		end 
  2103. 		--marker_add_trigger( mFlightTutorial_group.use_flap_orbs.use_flap_orb_1, FLIGHTTUT_CUSTOM_TRIGGER_LOCATION.minimap_icon_name, FLIGHTTUT_CUSTOM_TRIGGER_LOCATION.ingame_effect_name, FLIGHTTUT_CUSTOM_TRIGGER_LOCATION.object_indicator_id, FLIGHTTUT_CUSTOM_TRIGGER_LOCATION.object_indicator_flags, SYNC_LOCAL ) 
  2104. 	end 
  2105. 		-- cleanup and reset riggers and orbs 
  2106. 	if (mLastIslandTriggered_Local == "runningjump_respawn_nav_host") then 
  2107.  
  2108. 		mFlighTutorial_breadcrumb_1(LOCAL_PLAYER) 
  2109. 		mFlighTutorial_breadcrumb_2(LOCAL_PLAYER) 
  2110. 		mFlighTutorial_breadcrumb_3(LOCAL_PLAYER) 
  2111. 		mFlighTutorial_breadcrumb_4(LOCAL_PLAYER) 
  2112. 		mFlighTutorial_breadcrumb_5(LOCAL_PLAYER) 
  2113.  
  2114. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_01) 
  2115. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_02) 
  2116. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_03) 
  2117. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_04) 
  2118. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_05) 
  2119.  
  2120. 		mFlightTutorial_BreadCrumb_1 = effect_play("Vfx Hb Boostnode<001>", true, SYNC_LOCAL) 
  2121. 		mFlightTutorial_BreadCrumb_2 = effect_play("Vfx Hb Boostnode<002>", true, SYNC_LOCAL) 
  2122. 		mFlightTutorial_BreadCrumb_3 = effect_play("Vfx Hb Boostnode<003>", true, SYNC_LOCAL) 
  2123. 		mFlightTutorial_BreadCrumb_4 = effect_play("Vfx Hb Boostnode<004>", true, SYNC_LOCAL) 
  2124. 		mFlightTutorial_BreadCrumb_5 = effect_play("Vfx Hb Boostnode<005>", true, SYNC_LOCAL) 
  2125. 		delay( 1.5 ) 
  2126. 		if (bFailedAlternate == true) then 
  2127. 			mFlightTutorial_convo.fail_a.sync = SYNC_LOCAL 
  2128. 			convo_start(mFlightTutorial_convo.fail_a) 
  2129. 			bFailedAlternate = false 
  2130. 		else 
  2131. 			mFlightTutorial_convo.fail_b.sync = SYNC_LOCAL 
  2132. 			convo_start(mFlightTutorial_convo.fail_b) 
  2133. 			bFailedAlternate = true 
  2134. 		end 
  2135. 	elseif (mLastIslandTriggered_Local == "climb_respawn_nav_host") then 
  2136.  
  2137. 		mFlighTutorial_breadcrumb_11(LOCAL_PLAYER) 
  2138. 		mFlighTutorial_breadcrumb_12(LOCAL_PLAYER) 
  2139. 		mFlighTutorial_breadcrumb_13(LOCAL_PLAYER) 
  2140. 		mFlighTutorial_breadcrumb_14(LOCAL_PLAYER) 
  2141. 		mFlighTutorial_breadcrumb_15(LOCAL_PLAYER) 
  2142.  
  2143. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_11) 
  2144. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_12) 
  2145. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_13) 
  2146. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_14) 
  2147. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_15) 
  2148.  
  2149. 		mFlightTutorial_BreadCrumb_11 = effect_play("Vfx Hb Boostnode<011>", true, SYNC_LOCAL) 
  2150. 		mFlightTutorial_BreadCrumb_12 = effect_play("Vfx Hb Boostnode<012>", true, SYNC_LOCAL) 
  2151. 		mFlightTutorial_BreadCrumb_13 = effect_play("Vfx Hb Boostnode<013>", true, SYNC_LOCAL) 
  2152. 		mFlightTutorial_BreadCrumb_14 = effect_play("Vfx Hb Boostnode<014>", true, SYNC_LOCAL) 
  2153. 		mFlightTutorial_BreadCrumb_15 = effect_play("Vfx Hb Boostnode<015>", true, SYNC_LOCAL) 
  2154. 		delay( 1.5 ) 
  2155. 	else  
  2156. 		delay( 1.5 ) 
  2157. 	end 
  2158. 	local_warping = false 
  2159. 	bLavaReadyLocal = true 
  2160. end 
  2161. function ResetRemotePlayerStuff() 
  2162. 	fade_out( 0, 0, SYNC_REMOTE ) 
  2163. 	delay( 1.0 ) 
  2164. 	mFlightTutorial_convo.charge.sync = SYNC_REMOTE 
  2165. 	convo_end(mFlightTutorial_convo.charge) 
  2166. 	mFlightTutorial_convo.charge.sync = SYNC_REMOTE 
  2167. 				mFlightTutorial_convo.dash_end.sync = SYNC_REMOTE 
  2168. 				mFlightTutorial_convo.dive_start.sync = SYNC_REMOTE 
  2169. 				mFlightTutorial_convo.flight_end.sync = SYNC_REMOTE 
  2170. 				mFlightTutorial_convo.fail_a.sync = SYNC_REMOTE 
  2171. 				mFlightTutorial_convo.fail_b.sync = SYNC_REMOTE 
  2172. 				mFlightTutorial_convo.fall.sync = SYNC_REMOTE 
  2173. 				mFlightTutorial_convo.flap.sync = SYNC_REMOTE 
  2174. 				mFlightTutorial_convo.flap_nag.sync = SYNC_REMOTE 
  2175. 				mFlightTutorial_convo.flight_start.sync = SYNC_REMOTE 
  2176. 				mFlightTutorial_convo.flight_variant.sync = SYNC_REMOTE 
  2177. 				mFlightTutorial_convo.get_boost.sync = SYNC_REMOTE 
  2178. 				mFlightTutorial_convo.give_flap.sync = SYNC_REMOTE 
  2179. 				mFlightTutorial_convo.helper_first.sync = SYNC_REMOTE 
  2180. 				mFlightTutorial_convo.helper_second.sync = SYNC_REMOTE 
  2181. 				mFlightTutorial_convo.missed_boost.sync = SYNC_REMOTE 
  2182. 				mFlightTutorial_convo.powerup.sync = SYNC_REMOTE 
  2183. 				mFlightTutorial_convo.start.sync = SYNC_REMOTE 
  2184. 				mFlightTutorial_convo.turn.sync = SYNC_REMOTE 
  2185. 				mFlightTutorial_convo.use_flap.sync = SYNC_REMOTE 
  2186. 				mFlightTutorial_convo.wall_jump.sync = SYNC_REMOTE 
  2187. 				mFlightTutorial_convo.transition.sync = SYNC_REMOTE 
  2188. 				convo_end(mFlightTutorial_convo.charge) 
  2189. 				convo_end(mFlightTutorial_convo.dash_end) 
  2190. 				convo_end(mFlightTutorial_convo.dive_start) 
  2191. 				convo_end(mFlightTutorial_convo.flight_end) 
  2192. 				convo_end(mFlightTutorial_convo.fail_a) 
  2193. 				convo_end(mFlightTutorial_convo.fail_b) 
  2194. 				convo_end(mFlightTutorial_convo.fall) 
  2195. 				convo_end(mFlightTutorial_convo.flap) 
  2196. 				convo_end(mFlightTutorial_convo.flap_nag) 
  2197. 				convo_end(mFlightTutorial_convo.flight_start) 
  2198. 				convo_end(mFlightTutorial_convo.flight_variant) 
  2199. 				convo_end(mFlightTutorial_convo.get_boost) 
  2200. 				convo_end(mFlightTutorial_convo.give_flap) 
  2201. 				convo_end(mFlightTutorial_convo.helper_first) 
  2202. 				convo_end(mFlightTutorial_convo.helper_second) 
  2203. 				convo_end(mFlightTutorial_convo.missed_boost) 
  2204. 				convo_end(mFlightTutorial_convo.powerup) 
  2205. 				convo_end(mFlightTutorial_convo.start) 
  2206. 				convo_end(mFlightTutorial_convo.turn) 
  2207. 				convo_end(mFlightTutorial_convo.use_flap) 
  2208. 				convo_end(mFlightTutorial_convo.wall_jump) 
  2209. 				convo_end(mFlightTutorial_convo.transition) 
  2210. 	teleport( REMOTE_PLAYER, mLastIslandTriggered_Remote ) 
  2211. 	fade_in( 0, 0, SYNC_REMOTE ) 
  2212. 	if (mLastIslandTriggered_Remote == "dive_respawn_nav_host") then 
  2213. 		if (Remote_CollectedOrb_B == true) then 
  2214. 				mFlightTutorial_FlapVFX_2 = effect_play("Vfx Hb Xtraflap 01<002>", true, SYNC_REMOTE) 
  2215. 				trigger_setup( mFlightTutorial_trigger.give_flap_trigger_02) 
  2216. 				trigger_setup(mFlightTutorial_trigger.missed_flap_trigger_1) 
  2217. 				object_indicator_add( mFlightTutorial_group.use_flap_orbs.use_flap_orb_2, OI_ASSET_LOCATION, OI_FLAGS_DEFAULT, SYNC_REMOTE ) 
  2218. 				marker_add(mFlightTutorial_group.use_flap_orbs.use_flap_orb_2, MINIMAP_ICON_LOCATION,OI_ASSET_LOCATION, OI_FLAGS_DEFAULT, SYNC_REMOTE)  
  2219. 				Remote_CollectedOrb_B = false 
  2220. 				FlapsCollected = FlapsCollected - 1 
  2221. 		end 
  2222.  
  2223. 	-- Play appropriate VO 
  2224. 	elseif (mLastIslandTriggered_Remote == "runningjump_respawn_nav_host") then 
  2225. 		mFlighTutorial_breadcrumb_6(REMOTE_PLAYER) 
  2226. 		mFlighTutorial_breadcrumb_7(REMOTE_PLAYER) 
  2227. 		mFlighTutorial_breadcrumb_8(REMOTE_PLAYER) 
  2228. 		mFlighTutorial_breadcrumb_9(REMOTE_PLAYER) 
  2229. 		mFlighTutorial_breadcrumb_10(REMOTE_PLAYER) 
  2230.  
  2231. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_06) 
  2232. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_07) 
  2233. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_08) 
  2234. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_09) 
  2235. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_10) 
  2236.  
  2237. 		mFlightTutorial_BreadCrumb_6 = effect_play("Vfx Hb Boostnode<006>", true, SYNC_REMOTE) 
  2238. 		mFlightTutorial_BreadCrumb_7 = effect_play("Vfx Hb Boostnode<007>", true, SYNC_REMOTE) 
  2239. 		mFlightTutorial_BreadCrumb_8 = effect_play("Vfx Hb Boostnode<008>", true, SYNC_REMOTE) 
  2240. 		mFlightTutorial_BreadCrumb_9 = effect_play("Vfx Hb Boostnode<009>", true, SYNC_REMOTE) 
  2241. 		mFlightTutorial_BreadCrumb_10 = effect_play("Vfx Hb Boostnode<010>", true, SYNC_REMOTE) 
  2242. 		delay( 1.5 ) 
  2243. 		if (bFailedAlternate == true) then 
  2244. 			mFlightTutorial_convo.fail_a.sync = SYNC_REMOTE 
  2245. 			convo_start(mFlightTutorial_convo.fail_a) 
  2246. 			bFailedAlternate = false 
  2247. 		else 
  2248. 			mFlightTutorial_convo.fail_b.sync = SYNC_REMOTE 
  2249. 			convo_start(mFlightTutorial_convo.fail_b) 
  2250. 			bFailedAlternate = true 
  2251. 		end 
  2252. 	elseif (mLastIslandTriggered_Local == "climb_respawn_nav_host") then 
  2253. 		mFlighTutorial_breadcrumb_16(REMOTE_PLAYER) 
  2254. 		mFlighTutorial_breadcrumb_17(REMOTE_PLAYER) 
  2255. 		mFlighTutorial_breadcrumb_18(REMOTE_PLAYER) 
  2256. 		mFlighTutorial_breadcrumb_19(REMOTE_PLAYER) 
  2257. 		mFlighTutorial_breadcrumb_20(REMOTE_PLAYER) 
  2258.  
  2259. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_16) 
  2260. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_17) 
  2261. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_18) 
  2262. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_19) 
  2263. 		trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_20) 
  2264. 		mFlightTutorial_BreadCrumb_16 = effect_play("Vfx Hb Boostnode<016>", true, SYNC_REMOTE) 
  2265. 		mFlightTutorial_BreadCrumb_17 = effect_play("Vfx Hb Boostnode<017>", true, SYNC_REMOTE) 
  2266. 		mFlightTutorial_BreadCrumb_18 = effect_play("Vfx Hb Boostnode<018>", true, SYNC_REMOTE) 
  2267. 		mFlightTutorial_BreadCrumb_19 = effect_play("Vfx Hb Boostnode<019>", true, SYNC_REMOTE) 
  2268. 		mFlightTutorial_BreadCrumb_20 = effect_play("Vfx Hb Boostnode<020>", true, SYNC_REMOTE) 
  2269. 		delay( 1.5 ) 
  2270. 	else  
  2271. 		delay( 1.5 ) 
  2272. 	end 
  2273. 	remote_warping  = false 
  2274. 	bLavaReadyRemote = true 
  2275. end 
  2276.  
  2277. function mFlighTutorial_breadcrumb_1(player_name) 
  2278. 	if (player_name == LOCAL_PLAYER) then 
  2279. 		effect_stop(mFlightTutorial_BreadCrumb_1) 
  2280. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_01.name) 
  2281. 	end 
  2282. end 
  2283. function mFlighTutorial_breadcrumb_2(player_name) 
  2284. 	if (player_name == LOCAL_PLAYER) then 
  2285. 		effect_stop(mFlightTutorial_BreadCrumb_2) 
  2286. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_02.name) 
  2287. 	end 
  2288. end 
  2289. function mFlighTutorial_breadcrumb_3(player_name) 
  2290. 	if (player_name == LOCAL_PLAYER) then 
  2291. 		effect_stop(mFlightTutorial_BreadCrumb_3) 
  2292. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_03.name) 
  2293. 	end 
  2294. end 
  2295. function mFlighTutorial_breadcrumb_4(player_name) 
  2296. 	if (player_name == LOCAL_PLAYER) then 
  2297. 		effect_stop(mFlightTutorial_BreadCrumb_4) 
  2298. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_04.name) 
  2299. 	end 
  2300. end 
  2301. function mFlighTutorial_breadcrumb_5(player_name) 
  2302. 	if (player_name == LOCAL_PLAYER) then 
  2303. 		effect_stop(mFlightTutorial_BreadCrumb_5) 
  2304. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_05.name) 
  2305. 	end 
  2306. end 
  2307. function mFlighTutorial_breadcrumb_6(player_name) 
  2308. 	if (player_name == REMOTE_PLAYER) then 
  2309. 		effect_stop(mFlightTutorial_BreadCrumb_6) 
  2310. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_06.name) 
  2311. 	end 
  2312. 	 
  2313. end 
  2314. function mFlighTutorial_breadcrumb_7(player_name) 
  2315. 	if (player_name == REMOTE_PLAYER) then 
  2316. 		effect_stop(mFlightTutorial_BreadCrumb_7) 
  2317. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_07.name) 
  2318. 	end 
  2319. 	 
  2320. end 
  2321. function mFlighTutorial_breadcrumb_8(player_name) 
  2322. 	if (player_name == REMOTE_PLAYER) then 
  2323. 		effect_stop(mFlightTutorial_BreadCrumb_8) 
  2324. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_08.name) 
  2325. 	end 
  2326. end 
  2327. function mFlighTutorial_breadcrumb_9(player_name) 
  2328. 	if (player_name == REMOTE_PLAYER) then 
  2329. 		effect_stop(mFlightTutorial_BreadCrumb_9) 
  2330. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_09.name) 
  2331. 	end 
  2332. end 
  2333. function mFlighTutorial_breadcrumb_10(player_name) 
  2334. 	if (player_name == REMOTE_PLAYER) then 
  2335. 		effect_stop(mFlightTutorial_BreadCrumb_10) 
  2336. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_10.name) 
  2337. 	end 
  2338. 	 
  2339. end 
  2340. function mFlighTutorial_breadcrumb_11(player_name) 
  2341. 	if (player_name == LOCAL_PLAYER) then 
  2342. 		effect_stop(mFlightTutorial_BreadCrumb_11) 
  2343. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_11.name) 
  2344. 	end 
  2345. end 
  2346. function mFlighTutorial_breadcrumb_12(player_name) 
  2347. 	if (player_name == LOCAL_PLAYER) then 
  2348. 		effect_stop(mFlightTutorial_BreadCrumb_12) 
  2349. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_12.name) 
  2350. 	end 
  2351. end 
  2352. function mFlighTutorial_breadcrumb_13(player_name) 
  2353. 	if (player_name == LOCAL_PLAYER) then 
  2354. 		effect_stop(mFlightTutorial_BreadCrumb_13) 
  2355. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_13.name) 
  2356. 	end 
  2357. end 
  2358. function mFlighTutorial_breadcrumb_14(player_name) 
  2359. 	if (player_name == LOCAL_PLAYER) then 
  2360. 		effect_stop(mFlightTutorial_BreadCrumb_14) 
  2361. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_14.name) 
  2362. 	end 
  2363. end 
  2364. function mFlighTutorial_breadcrumb_15(player_name) 
  2365. 	if (player_name == LOCAL_PLAYER) then 
  2366. 		effect_stop(mFlightTutorial_BreadCrumb_15) 
  2367. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_15.name) 
  2368. 	end 
  2369. end 
  2370. function mFlighTutorial_breadcrumb_16(player_name) 
  2371. 	if (player_name == REMOTE_PLAYER) then 
  2372. 		effect_stop(mFlightTutorial_BreadCrumb_16) 
  2373. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_16.name) 
  2374. 	end 
  2375. end 
  2376. function mFlighTutorial_breadcrumb_17(player_name) 
  2377. 	if (player_name == REMOTE_PLAYER) then 
  2378. 		effect_stop(mFlightTutorial_BreadCrumb_17) 
  2379. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_17.name) 
  2380. 	end 
  2381. end 
  2382. function mFlighTutorial_breadcrumb_18(player_name) 
  2383. 	if (player_name == REMOTE_PLAYER) then 
  2384. 		effect_stop(mFlightTutorial_BreadCrumb_18) 
  2385. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_18.name) 
  2386. 	end 
  2387. end 
  2388. function mFlighTutorial_breadcrumb_19(player_name) 
  2389. 	if (player_name == REMOTE_PLAYER) then 
  2390. 		effect_stop(mFlightTutorial_BreadCrumb_19) 
  2391. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_19.name) 
  2392. 	end 
  2393. end 
  2394. function mFlighTutorial_breadcrumb_20(player_name) 
  2395. 	if (player_name == REMOTE_PLAYER) then 
  2396. 		effect_stop(mFlightTutorial_BreadCrumb_20) 
  2397. 		trigger_clear(mFlightTutorial_trigger.Bread_Crumb_Trigger_20.name) 
  2398. 	end 
  2399. end 
  2400. function mFlightTutorial_cluster_collected( player, item ) 
  2401.  
  2402. 	-- Increment our clusters picked up count 
  2403. 	mFlightTutorial_clusters_collected = mFlightTutorial_clusters_collected + 1 
  2404.  
  2405. 	object_indicator_remove( item ) 
  2406. 	marker_remove( item ) 
  2407.  
  2408. 	-- Play the orb collect VFX 
  2409. 	effect_play_on_human("Vfx_soul_collect", player) 
  2410.  
  2411. 	-- Check to see if this is the last cluster picked up. 
  2412. 	--if mFlightTutorial_clusters_collected == MFLIGHTTUTORIAL_NUM_CLUSTERS then 
  2413. 	--	 
  2414. 	--	-- play the animation at the given navpoint	 
  2415. 	--	local anim_name = mFlightTutorial_animation_list.clusters_collected.anim_action_name 
  2416. 	--	local morph_name = anim_name 
  2417. 	--	local force_play = true	 
  2418. 	--	local stand_still = true 
  2419. 	--	local zero_movement = true 
  2420. 	--		 
  2421. 	--	character_clear_combat_move( player ) 
  2422. 	--	-- start the action 
  2423. 	--	action_play_non_blocking( player, anim_name, morph_name, force_play, stand_still, zero_movement ) 
  2424. 	--	 
  2425. 	--	-- Wait for player to react 
  2426. 	--	delay(2) 
  2427. 	-- 
  2428. 	--	while not action_play_is_finished(player, 1.0) do 
  2429. 	--		thread_yield() 
  2430. 	--	end 
  2431. 	-- 
  2432. 	--	--if coop_is_active() then 
  2433. 	--	--	while not action_play_is_finished(REMOTE_PLAYER, 1.0) do 
  2434. 	--	--		thread_yield() 
  2435. 	--	--	end 
  2436. 	--	--end 
  2437. 	-- 
  2438. 	--	-- Setup the altar trigger 
  2439. 	--	--trigger_setup( mFlightTutorial_trigger.altar_trigger ) 
  2440. 	--	-- 
  2441. 	--	--while mFlightTutorial_trigger.altar_trigger.disabled == false do 
  2442. 	--	--	thread_yield() 
  2443. 	--	--end 
  2444. 	--	-- 
  2445. 	--	---- Tell the player to go to the altar 
  2446. 	--	---- Dane V.O.? 
  2447. 	--	--objective_text( 0, "GM_FLIGHTTUT_OBJ_CHARGE_HALO", "", "", SYNC_ALL, OI_ASSET_LOCATION ) 
  2448. 	-- 
  2449. 	--end 
  2450. 	 
  2451. end 
  2452.  
  2453. function mFlightTutorial_damned_soul_on_death_cb( dead_character, attacker ) 
  2454.  
  2455. 	on_death( "", dead_character ) 
  2456. 	 
  2457. 	--explosion_create( "warden_arrive_land", dead_character ) 
  2458. 	character_destroy( dead_character ) 
  2459.  
  2460. 	-- Unhide the soul cluster 
  2461. 	item_show( mFlightTutorial_group.soul_clusters.cluster04.name ) 
  2462. end 
  2463.  
  2464. function mFlightTutorial_altar_trigger_cb( human, trigger ) 
  2465. 	 
  2466. 	-- do default trigger behavior 
  2467. 	trigger_cb( human, trigger ) 
  2468. 	 
  2469. 	local trigger_table = trigger_get_table( trigger ) 
  2470.  
  2471. 	-- play the animation at the given navpoint	 
  2472. 	local anim_name = trigger_table.anim_action 
  2473. 	local force_play = true	 
  2474. 	local percentage = 0.8 
  2475. 	local stand_still = true 
  2476. 	local zero_movement = true 
  2477. 		 
  2478. 	character_clear_combat_move( human ) 
  2479. 	-- start the action 
  2480. 	action_play( human, anim_name, anim_name, force_play, percentage, stand_still, zero_movement ) 
  2481.  
  2482. end 
  2483.  
  2484. -- HUD Prompt expects a callback, but we don't need it to 
  2485. -- do anything. Kind of wasteful imho. 
  2486. function mFlightTutorial_empty_cb() 
  2487. end 
  2488.  
  2489.  
  2490. -- Flight tutorial trigger callback 
  2491. -- 
  2492. -- player:		(string) name of the player that tripped the trigger 
  2493. -- trigger:		(string) name of the trigger 
  2494. -- 
  2495. function mFlightTutorial_trigger_cb( player, trigger ) 
  2496. 	-- This may be called multiple times in the same frame.  Never create groups in a trigger callback.  Use show group instead. 
  2497. 	 
  2498. 	-- find this trigger 
  2499. 	local trigger_table = trigger_get_table(trigger) 
  2500. 	 
  2501. 	if trigger_table ~= nil then 
  2502. 		--if trigger_table.hit == true then 
  2503. 		--	return 
  2504. 		--end 
  2505. 	 
  2506. 		trigger_table.last_hit_by = player 
  2507. 		trigger_table.hit = true 
  2508. 		 
  2509. 		--trigger_clear(trigger_table.name) 
  2510. 		--local is_player_standing = player_is_standing( player ) 
  2511. 		--local is_trigger_waypoint_active = trigger_table.waypoint 
  2512. 		-- 
  2513. 		---- Do not consider this trigger hit until we  
  2514. 		--if is_trigger_waypoint_active  == true and is_player_standing then 
  2515. 		--	--mission_waypoint_remove() 
  2516. 		--	marker_remove_trigger( trigger, SYNC_ALL ) 
  2517. 		--end				 
  2518. 	end 
  2519.  
  2520. end 
  2521.  
  2522. -------------------------------------------------------------------------------------------------- 
  2523. 								--[[**********************]]-- 
  2524. 								--[[                      ]]-- 
  2525. 								--[[   Thread functions   ]]-- 
  2526. 								--[[                      ]]-- 
  2527. 								--[[**********************]]-- 
  2528.  
  2529. -- [[ mFlightTutorial_lava_trigger_thread_func ]] 
  2530. -- 
  2531. -- Resets the trigger and in order to 
  2532. -- allow the players to independently 
  2533. -- hit this trigger multiple times. 
  2534. --  
  2535. function mFlightTutorial_lava_trigger_thread_func( player ) 
  2536. 	 
  2537. 	while not mFlightTutorial_trigger.end_trigger.hit do 
  2538. 		 
  2539. 		if trigger_is_enabled( mFlightTutorial_trigger.lava_trigger.name ) == false and get_num_humans_in_trigger( mFlightTutorial_trigger.lava_trigger.name ) == 0 then 
  2540. 					 
  2541. 			trigger_setup( mFlightTutorial_trigger.lava_trigger ) 
  2542.  
  2543. 		end 
  2544.  
  2545. 		thread_yield() 
  2546. 	end 
  2547.  
  2548. end 
  2549.  
  2550. flight_state_machine_active = true 
  2551. AmStandingPromptActiveLocal = false 
  2552. AmJumpingPromptActiveLocal = false 
  2553. CanFlapPromptActiveLocal = false 
  2554. AmStandingPromptActiveRemote = false 
  2555. AmJumpingPromptActiveRemote = false 
  2556. CanFlapPromptActiveRemote = false 
  2557. testint = 999 
  2558.  
  2559. -- Check if the player used Flap thread 
  2560. function flight_state_machine_local() 
  2561. 	-- if its a local player then 
  2562. 	while ( flight_state_machine_active) do 
  2563. 			--[[ 
  2564. 			-- if the LOCAL PLAYER is standing 
  2565. 			if (player_is_standing(player)) then 
  2566. 				-- if the standing HUD prompt is OFF 
  2567. 				if (AmStandingPromptActiveLocal == false) then 
  2568. 					-- Turn on the HUD prompt for Local Player 
  2569. 					hud_prompt_clear(player) 
  2570. 					hud_prompt(player, "GM_FLIGHTTUT_HUD_USE_JUMP", "", true) 
  2571. 					AmStandingPromptActiveLocal = true 
  2572. 					AmJumpingPromptActiveLocal = false 
  2573. 					CanFlapPromptActiveLocal = false 
  2574.  
  2575. 				end 
  2576. 			]]-- 
  2577. 			-- if player is jumping 
  2578. 			 if (player_is_jumping(LOCAL_PLAYER)) then 
  2579. 				-- if the LOCAL jump prompt is off 
  2580. 				if (AmJumpingPromptActiveLocal == false) then 
  2581. 					-- turn on the HUD prompt for Local player 
  2582. 					hud_prompt_clear(LOCAL_PLAYER) 
  2583. 					hud_prompt(LOCAL_PLAYER, "GM_FLIGHTTUT_HUD_USE_FLIGHT", "", true) 
  2584. 					AmJumpingPromptActiveLocal = true 
  2585. 					AmStandingPromptActiveLocal = false 
  2586. 					CanFlapPromptActiveLocal = false 
  2587. 				end 
  2588. 			-- elseif the LOCAL player is Flying && if the Local Player Can flap 
  2589. 			elseif (player_is_gliding(LOCAL_PLAYER)) and (player_get_num_flaps(LOCAL_PLAYER, iCurrentFlapsLocal) > 0) then --and player_is_flying(player)) then 
  2590. 				testint = player_get_num_flaps(LOCAL_PLAYER, iCurrentFlapsLocal) 
  2591. 				-- if the LOCAL FLAP prompt is off 
  2592. 				if (CanFlapPromptActiveLocal == false) then 
  2593. 					-- turn on the HUD prompt for Local player 
  2594. 					hud_prompt_clear(LOCAL_PLAYER) 
  2595. 					hud_prompt(LOCAL_PLAYER, "GM_FLIGHTTUT_HUD_USE_FLAP", "", true) 
  2596. 					CanFlapPromptActiveLocal = true 
  2597. 					AmJumpingPromptActiveLocal = false 
  2598. 					AmStandingPromptActiveLocal = false 
  2599. 				end 
  2600. 			elseif ((AmJumpingPromptActiveLocal == true) or (CanFlapPromptActiveLocal == true) or (AmStandingPromptActiveLocal == true)) then 
  2601. 				hud_prompt_clear(LOCAL_PLAYER) 
  2602. 				CanFlapPromptActiveLocal = false 
  2603. 				AmJumpingPromptActiveLocal = false 
  2604. 				AmStandingPromptActiveLocal = false 
  2605. 			end 
  2606. 		-- else if the player is not local (he's the remote player 
  2607. 		thread_yield() 
  2608. 	end 
  2609. end 
  2610. function flight_state_machine_remote() 
  2611. 	-- if its a local player then 
  2612. 	while ( flight_state_machine_active) do 
  2613. 		-- if the REMOTE PLAYER is standing 
  2614. 			--[[ 
  2615. 			if (player_is_standing(player)) then 
  2616. 				-- if the standing HUD prompt is OFF 
  2617. 				if (AmStandingPromptActiveRemote == false) then 
  2618. 					-- Turn on the HUD prompt for REMOTE Player 
  2619. 					hud_prompt_clear(player) 
  2620. 					hud_prompt(player, "GM_FLIGHTTUT_HUD_USE_JUMP", "", true) 
  2621. 					AmStandingPromptActiveRemote = true 
  2622. 					AmJumpingPromptActiveRemote = false 
  2623. 					CanFlapPromptActiveRemote = false 
  2624. 				end 
  2625. 			]]-- 
  2626. 			-- if player is jumping 
  2627. 			if (player_is_jumping(REMOTE_PLAYER)) then 
  2628. 				-- if the REMOTE jump prompt is off 
  2629. 				if (AmJumpingPromptActiveRemote == false) then 
  2630. 					-- turn on the HUD prompt for Local player 
  2631. 					hud_prompt_clear(REMOTE_PLAYER) 
  2632. 					hud_prompt(REMOTE_PLAYER, "GM_FLIGHTTUT_HUD_USE_FLIGHT", "", true) 
  2633. 					AmJumpingPromptActiveRemote = true 
  2634. 					AmStandingPromptActiveRemote = false 
  2635. 					CanFlapPromptActiveRemote = false 
  2636. 				end 
  2637. 			-- elseif the REMOTE player is Flying && if the Local Player Can flap 
  2638. 			elseif ((player_is_gliding(REMOTE_PLAYER)) and (player_get_num_flaps(REMOTE_PLAYER, iCurrentFlapsRemote) > 0)) then  
  2639. 				-- if the REMOTE FLAP prompt is off 
  2640. 				local intFlaps = player_get_num_flaps(REMOTE_PLAYER, iCurrentFlapsRemote) 
  2641. 				if (CanFlapPromptActiveRemote == false) then 
  2642. 					-- turn on the HUD prompt for Local player 
  2643. 					hud_prompt_clear(REMOTE_PLAYER) 
  2644. 					hud_prompt(REMOTE_PLAYER, "GM_FLIGHTTUT_HUD_USE_FLAP", "", true) 
  2645. 					CanFlapPromptActiveRemote = true 
  2646. 					AmJumpingPromptActiveRemote = false 
  2647. 					AmStandingPromptActiveRemote = false 
  2648. 				end 
  2649. 			-- nothing is on 
  2650. 			elseif ((AmJumpingPromptActiveRemote == true) or (CanFlapPromptActiveRemote == true) or (AmStandingPromptActiveRemote == true)) then 
  2651. 				hud_prompt_clear(REMOTE_PLAYER) 
  2652. 				CanFlapPromptActiveRemote = false 
  2653. 				AmJumpingPromptActiveRemote = false 
  2654. 				AmStandingPromptActiveRemote = false 
  2655. 			end 
  2656. 		thread_yield() 
  2657. 	end 
  2658. end			 
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667. -- [[ mFlightTutorial_leash_thread ]] 
  2668. -- 
  2669. -- Checks to see if the players are trying to fly away from the tutorial area 
  2670. --  
  2671.  local_warping = false 
  2672.  remote_warping = false 
  2673. function mFlightTutorial_leash_thread(player) 
  2674.  
  2675. 	while mFlightTutorial_UsePlayerLeash do	 
  2676. 		if ((player == LOCAL_PLAYER) and (not local_warping))  then 
  2677. 			if get_dist(LOCAL_PLAYER, mLastIslandTriggered_Local) > mImpfest_leash_distance then 
  2678. 				local_warping = true 
  2679. 				ResetLocalPlayerStuff() 
  2680. 				--convo_start(mFlightTutorial_convo.leash_gat) 
  2681. 				 
  2682. 			end 
  2683. 		elseif ((player == REMOTE_PLAYER) and (not remote_warping)) then 
  2684. 			if get_dist(REMOTE_PLAYER, mLastIslandTriggered_Remote) > mImpfest_leash_distance then 
  2685. 				remote_warping = true 
  2686. 				ResetRemotePlayerStuff() 
  2687. 				 
  2688. 			end 
  2689. 		end 
  2690. 		thread_yield() 
  2691. 	end 
  2692. end 
  2693.  
  2694. -- [[ mFlightTutorial_tutorial_triggers_thread_func ]] 
  2695. -- 
  2696. -- Sets up the tutorial triggers for each of the players 
  2697. -- so that they may independently hit each marker on their on.  
  2698. iNumPlayersFinishedFirstFlight = 0 
  2699. iNumPlayersFinishedClimbFlight = 0 
  2700. function mFlightTutorial_tutorial_triggers_thread_func( player ) 
  2701. 	 
  2702. 		------------------------- 
  2703. 	-- 
  2704. 	-- [[ Jump Trigger ]] -- 
  2705. 	-- 
  2706. 	------------------------- 
  2707. 	-- Figure out the sync type. (TWO THREADS, ONE FOR EACH PLAYER) 
  2708. 	local sync_type = SYNC_LOCAL 
  2709. 	local sync_index = 0 
  2710. 	if player == REMOTE_PLAYER then 
  2711. 		sync_type = SYNC_REMOTE 
  2712. 		sync_index = 1 
  2713. 	end 
  2714. 	--convo_end_all() 
  2715. 	-- "Let's start slow, try to jump over to that next island 
  2716. 	mFlightTutorial_convo.charge.sync = sync_type 
  2717. 	convo_start(mFlightTutorial_convo.charge) 
  2718. 	-- Tap 'A' to Jump 
  2719. 	mFlightTutorial_set_tutorial_text( "flight_tut_jump", player )	 
  2720. 	-- SET OBJECIVE 
  2721. 	objective_text_clear( sync_index ) 
  2722. 	objective_text( sync_index, "SRG_FLIGHTTUT_OBJ_JUMP", nil, nil, sync_type, OI_ASSET_LOCATION )	 
  2723. 	 
  2724. 	-- Set up the first jump trigger	 
  2725. 	trigger_setup( mFlightTutorial_trigger.jump_trigger_01 ) 
  2726. 	if (player == LOCAL_PLAYER) then 
  2727. 		mFlightTutorial_set_trigger_marker( mFlightTutorial_trigger.jump_trigger_01.name, SYNC_LOCAL ) 
  2728. 	else 
  2729. 		mFlightTutorial_set_trigger_marker( mFlightTutorial_trigger.jump_trigger_01.name, SYNC_REMOTE ) 
  2730. 	end 
  2731.  
  2732. 	while not( object_is_in_trigger( mFlightTutorial_trigger.jump_trigger_01.name, player ) and player_is_standing( player ) ) do 
  2733. 		thread_yield() 
  2734. 	end 
  2735.  
  2736. 	-- Since we've activated this trigger, save this as the teleport to location. 
  2737. 	marker_remove_trigger( mFlightTutorial_trigger.jump_trigger_01.name, sync_type ) 
  2738. 	mFlightTutorial_trigger_transition( player, "jump_respawn_nav_host", mFlightTutorial_trigger.walljump_trigger_01.name ) 
  2739. 	 
  2740. 	------------------------- 
  2741. 	-- 
  2742. 	-- [[  Charge Jump Trigger ]] 
  2743. 	-- 
  2744. 	------------------------- 
  2745. 	 
  2746. 	-- set up the wall jump trigger 
  2747. 	trigger_setup( mFlightTutorial_trigger.walljump_trigger_01 ) 
  2748. 	--  
  2749. 	mFlightTutorial_set_tutorial_text( "flight_tut_charge_jump", player ) 
  2750. 	-- SET OBJECIVE 
  2751.  
  2752. 	objective_text_clear( sync_index ) 
  2753. 	objective_text( sync_index, "SRG_FLIGHTTUT_OBJ_CHARGEJUMP", nil, nil, sync_type, OI_ASSET_LOCATION )	 
  2754.  
  2755. 	while not( object_is_in_trigger( mFlightTutorial_trigger.walljump_trigger_01.name, player ) and player_is_standing( player ) ) do 
  2756. 		thread_yield() 
  2757. 	end 
  2758. 		------------------------- 
  2759. 	-- 
  2760. 	-- [[ Wall Jump Trigger ]] 
  2761. 	-- 
  2762. 	------------------------- 
  2763. 	-- Since we've activated this trigger, save this as the teleport to location.	 
  2764. 	marker_remove_trigger( mFlightTutorial_trigger.walljump_trigger_01.name, sync_type ) 
  2765.  
  2766. 	-- conversation For Wall Jump STart 
  2767. 	mFlightTutorial_convo.charge.sync = sync_type 
  2768. 	convo_end(mFlightTutorial_convo.charge) 
  2769. 	--convo_end_all() 
  2770. 	mFlightTutorial_convo.wall_jump.sync = sync_type 
  2771. 	convo_start(mFlightTutorial_convo.wall_jump) 
  2772.  
  2773. 	mFlightTutorial_set_tutorial_text( "flight_tut_wall_jump", player )	 
  2774. 	-- SET OBJECIVE 
  2775. 	objective_text_clear( sync_index ) 
  2776. 	objective_text( sync_index, "SRG_FLIGHTTUT_OBJ_WALLJUMP", nil, nil, sync_type, OI_ASSET_LOCATION ) 
  2777.  
  2778. 	mFlightTutorial_trigger_transition( player, "walljump_respawn_nav_host", mFlightTutorial_trigger.runningjump_trigger_01.name ) 
  2779. 	trigger_setup( mFlightTutorial_trigger.runningjump_trigger_01 ) 
  2780. 	while not( object_is_in_trigger( mFlightTutorial_trigger.runningjump_trigger_01.name, player ) and player_is_standing( player ) ) do 
  2781. 		thread_yield() 
  2782. 	end 
  2783.  
  2784. 		------------------------- 
  2785. 	-- 
  2786. 	-- [[ Formerly Sprint, now first flight Trigger ]] 
  2787. 	-- 
  2788. 	------------------------- 
  2789. 	-- Since we've activated this trigger, save this as the teleport to location.	 
  2790. 	marker_remove_trigger( mFlightTutorial_trigger.runningjump_trigger_01.name, sync_type ) 
  2791.  
  2792. 	--convo_end_all() 
  2793. 	--convo_start(mFlightTutorial_convo.dash_start) 
  2794. 	 
  2795. 	mFlightTutorial_trigger_transition( player, "runningjump_respawn_nav_host", mFlightTutorial_trigger.glide_trigger_01.name ) 
  2796. 	-- this is actually the wall jump! 
  2797. 	mFlightTutorial_set_tutorial_text( "flight_tut_sprint_jump", player )	 
  2798. 	-- SET OBJECIVE 
  2799. 	objective_text_clear( sync_index ) 
  2800. 	objective_text( sync_index, "SRG_FLIGHTTUT_OBJ_FIRSTFLIGHT", nil, nil, sync_type, OI_ASSET_LOCATION ) 
  2801. 	 
  2802. 	mFlightTutorial_convo.wall_jump.sync = sync_type 
  2803. 	convo_end(mFlightTutorial_convo.wall_jump) 
  2804. 	--convo_end_all() 
  2805. 	mFlightTutorial_convo.flight_variant.sync = sync_type 
  2806. 	convo_start(mFlightTutorial_convo.flight_variant) 
  2807. 	-- Give the player the power of flight!!! 
  2808. 	player_flight_unlock( player, true ) 
  2809. 	-- Get the boost orb! 
  2810.  
  2811. 		if (player == REMOTE_PLAYER) then 
  2812. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_06) 
  2813. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_07) 
  2814. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_08) 
  2815. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_09) 
  2816. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_10) 
  2817. 			mFlightTutorial_BreadCrumb_6 = effect_play("Vfx Hb Boostnode<006>", true, SYNC_REMOTE) 
  2818. 			mFlightTutorial_BreadCrumb_7 = effect_play("Vfx Hb Boostnode<007>", true, SYNC_REMOTE) 
  2819. 			mFlightTutorial_BreadCrumb_8 = effect_play("Vfx Hb Boostnode<008>", true, SYNC_REMOTE) 
  2820. 			mFlightTutorial_BreadCrumb_9 = effect_play("Vfx Hb Boostnode<009>", true, SYNC_REMOTE) 
  2821. 			mFlightTutorial_BreadCrumb_10 = effect_play("Vfx Hb Boostnode<010>", true, SYNC_REMOTE) 
  2822. 		else 
  2823. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_01) 
  2824. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_02) 
  2825. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_03) 
  2826. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_04) 
  2827. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_05) 
  2828. 			mFlightTutorial_BreadCrumb_1 = effect_play("Vfx Hb Boostnode<001>", true, SYNC_LOCAL) 
  2829. 			mFlightTutorial_BreadCrumb_2 = effect_play("Vfx Hb Boostnode<002>", true, SYNC_LOCAL) 
  2830. 			mFlightTutorial_BreadCrumb_3 = effect_play("Vfx Hb Boostnode<003>", true, SYNC_LOCAL) 
  2831. 			mFlightTutorial_BreadCrumb_4 = effect_play("Vfx Hb Boostnode<004>", true, SYNC_LOCAL) 
  2832. 			mFlightTutorial_BreadCrumb_5 = effect_play("Vfx Hb Boostnode<005>", true, SYNC_LOCAL) 
  2833. 		end 
  2834.  
  2835.  
  2836. 	-- Start the state machine for HUD propts 
  2837. 	if (player == REMOTE_PLAYER) then 
  2838. 		mFlightTutorial_thread.flight_state_machine = thread_new( "flight_state_machine_remote" ) 
  2839. 	else 
  2840. 		mFlightTutorial_thread.flight_state_machine = thread_new( "flight_state_machine_local" ) 
  2841. 	end 
  2842. 	-- Set up the next trigger 
  2843. 	trigger_setup( mFlightTutorial_trigger.glide_trigger_01 )	 
  2844. 	--message( "Basic Flight.", 10.0, false ) 
  2845.  
  2846. 	while not( object_is_in_trigger( mFlightTutorial_trigger.glide_trigger_01.name, player ) and player_is_standing( player ) )do 
  2847. 		thread_yield() 
  2848. 	end 
  2849.  
  2850. 	iNumPlayersFinishedFirstFlight = iNumPlayersFinishedFirstFlight + 1 
  2851. 	-- cleanup triggers and orbs 
  2852. 	if (player == REMOTE_PLAYER) then 
  2853.  
  2854. 			mFlighTutorial_breadcrumb_6(REMOTE_PLAYER) 
  2855. 			mFlighTutorial_breadcrumb_7(REMOTE_PLAYER) 
  2856. 			mFlighTutorial_breadcrumb_8(REMOTE_PLAYER) 
  2857. 			mFlighTutorial_breadcrumb_9(REMOTE_PLAYER) 
  2858. 			mFlighTutorial_breadcrumb_10(REMOTE_PLAYER) 
  2859. 	else 
  2860. 			mFlighTutorial_breadcrumb_1(LOCAL_PLAYER) 
  2861. 			mFlighTutorial_breadcrumb_2(LOCAL_PLAYER) 
  2862. 			mFlighTutorial_breadcrumb_3(LOCAL_PLAYER) 
  2863. 			mFlighTutorial_breadcrumb_4(LOCAL_PLAYER) 
  2864. 			mFlighTutorial_breadcrumb_5(LOCAL_PLAYER) 
  2865. 	end 
  2866.  
  2867.  
  2868. 	-- Since we've activated this trigger, save this as the teleport to location. 
  2869. 	marker_remove_trigger( mFlightTutorial_trigger.glide_trigger_01.name, sync_type ) 
  2870.  
  2871.  
  2872. 	mFlightTutorial_trigger_transition( player, "glide_respawn_nav_host", mFlightTutorial_trigger.dive_trigger_01.name ) 
  2873. 	------------------------- 
  2874. 	-- 
  2875. 	-- [[ First Dive Trigger ]] -- 
  2876. 	-- 
  2877. 	------------------------- 
  2878. 	mFlightTutorial_convo.flight_variant.sync = sync_type 
  2879. 	convo_end(mFlightTutorial_convo.flight_variant) 
  2880. 	--convo_end_all() 
  2881. 	mFlightTutorial_convo.dive_start.sync = sync_type 
  2882. 	convo_start(mFlightTutorial_convo.dive_start)	 
  2883.  
  2884. 	-- first dive (after learning to fly) 
  2885. 	mFlightTutorial_set_tutorial_text( "flight_tut_glide", player ) 
  2886.  
  2887. 	objective_text_clear( sync_index ) 
  2888. 	objective_text( sync_index, "SRG_FLIGHTTUT_OBJ_DIVE", nil, nil, sync_type, OI_ASSET_LOCATION ) 
  2889. 	 
  2890. 	-- this is used for the propper fail callback in the lava trigger 
  2891. 	trigger_setup( mFlightTutorial_trigger.dive_trigger_01 ) 
  2892.  
  2893.  
  2894. 	while not ( object_is_in_trigger( mFlightTutorial_trigger.dive_trigger_01.name, player ) and player_is_standing( player ) ) do 
  2895. 		thread_yield() 
  2896. 	end 
  2897.  
  2898. 	-- Since we've activated the dive trigger, save it as the teleport to location. 
  2899. 	marker_remove_trigger( mFlightTutorial_trigger.dive_trigger_01.name, sync_type ) 
  2900. 	mFlightTutorial_convo.dive_start.sync = sync_type 
  2901. 	convo_end(mFlightTutorial_convo.dive_start)		 
  2902. 	--convo_end_all() 
  2903. 	mFlightTutorial_convo.get_boost.sync = sync_type 
  2904. 	convo_start(mFlightTutorial_convo.get_boost)		 
  2905.  
  2906. 	------------------------- 
  2907. 	-- 
  2908. 	-- [[ Boost with Boost Node Trigger ]] -- 
  2909. 	-- 
  2910. 	------------------------- 
  2911.  
  2912. 	-- Go to the island 
  2913. 	mFlightTutorial_trigger_transition( player, "dive_respawn_nav_host", mFlightTutorial_trigger.flap_trigger_01.name ) 
  2914. 	-- Set up the next trigger and save this trigger as the most recently hit. 
  2915. 	trigger_setup( mFlightTutorial_trigger.flap_trigger_01 ) 
  2916. 	mFlightTutorial_set_tutorial_text( "flight_tut_dive_climb", player ) 
  2917. 	-- SET OBJECIVE 
  2918. 	objective_text_clear( sync_index ) 
  2919. 	objective_text( sync_index, "SRG_FLIGHTTUT_OBJ_GETFLAP", nil, nil, sync_type, OI_ASSET_LOCATION ) 
  2920. 	 
  2921.  
  2922. 	-- Set the FLAP orb! 
  2923. 	if 	player == REMOTE_PLAYER then 
  2924. 		trigger_setup( mFlightTutorial_trigger.give_flap_trigger_02) 
  2925. 		object_indicator_add( mFlightTutorial_group.use_flap_orbs.use_flap_orb_2, OI_ASSET_LOCATION, OI_FLAGS_DEFAULT, SYNC_REMOTE ) 
  2926. 		marker_add(mFlightTutorial_group.use_flap_orbs.use_flap_orb_2, MINIMAP_ICON_LOCATION,OI_ASSET_LOCATION, OI_FLAGS_DEFAULT, SYNC_REMOTE)  
  2927. 		mFlightTutorial_FlapVFX_2 = effect_play("Vfx Hb Xtraflap 01<002>", true, SYNC_REMOTE) 
  2928. 	else 
  2929. 	   mFlightTutorial_FlapVFX_1 = effect_play("Vfx Hb Xtraflap 01<001>", true, SYNC_LOCAL) 
  2930. 	   trigger_setup( mFlightTutorial_trigger.give_flap_trigger_01) 
  2931. 	   object_indicator_add( mFlightTutorial_group.use_flap_orbs.use_flap_orb_1, OI_ASSET_LOCATION, OI_FLAGS_DEFAULT, SYNC_LOCAL ) 
  2932. 		marker_add(mFlightTutorial_group.use_flap_orbs.use_flap_orb_1, MINIMAP_ICON_LOCATION,OI_ASSET_LOCATION, OI_FLAGS_DEFAULT, SYNC_LOCAL )  
  2933. 	-- marker_add_trigger( mFlightTutorial_group.use_flap_orbs.use_flap_orb_1, FLIGHTTUT_CUSTOM_TRIGGER_LOCATION.minimap_icon_name, FLIGHTTUT_CUSTOM_TRIGGER_LOCATION.ingame_effect_name, FLIGHTTUT_CUSTOM_TRIGGER_LOCATION.object_indicator_id, FLIGHTTUT_CUSTOM_TRIGGER_LOCATION.object_indicator_flags, sync_type ) 
  2934. 	   trigger_setup(mFlightTutorial_trigger.missed_flap_trigger_1) 
  2935. 	end 
  2936.  
  2937. 	-- Wait until they've hit the island trigger 
  2938. 	if player == REMOTE_PLAYER then 
  2939. 		while not ( object_is_in_trigger( mFlightTutorial_trigger.flap_trigger_01.name, player ) and player_is_standing( player ) and (Remote_CollectedOrb_B == true)) do 
  2940. 			thread_yield() 
  2941. 		end 
  2942. 	else 
  2943. 		while not ( object_is_in_trigger( mFlightTutorial_trigger.flap_trigger_01.name, player ) and player_is_standing( player ) and (Local_CollectedOrb_A == true)) do 
  2944. 			thread_yield() 
  2945. 		end 
  2946. 	end 
  2947. 	-- Since we've activated this trigger, save this as the teleport to location. 
  2948. 	marker_remove_trigger( mFlightTutorial_trigger.flap_trigger_01.name, sync_type ) 
  2949.  
  2950. 	------------------------- 
  2951. 	-- 
  2952. 	-- [[ Flap on your own Trigger ]] -- 
  2953. 	-- 
  2954. 	------------------------- 
  2955.  
  2956. 	-- Award the player their first flap 
  2957. 	if player == LOCAL_PLAYER then 
  2958. 		super_jump_set_flap_max( 1, SYNC_LOCAL, true ) 
  2959. 		iCurrentFlapsLocal = 1 
  2960. 	else 
  2961. 		super_jump_set_flap_max( 1, SYNC_REMOTE, true ) 
  2962. 		iCurrentFlapsRemote = 1 
  2963. 	end 
  2964. 	-- turning off double jump / wall jump for now 
  2965. 	--TODO: Change this so that it only affects the current player (whoever's thread this is) 
  2966. 	player_super_power_set_wall_jump_and_sprint_disabled(true, false, player) 
  2967. 	-- set up the hud prompt for the player to use flap 
  2968. 	--mFlightTutorial_thread.check_flap_thread = thread_new( "Local_check_flap_thread(player)") 
  2969.  
  2970. 	--if coop_is_active() then 
  2971. 	--	mFlightTutorial_Remote_check_flap_thread()Bread_Crumb_Trigger_11 
  2972. 	--end 
  2973. 	mFlightTutorial_convo.get_boost.sync = sync_type 
  2974. 	convo_end(mFlightTutorial_convo.get_boost)	 
  2975. 	--convo_end_all() 
  2976. 	mFlightTutorial_convo.give_flap.sync = sync_type 
  2977. 	convo_start(mFlightTutorial_convo.give_flap) 
  2978. 	mImpfest_leash_distance = 400 
  2979. 	mFlightTutorial_trigger_transition( player, "flap_respawn_nav_host", mFlightTutorial_trigger.climb_trigger_01.name ) 
  2980.  
  2981. 	-- Set up the next trigger and save this trigger as the most recently hit. 
  2982. 	mFlightTutorial_set_tutorial_text( "flight_tut_dive_climb_1", player ) 
  2983. 	-- SET OBJECIVE 
  2984. 	objective_text_clear( sync_index ) 
  2985. 	objective_text( sync_index, "SRG_FLIGHTTUT_OBJ_FIRSTFLIGHT", nil, nil, sync_type, OI_ASSET_LOCATION ) 
  2986. 	 
  2987. 	trigger_setup( mFlightTutorial_trigger.climb_trigger_01 ) 
  2988. 	while not( object_is_in_trigger( mFlightTutorial_trigger.climb_trigger_01.name, player ) and player_is_standing( player ) )do 
  2989. 		thread_yield() 
  2990. 	end		 
  2991. 	--	tweak_table_override_value("superjump_flap_energy_boost",800) 
  2992.  
  2993.  
  2994. 	-------------------------- 
  2995. 	-- 
  2996. 	-- [[ Climb trigger ]] -- 
  2997. 	-- 
  2998. 	-------------------------- 
  2999.  
  3000. 		if (player == REMOTE_PLAYER) then 
  3001. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_16) 
  3002. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_17) 
  3003. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_18) 
  3004. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_19) 
  3005. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_20) 
  3006. 			mFlightTutorial_BreadCrumb_16 = effect_play("Vfx Hb Boostnode<016>", true, SYNC_REMOTE) 
  3007. 			mFlightTutorial_BreadCrumb_17 = effect_play("Vfx Hb Boostnode<017>", true, SYNC_REMOTE) 
  3008. 			mFlightTutorial_BreadCrumb_18 = effect_play("Vfx Hb Boostnode<018>", true, SYNC_REMOTE) 
  3009. 			mFlightTutorial_BreadCrumb_19 = effect_play("Vfx Hb Boostnode<019>", true, SYNC_REMOTE) 
  3010. 			mFlightTutorial_BreadCrumb_20 = effect_play("Vfx Hb Boostnode<020>", true, SYNC_REMOTE) 
  3011. 		else 
  3012. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_11) 
  3013. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_12) 
  3014. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_13) 
  3015. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_14) 
  3016. 			trigger_setup( mFlightTutorial_trigger.Bread_Crumb_Trigger_15) 
  3017. 			mFlightTutorial_BreadCrumb_11 = effect_play("Vfx Hb Boostnode<011>", true, SYNC_LOCAL) 
  3018. 			mFlightTutorial_BreadCrumb_12 = effect_play("Vfx Hb Boostnode<012>", true, SYNC_LOCAL) 
  3019. 			mFlightTutorial_BreadCrumb_13 = effect_play("Vfx Hb Boostnode<013>", true, SYNC_LOCAL) 
  3020. 			mFlightTutorial_BreadCrumb_14 = effect_play("Vfx Hb Boostnode<014>", true, SYNC_LOCAL) 
  3021. 			mFlightTutorial_BreadCrumb_15 = effect_play("Vfx Hb Boostnode<015>", true, SYNC_LOCAL) 
  3022. 		end 
  3023.  
  3024.  
  3025.  
  3026. 	marker_remove_trigger( mFlightTutorial_trigger.climb_trigger_01.name, sync_type ) 
  3027. 	-- Since we've activated this trigger, save this as the teleport to location.	 
  3028. 	 
  3029. 	-- Let the player know their controls are set and how to steer left and right during flight. 
  3030. 	mFlightTutorial_set_tutorial_text( "flight_tut_flight_controls", player ) 
  3031. 	-- SET OBJECIVE 
  3032. 	objective_text_clear( sync_index ) 
  3033. 	objective_text( sync_index, "SRG_FLIGHTTUT_OBJ_CLIMB", nil, nil, sync_type, OI_ASSET_LOCATION ) 
  3034. 	 
  3035. 	mFlightTutorial_convo.give_flap.sync = sync_type 
  3036. 	convo_end(mFlightTutorial_convo.give_flap) 
  3037. 	--convo_end_all() 
  3038. 	mFlightTutorial_convo.flap.sync = sync_type 
  3039. 	convo_start(mFlightTutorial_convo.flap) 
  3040. --	mFlightTutorial_thread.check_flap_thread = thread_new( "Local_check_flap_thread") 
  3041. 	------------------------- 
  3042. 	-- 
  3043. 	-- [[ Stamina / Manuever Trigger ]] --mLastIslandTriggered_Local 
  3044. 	-- 
  3045. 	------------------------- 
  3046.  
  3047. 	mFlightTutorial_trigger_transition( player, "climb_respawn_nav_host", mFlightTutorial_trigger.turn_trigger_01.name )		 
  3048. 	-- Set up the next trigger and save this trigger as the most recently hit. 
  3049. 	trigger_setup( mFlightTutorial_trigger.turn_trigger_01 )	 
  3050. 	while not( object_is_in_trigger( mFlightTutorial_trigger.turn_trigger_01.name, player ) and player_is_standing( player ) ) do 
  3051. 		thread_yield() 
  3052. 	end 
  3053. 	iNumPlayersFinishedClimbFlight = iNumPlayersFinishedClimbFlight + 1 
  3054. 	if (player == REMOTE_PLAYER) then 
  3055. 			mFlighTutorial_breadcrumb_16(REMOTE_PLAYER) 
  3056. 			mFlighTutorial_breadcrumb_17(REMOTE_PLAYER) 
  3057. 			mFlighTutorial_breadcrumb_18(REMOTE_PLAYER) 
  3058. 			mFlighTutorial_breadcrumb_19(REMOTE_PLAYER) 
  3059. 			mFlighTutorial_breadcrumb_20(REMOTE_PLAYER) 
  3060. 	else 
  3061. 			mFlighTutorial_breadcrumb_11(LOCAL_PLAYER) 
  3062. 			mFlighTutorial_breadcrumb_12(LOCAL_PLAYER) 
  3063. 			mFlighTutorial_breadcrumb_13(LOCAL_PLAYER) 
  3064. 			mFlighTutorial_breadcrumb_14(LOCAL_PLAYER) 
  3065. 			mFlighTutorial_breadcrumb_15(LOCAL_PLAYER) 
  3066. 	end 
  3067. 	-- turning back on wall / double jump 
  3068. 	player_super_power_set_wall_jump_and_sprint_disabled(false, false, player) 
  3069. 	if player == LOCAL_PLAYER then 
  3070. 		flight_tutorial_stamina(false, LOCAL_PLAYER) 
  3071. 	else 
  3072. 		flight_tutorial_stamina(false, REMOTE_PLAYER) 
  3073. 	end 
  3074. 	mFlightTutorial_set_tutorial_text( "flight_tut_glide_steer", player ) 
  3075. 	-- SET OBJECIVE 
  3076. 	objective_text_clear( sync_index ) 
  3077. 	objective_text( sync_index, "SRG_FLIGHTTUT_OBJ_FINAL", nil, nil, sync_type, OI_ASSET_LOCATION ) 
  3078. 	 
  3079. 	marker_remove_trigger( mFlightTutorial_trigger.turn_trigger_01.name, sync_type ) 
  3080. 	if player == LOCAL_PLAYER then 
  3081. 		mLastIslandTriggered_Local = "climb_respawn_nav_host" 
  3082. 		mLocalTurnTriggerHit = true 
  3083. 	else 
  3084. 		mLastIslandTriggered_Remote = "climb_respawn_nav_client" 
  3085. 		mRemoteTurnTriggerHit = true 
  3086. 	end 
  3087.  
  3088. 	-- Since we've activated this trigger, save this as the teleport to location.	 
  3089. 	if player == LOCAL_PLAYER then 
  3090. 		mLastIslandTriggered_Local = "turn_respawn_nav_host" 
  3091. 		mLocalTurnTriggerHit = true 
  3092. 	else 
  3093. 		mLastIslandTriggered_Remote = "turn_respawn_nav_client" 
  3094. 		mRemoteTurnTriggerHit = true 
  3095. 	end 
  3096. 	delay( 1.0 ) 
  3097.  
  3098. 	mFlightTutorial_convo.flap.sync = sync_type 
  3099. 	convo_end(mFlightTutorial_convo.flap) 
  3100. 	--convo_end_all() 
  3101. 	mFlightTutorial_convo.turn.sync = sync_type 
  3102. 	convo_start(mFlightTutorial_convo.turn) 
  3103.  
  3104. 	 
  3105. 	mFlightTutorial_final_trigger_setup( mFlightTutorial_trigger.end_trigger, sync_type )	 
  3106.  
  3107. end 
  3108.