Back to home

Doomfist Parkour map generator [Beta]

7E6PK
click to copy
This code is over 6 months old.
Codes expire after 6 months and will no longer function.
This game is archived.
If you with to unarchive it, click the "restore" button in the options menu.
This code can also be found at workshop.codes/7E6PK

Category:
Custom game mode

Author:
nanofanes

Rating:
3

Version:
0.5.0

Posted:
8 months ago

Last updated:
8 months ago

Share this workshop!

Options

Only works on Dorado, Rialto and Hanamura right now.

settings
{
	main
	{
		Description: "Randomly generated doomfist parkour maps. Works on all maps! There are no limits. You could generate 500 checkpoints, would still work! Made by nanofanes#2272 Must be 5v6, or else mode breaks."
	}

	lobby
	{
		Map Rotation: After A Game
		Match Voice Chat: Enabled
		Max Spectators: 12
		Max Team 1 Players: 5
		Return To Lobby: Never
	}

	modes
	{
		Assault
		{
			enabled maps
			{
				Hanamura Winter
			}
		}

		Control
		{
			enabled maps
			{
			}
		}

		disabled Deathmatch
		{
			Game Length In Minutes: 15
			Score To Win: 50
		}

		Escort
		{
			enabled maps
			{
			}
		}

		Hybrid
		{
			enabled maps
			{
			}
		}

		Skirmish
		{
			enabled maps
			{
			}
		}

		General
		{
			Allow Hero Switching: Off
			Enemy Health Bars: Off
			Game Mode Start: Manual
			Hero Limit: Off
			Kill Cam: Off
			Kill Feed: Off
			Respawn Time Scalar: 0%
			Spawn Health Packs: Disabled
		}
	}

	heroes
	{
		General
		{
			Ultimate Ability: Off

			Ana
			{
				Jump Vertical Speed: 25%
				Movement Gravity: 25%
				Movement Speed: 50%
			}

			enabled heroes
			{
				Doomfist
			}
		}
	}
}

variables
{
	global:
		0: cpGenCNum
		1: CPArray
		2: numOfCP
		3: matchStatus
		4: tempAny
		6: validScore
		7: worldVectorParameters
		8: mainPathVectors
		9: numberOfValidCheck
		17: lvlGenCNum
		18: numOfLevels
		19: D
		20: tempAny2
		23: tempOrderPathPoints
		25: lastFirstOfDirVec
		26: waitingParkourArray
		27: current_ParkourArray
		28: mapsViableAbilityDisable
		29: extraDifficulty

	player:
		0: whatCP
		1: notInGame
		2: time
		3: tempBool
		5: whatLevel
		6: completedAllLvls
		8: numOfSkips
		9: tempBool2
		10: tempEffectContainer
		26: level1Stats
		27: level2Stats
		28: level3Stats
		29: level4Stats
		30: level5Stats
		31: level6Stats
		32: level7Stats
		33: level8Stats
		34: level9Stats
		35: level10Stats
}

subroutines
{
	0: checkpoint_Main_Compiler
	1: ability_Checker
	2: Spot_Checker
	3: filterPathArray
	4: bot_INIT
	6: checkpoint_Gen
	7: player_Update_Stats
	8: Death_Init
}

disabled rule("############################################### PRE GEN MECHANICS ###############################################")
{
	event
	{
		Ongoing - Global;
	}
}

rule("Current checkpoint radius pre Game")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		"Minimum distance from the checkpoint you are before you die."
		Or(Is Dead(Event Player), And(Is On Ground(Event Player), Compare(Distance Between(Event Player, Value In Array(Global Variable(
			current_ParkourArray), Player Variable(Event Player, whatCP))), >, 2.750))) == True;
		"Disables this rule if you've finished all levels."
		Player Variable(Event Player, notInGame) != True;
		"If you are within the acceptable radius of the next, green checkpoint, this rule won't start."
		Distance Between(Event Player, Value In Array(Global Variable(current_ParkourArray), Add(Player Variable(Event Player, whatCP),
			1))) > 2.750;
		" "
		Add(Player Variable(Event Player, whatCP), 1) < Count Of(Global Variable(current_ParkourArray));
		Player Variable(Event Player, completedAllLvls) != True;
		Global Variable(matchStatus) == 0;
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		Call Subroutine(Death_Init);
	}
}

rule("Next checkpoint radius pre Game")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		"Checks if you are within acceptable radius of the green, next checkpoint."
		And(Compare(Distance Between(Event Player, Value In Array(Global Variable(current_ParkourArray), Add(Player Variable(Event Player,
			whatCP), 1))), <, 2.750), Compare(Player Variable(Event Player, whatCP), <, Subtract(Count Of(Global Variable(
			current_ParkourArray)), 1))) == True;
		" "
		Is On Ground(Event Player) == True;
		Player Variable(Event Player, notInGame) != True;
		Player Variable(Event Player, completedAllLvls) != True;
		Global Variable(matchStatus) == 0;
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		Modify Player Variable(Event Player, whatCP, Add, 1);
		Call Subroutine(Death_Init);
	}
}

rule("Reached final checkpoint in pre Game")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, whatCP) >= Count Of(Global Variable(current_ParkourArray));
		Global Variable(matchStatus) == 0;
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		Stop Chasing Player Variable(Event Player, time);
		Set Player Variable(Event Player, time, 0);
		Set Player Variable(Event Player, whatLevel, 0);
	}
}

rule("Player setup pre gen")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Dummy Bot(Event Player) == False;
		Global Variable(matchStatus) == 0;
		Has Spawned(Event Player) == True;
	}

	actions
	{
		Set Player Variable(Event Player, tempEffectContainer, Empty Array);
		Wait(0.100, Ignore Condition);
		"Player Visuals"
		Create Effect(Event Player, Ring, Red, Value In Array(Global Variable(current_ParkourArray), Player Variable(Event Player,
			whatCP)), 2.500, Visible To Position and Radius);
		Wait(0.001, Ignore Condition);
		Modify Player Variable(Event Player, tempEffectContainer, Append To Array, Last Created Entity);
		Create Effect(Event Player, Ring, Lime Green, Value In Array(Global Variable(current_ParkourArray), Add(Player Variable(
			Event Player, whatCP), 1)), 2.500, Visible To Position and Radius);
		Wait(0.001, Ignore Condition);
		Modify Player Variable(Event Player, tempEffectContainer, Append To Array, Last Created Entity);
		Create Icon(Event Player, Value In Array(Global Variable(current_ParkourArray), Add(Player Variable(Event Player, whatCP), 1)),
			Checkmark, Visible To and Position, Lime Green, True);
		Wait(0.001, Ignore Condition);
		Modify Player Variable(Event Player, tempEffectContainer, Append To Array, Last Created Entity);
		"Player Init start config"
		Set Status(Event Player, Null, Phased Out, 9999);
		Skip If(Compare(Count Of(Global Variable(current_ParkourArray)), ==, 0), 2);
		Teleport(Event Player, First Of(Global Variable(current_ParkourArray)));
		Set Facing(Event Player, Direction From Angles(Horizontal Angle From Direction(Direction Towards(Event Player, Value In Array(
			Global Variable(current_ParkourArray), Add(Player Variable(Event Player, whatCP), 1)))), 0), To World);
		"Player HUD"
		Create HUD Text(Event Player, Null, Custom String("Checkpoint: {0} / {2}", Player Variable(Event Player, whatCP), Null, Count Of(
			Global Variable(current_ParkourArray))), Null, Left, 2, White, White, White, Visible To and String, Default Visibility);
		Create HUD Text(Event Player, Null, Custom String("Time: {0}", Player Variable(Event Player, time), Null, Null), Null, Left, 2,
			White, White, White, Visible To and String, Default Visibility);
		Wait(0.010, Ignore Condition);
		Set Player Variable(Event Player, tempBool, False);
		Set Player Variable(Event Player, tempBool2, True);
	}
}

disabled rule("##################################################### SETUP ######################################################")
{
	event
	{
		Ongoing - Global;
	}
}

rule("pathArrayArrayCorrectorSub")
{
	event
	{
		Subroutine;
		filterPathArray;
	}

	actions
	{
		Set Global Variable(tempOrderPathPoints, Global Variable(mainPathVectors));
		Wait(0.016, Ignore Condition);
		Set Global Variable(tempOrderPathPoints, Filtered Array(Global Variable(mainPathVectors), And(Compare(Distance Between(
			Current Array Element, Last Of(Global Variable(CPArray))), >=, 0), Compare(Distance Between(Current Array Element, Last Of(
			Global Variable(CPArray))), <=, 45))));
		Wait(0.016, Ignore Condition);
		Set Global Variable(tempOrderPathPoints, Sorted Array(Global Variable(tempOrderPathPoints), Distance Between(Current Array Element,
			Players In Slot(5, Team 1))));
		Wait(0.016, Ignore Condition);
		Teleport(Players In Slot(5, Team 1), First Of(Global Variable(tempOrderPathPoints)));
		" "
		Start Facing(Players In Slot(5, Team 1), Direction From Angles(Horizontal Angle From Direction(Direction Towards(Players In Slot(5,
			Team 1), Value In Array(Global Variable(tempOrderPathPoints), 1))), 0), 10000, To World, Direction and Turn Rate);
		Wait(0.050, Ignore Condition);
		" "
		Teleport(Players In Slot(5, Team 1), Nearest Walkable Position(World Vector Of(Vector(Random Real(Add(Value In Array(
			Global Variable(worldVectorParameters), 0), Multiply(Global Variable(extraDifficulty), 0.500)), Add(Value In Array(
			Global Variable(worldVectorParameters), 1), Global Variable(extraDifficulty))), Random Real(Value In Array(Global Variable(
			worldVectorParameters), 2), Value In Array(Global Variable(worldVectorParameters), 3)), Random Real(Add(Value In Array(
			Global Variable(worldVectorParameters), 4), Multiply(Global Variable(extraDifficulty), 0.500)), Add(Value In Array(
			Global Variable(worldVectorParameters), 5), Global Variable(extraDifficulty)))), Players In Slot(5, Team 1),
			Rotation And Translation)));
		Wait(0.050, Ignore Condition);
	}
}

rule("Game setup {SET NUMBER OF LEVELS AND CHECKPOINTS HERE} {Don't worry about the other rules}")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Wait(0.050, Ignore Condition);
		Set Global Variable(current_ParkourArray, Global Variable(waitingParkourArray));
		" "
		Set Global Variable(CPArray, Empty Array);
		"Number of checkpoints"
		Set Global Variable(numOfCP, 10);
		"Number of levels"
		Set Global Variable(numOfLevels, 5);
		"Turns off Logging, reduces server stress. If you need to see information about the mode in-game, turn this off."
		disabled Disable Inspector Recording;
		"Global HUD"
		Create HUD Text(All Players(All Teams), Custom String("Generating checkpoints... {0} / {1} loaded elements...", Global Variable(
			cpGenCNum), Global Variable(numOfCP), Null), Null, Null, Top, 0, Red, Red, Red, Visible To and String, Default Visibility);
		Create HUD Text(All Players(All Teams), Custom String("Level {0} / {1} Generated.", Global Variable(lvlGenCNum), Global Variable(
			numOfLevels), Null), Null, Null, Top, 0, Red, Red, Red, Visible To and String, Default Visibility);
		"Generator Init"
		Call Subroutine(checkpoint_Main_Compiler);
		Wait(0.250, Ignore Condition);
		Destroy Dummy Bot(Team 1, 5);
		Destroy All HUD Text;
		"HUD Init"
		Create HUD Text(All Players(All Teams), Custom String("Made by: Nanofanes#2272", Null, Null, Null), Null, Null, Top, 0, Sky Blue,
			Sky Blue, Sky Blue, Visible To and String, Default Visibility);
		Create HUD Text(All Players(All Teams), Null, Custom String("Skip checkpoint with interact (F) and jump", Null, Null, Null), Null,
			Left, 3, White, White, White, Visible To and String, Default Visibility);
		Create HUD Text(All Players(All Teams), Null, Custom String("go to last checkpoint with interact (F) and crouch", Null, Null,
			Null), Null, Left, 4, White, White, White, Visible To and String, Default Visibility);
		Create HUD Text(All Players(All Teams), Null, Custom String("See next CP with Q", Null, Null, Null), Null, Left, 5, White, White,
			White, Visible To and String, Default Visibility);
		"Last phase of game setup"
		Set Global Variable(matchStatus, 1);
		Pause Match Time;
		Set Status(All Players(All Teams), Null, Rooted, 0.400);
	}
}

rule("Player setup post gen")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Dummy Bot(Event Player) == False;
		Global Variable(matchStatus) == 1;
		Has Spawned(Event Player) == True;
	}

	actions
	{
		Destroy Effect(Value In Array(Player Variable(Event Player, tempEffectContainer), 0));
		Destroy Effect(Value In Array(Player Variable(Event Player, tempEffectContainer), 1));
		Destroy Effect(Value In Array(Player Variable(Event Player, tempEffectContainer), 2));
		Wait(0.001, Ignore Condition);
		Set Player Variable(Event Player, tempEffectContainer, Empty Array);
		"Player Visuals"
		Create Effect(Event Player, Ring, Red, Value In Array(Array Slice(Global Variable(current_ParkourArray), Player Variable(
			Event Player, whatLevel), Global Variable(numOfCP)), Player Variable(Event Player, whatCP)), 2.500,
			Visible To Position and Radius);
		Wait(0.001, Ignore Condition);
		Modify Player Variable(Event Player, tempEffectContainer, Append To Array, Last Created Entity);
		Create Effect(Event Player, Ring, Lime Green, Value In Array(Array Slice(Global Variable(current_ParkourArray), Player Variable(
			Event Player, whatLevel), Global Variable(numOfCP)), Add(Player Variable(Event Player, whatCP), 1)), 2.500,
			Visible To Position and Radius);
		Wait(0.001, Ignore Condition);
		Modify Player Variable(Event Player, tempEffectContainer, Append To Array, Last Created Entity);
		Create Icon(Event Player, Value In Array(Array Slice(Global Variable(current_ParkourArray), Player Variable(Event Player,
			whatLevel), Global Variable(numOfCP)), Add(Player Variable(Event Player, whatCP), 1)), Checkmark, Visible To and Position,
			Lime Green, True);
		Wait(0.001, Ignore Condition);
		Modify Player Variable(Event Player, tempEffectContainer, Append To Array, Last Created Entity);
		"Player HUD"
		Create HUD Text(Event Player, Null, Custom String("Level: {1} Checkpoint: {0} / {2}", Player Variable(Event Player, whatCP), Add(
			Divide(Player Variable(Event Player, whatLevel), Global Variable(numOfCP)), 1), Subtract(Global Variable(numOfCP), 1)), Null,
			Left, 2, White, White, White, Visible To and String, Default Visibility);
		Create HUD Text(Event Player, Null, Custom String("Time: {0}", Player Variable(Event Player, time), Null, Null), Null, Left, 2,
			White, White, White, Visible To and String, Default Visibility);
		"Player Init start config"
		Set Status(Event Player, Null, Phased Out, 9999);
		Set Player Variable(Event Player, whatLevel, 0);
		Set Player Variable(Event Player, whatCP, 0);
		Set Player Variable(Event Player, tempBool, False);
		Teleport(Event Player, First Of(Global Variable(current_ParkourArray)));
		Set Player Variable(Event Player, tempBool2, True);
	}
}

rule("Bot setup")
{
	event
	{
		Subroutine;
		bot_INIT;
	}

	actions
	{
		"This skips unecessarry actions that only needs to run once every match."
		Skip If(Compare(Global Variable(lvlGenCNum), >, 0), 1);
		Create Dummy Bot(Hero(Ana), Team 1, 5, Vector(999, 999, 999), Vector(0, 0, 0));
		Start Facing(Players In Slot(5, Team 1), Direction From Angles(Horizontal Angle From Direction(Direction Towards(Players In Slot(5,
			Team 1), Value In Array(Global Variable(tempOrderPathPoints), 1))), 0), 10000, To World, Direction and Turn Rate);
		Wait(0.333, Ignore Condition);
		Set Status(Players In Slot(5, Team 1), Null, Phased Out, 9999);
		Modify Global Variable(CPArray, Append To Array, Random Value In Array(Remove From Array(Global Variable(mainPathVectors),
			First Of(Array Slice(Global Variable(CPArray), Multiply(Global Variable(numOfCP), Global Variable(lvlGenCNum)),
			Global Variable(numOfCP))))));
		Wait(0.050, Ignore Condition);
	}
}

rule("Generator compiler")
{
	event
	{
		Subroutine;
		checkpoint_Main_Compiler;
	}

	actions
	{
		"Don't remove this. This fixes a very serious bug."
		Modify Global Variable(numOfCP, Add, 1);
		"Main Generator function.  1 level generated per loop."
		For Global Variable(lvlGenCNum, 0, Global Variable(numOfLevels), 1);
			Set Global Variable(numberOfValidCheck, -1);
			"Difficulty extender"
			Set Global Variable(extraDifficulty, Multiply(Divide(15, Global Variable(numOfLevels)), Global Variable(lvlGenCNum)));
			Call Subroutine(bot_INIT);
			Wait(0.050, Ignore Condition);
			Call Subroutine(checkpoint_Gen);
		End;
		Set Global Variable(current_ParkourArray, Global Variable(CPArray));
	}
}

rule("Generator function")
{
	event
	{
		Subroutine;
		checkpoint_Gen;
	}

	actions
	{
		"This loop is the main function to generate each individual Checkpoint."
		For Global Variable(cpGenCNum, 1, Global Variable(numOfCP), 1);
			Call Subroutine(filterPathArray);
			disabled If(Compare(Global Variable(cpGenCNum), >=, 4));
			disabled Set Global Variable(numberOfValidCheck, 4);
			disabled Else;
			disabled Set Global Variable(numberOfValidCheck, Subtract(Global Variable(cpGenCNum), 1));
			disabled End;
			"A call for the main function of validation."
			Call Subroutine(Spot_Checker);
			"This is the last part of the process. This if statement takes everything previous into account, and if it passes, a new checkpoint is generated."
			If(And(Compare(Global Variable(validScore), >=, 3), And(Compare(Distance Between(Players In Slot(5, Team 1), Last Of(
				Global Variable(CPArray))), >, Add(Value In Array(Global Variable(worldVectorParameters), 6), Global Variable(
				extraDifficulty))), Compare(Distance Between(Players In Slot(5, Team 1), Last Of(Global Variable(CPArray))), <, Add(
				Value In Array(Global Variable(worldVectorParameters), 7), Global Variable(extraDifficulty))))));
				Modify Global Variable(CPArray, Append To Array, Position Of(Players In Slot(5, Team 1)));
			Else;
				Modify Global Variable(cpGenCNum, Subtract, 1);
			End;
		End;
		Wait(0.016, Ignore Condition);
	}
}

rule("Spot checker")
{
	event
	{
		Subroutine;
		Spot_Checker;
	}

	actions
	{
		"All these actions add up to a check for how much space the newest checkpoint has in its area."
		Set Global Variable(validScore, 0);
		If(Is In Line of Sight(Add(Position Of(Players In Slot(5, Team 1)), Vector(0, 2.250, 0)), Add(Position Of(Players In Slot(5,
			Team 1)), Vector(3.500, 2.250, 0)), Barriers Do Not Block LOS));
			Modify Global Variable(validScore, Add, 1);
			disabled Else;
			disabled Abort;
		End;
		If(Is In Line of Sight(Add(Position Of(Players In Slot(5, Team 1)), Vector(0, 2.250, 0)), Add(Position Of(Players In Slot(5,
			Team 1)), Vector(-3.500, 2.250, 0)), Barriers Do Not Block LOS));
			Modify Global Variable(validScore, Add, 1);
			disabled Else;
			disabled Abort;
		End;
		If(Is In Line of Sight(Add(Position Of(Players In Slot(5, Team 1)), Vector(0, 2.250, 0)), Add(Position Of(Players In Slot(5,
			Team 1)), Vector(0, 2.250, 3.500)), Barriers Do Not Block LOS));
			Modify Global Variable(validScore, Add, 1);
			disabled Else;
			disabled Abort;
		End;
		If(Is In Line of Sight(Add(Position Of(Players In Slot(5, Team 1)), Vector(0, 2.250, 0)), Add(Position Of(Players In Slot(5,
			Team 1)), Vector(0, 2.250, -3.500)), Barriers Do Not Block LOS));
			Modify Global Variable(validScore, Add, 1);
			disabled Else;
			disabled Abort;
		End;
		disabled If(Is In Line of Sight(Add(Position Of(Players In Slot(5, Team 1)), Vector(0, 2.250, 0)), Add(Position Of(Players In Slot(5,
			Team 1)), Vector(0, 7, 0)), Barriers Do Not Block LOS));
		disabled Modify Global Variable(validScore, Add, 1);
		disabled Else;
		disabled Abort;
		disabled End;
		If(And(Is In Line of Sight(Players In Slot(5, Team 1), Last Of(Global Variable(CPArray)), Barriers Do Not Block LOS), Compare(
			Distance Between(Players In Slot(5, Team 1), Last Of(Global Variable(CPArray))), <=, Value In Array(Global Variable(
			worldVectorParameters), 6))));
			Modify Global Variable(validScore, Subtract, 10);
			Abort;
		End;
		disabled Skip If(Compare(Global Variable(numberOfValidCheck), <, 1), 7);
		disabled For Global Variable(tempAny2, 0, Global Variable(numberOfValidCheck), 1);
		disabled Wait(0.016, Ignore Condition);
		disabled If(Compare(Distance Between(Position Of(Players In Slot(5, Team 1)), Value In Array(Array Slice(Global Variable(CPArray), Multiply(
			Global Variable(numOfCP), Global Variable(lvlGenCNum)), Global Variable(numOfCP)), Subtract(Global Variable(cpGenCNum),
			Global Variable(tempAny2)))), <=, Divide(Value In Array(Global Variable(worldVectorParameters), 6), 3)));
		disabled Modify Global Variable(validScore, Subtract, 10);
		disabled Abort;
		disabled End;
		disabled End;
	}
}

disabled rule("##################################################### PLAYER ######################################################")
{
	event
	{
		Ongoing - Global;
	}
}

rule("Check what abilities are available")
{
	event
	{
		Subroutine;
		ability_Checker;
	}

	actions
	{
		Set Ability 1 Enabled(Event Player, True);
		Set Ability 2 Enabled(Event Player, True);
		"Uppercut"
		If(And(Compare(Distance Between(Value In Array(Array Slice(Global Variable(current_ParkourArray), Player Variable(Event Player,
			whatLevel), Global Variable(numOfCP)), Player Variable(Event Player, whatCP)), Value In Array(Array Slice(Global Variable(
			current_ParkourArray), Player Variable(Event Player, whatLevel), Global Variable(numOfCP)), Add(Player Variable(Event Player,
			whatCP), 1))), <=, Add(Value In Array(Global Variable(worldVectorParameters), 6), 10)), Is In Line of Sight(Value In Array(
			Array Slice(Global Variable(current_ParkourArray), Player Variable(Event Player, whatLevel), Global Variable(numOfCP)), Add(
			Player Variable(Event Player, whatCP), 1)), Add(Value In Array(Array Slice(Global Variable(current_ParkourArray),
			Player Variable(Event Player, whatLevel), Global Variable(numOfCP)), Add(Player Variable(Event Player, whatCP), 1)), Vector(0,
			10, 0)), Barriers Do Not Block LOS)));
			Set Ability 1 Enabled(Event Player, False);
		End;
		"Slam"
		If(And(Is In Line of Sight(Value In Array(Array Slice(Global Variable(current_ParkourArray), Player Variable(Event Player,
			whatLevel), Global Variable(numOfCP)), Player Variable(Event Player, whatCP)), Value In Array(Array Slice(Global Variable(
			current_ParkourArray), Player Variable(Event Player, whatLevel), Global Variable(numOfCP)), Add(Player Variable(Event Player,
			whatCP), 1)), Barriers Do Not Block LOS), Compare(Distance Between(Value In Array(Array Slice(Global Variable(
			current_ParkourArray), Player Variable(Event Player, whatLevel), Global Variable(numOfCP)), Player Variable(Event Player,
			whatCP)), Value In Array(Array Slice(Global Variable(current_ParkourArray), Player Variable(Event Player, whatLevel),
			Global Variable(numOfCP)), Add(Player Variable(Event Player, whatCP), 1))), <=, Add(Value In Array(Global Variable(
			worldVectorParameters), 6), 15))));
			Set Ability 2 Enabled(Event Player, False);
		End;
	}
}

rule("Death Init")
{
	event
	{
		Subroutine;
		Death_Init;
	}

	actions
	{
		Set Player Variable(Event Player, notInGame, True);
		Clear Status(Event Player, Phased Out);
		Wait(0.001, Ignore Condition);
		Kill(Event Player, Null);
		Wait(0.001, Ignore Condition);
		Respawn(Event Player);
		Wait(0.001, Ignore Condition);
		Set Status(Event Player, Null, Phased Out, 9999);
		Set Player Variable(Event Player, notInGame, False);
		If(Compare(Global Variable(matchStatus), ==, 1));
			Teleport(Event Player, Value In Array(Array Slice(Global Variable(current_ParkourArray), Player Variable(Event Player, whatLevel),
				Global Variable(numOfCP)), Player Variable(Event Player, whatCP)));
			Wait(0.001, Ignore Condition);
			Set Facing(Event Player, Direction From Angles(Horizontal Angle From Direction(Direction Towards(Event Player, Value In Array(
				Global Variable(current_ParkourArray), Add(Player Variable(Event Player, whatCP), 1)))), 0), To World);
			Wait(0.050, Ignore Condition);
			If(And(Array Contains(Global Variable(mapsViableAbilityDisable), Current Map), Compare(Player Variable(Event Player, whatLevel),
				>=, Global Variable(numOfCP))));
				Call Subroutine(ability_Checker);
			End;
		Else;
			Teleport(Event Player, Value In Array(Global Variable(current_ParkourArray), Player Variable(Event Player, whatCP)));
			Wait(0.001, Ignore Condition);
			Set Facing(Event Player, Direction From Angles(Horizontal Angle From Direction(Direction Towards(Event Player, Value In Array(
				Global Variable(current_ParkourArray), Add(Player Variable(Event Player, whatCP), 1)))), 0), To World);
		End;
	}
}

rule("Current checkpoint radius")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		"Minimum distance from the checkpoint you are before you die."
		Or(Is Dead(Event Player), And(Is On Ground(Event Player), Compare(Distance Between(Event Player, Value In Array(Array Slice(
			Global Variable(current_ParkourArray), Player Variable(Event Player, whatLevel), Global Variable(numOfCP)), Player Variable(
			Event Player, whatCP))), >, 2.750))) == True;
		"Disables this rule if you've finished all levels."
		Player Variable(Event Player, notInGame) != True;
		"If you are within the acceptable radius of the next, green checkpoint, this rule won't start."
		Distance Between(Event Player, Value In Array(Array Slice(Global Variable(current_ParkourArray), Player Variable(Event Player,
			whatLevel), Global Variable(numOfCP)), Add(Player Variable(Event Player, whatCP), 1))) > 2.750;
		" "
		Add(Player Variable(Event Player, whatCP), 1) < Global Variable(numOfCP);
		Player Variable(Event Player, completedAllLvls) != True;
		Global Variable(matchStatus) == 1;
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		Call Subroutine(Death_Init);
	}
}

rule("Next checkpoint radius")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		"Checks if you are within acceptable radius of the green, next checkpoint."
		And(Compare(Distance Between(Event Player, Value In Array(Array Slice(Global Variable(current_ParkourArray), Player Variable(
			Event Player, whatLevel), Global Variable(numOfCP)), Add(Player Variable(Event Player, whatCP), 1))), <, 2.750), Compare(
			Player Variable(Event Player, whatCP), <, Subtract(Global Variable(numOfCP), 1))) == True;
		" "
		Is On Ground(Event Player) == True;
		Player Variable(Event Player, notInGame) != True;
		Player Variable(Event Player, completedAllLvls) != True;
		Global Variable(matchStatus) == 1;
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		Modify Player Variable(Event Player, whatCP, Add, 1);
		Call Subroutine(Death_Init);
	}
}

rule("Reached final checkpoint in level")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Add(Player Variable(Event Player, whatCP), 1) == Global Variable(numOfCP);
		Player Variable(Event Player, completedAllLvls) != True;
		Global Variable(matchStatus) == 1;
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		Skip If(Compare(Player Variable(Event Player, numOfSkips), >=, Round To Integer(Divide(Global Variable(numOfCP), 6), Up)), 1);
		Call Subroutine(player_Update_Stats);
		Modify Player Variable(Event Player, whatLevel, Add, Global Variable(numOfCP));
		Stop Chasing Player Variable(Event Player, time);
		Set Player Variable(Event Player, whatCP, 0);
		Set Player Variable(Event Player, time, 0);
		Set Player Variable(Event Player, numOfSkips, 0);
		Big Message(Event Player, Custom String("Level {0} completed!", Divide(Player Variable(Event Player, whatLevel), Global Variable(
			numOfCP)), Null, Null));
		Wait(0.100, Ignore Condition);
		Abort If(Player Variable(Event Player, completedAllLvls));
		Teleport(Event Player, Value In Array(Array Slice(Global Variable(CPArray), Player Variable(Event Player, whatLevel),
			Global Variable(numOfCP)), Player Variable(Event Player, whatCP)));
	}
}

rule("Respawn")
{
	event
	{
		Player Died;
		All;
		All;
	}

	conditions
	{
		Is Dummy Bot(Event Player) == True;
	}

	actions
	{
		Set Status(Event Player, Null, Phased Out, 9999);
		Respawn(Event Player);
	}
}

rule("Chase time")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Or(And(Compare(Distance Between(First Of(Array Slice(Global Variable(current_ParkourArray), Divide(Player Variable(Event Player,
			whatLevel), Global Variable(numOfCP)), Global Variable(numOfCP))), Event Player), >=, 2.750), Compare(Global Variable(
			matchStatus), ==, 1)), And(Compare(Distance Between(Event Player, First Of(Global Variable(current_ParkourArray))), >=, 2.750),
			Compare(Global Variable(matchStatus), ==, 0))) == True;
		Player Variable(Event Player, notInGame) == False;
		Player Variable(Event Player, whatCP) == 0;
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		Chase Player Variable At Rate(Event Player, time, 9999, 1, Destination and Rate);
		Wait(0.010, Ignore Condition);
		Skip If(Or(And(Compare(Distance Between(Event Player, First Of(Array Slice(Global Variable(current_ParkourArray), Divide(
			Player Variable(Event Player, whatLevel), Global Variable(numOfCP)), Global Variable(numOfCP)))), >=, 2.750), Compare(
			Global Variable(matchStatus), ==, 1)), And(Compare(Distance Between(Event Player, First Of(Global Variable(
			current_ParkourArray))), >=, 2.750), Compare(Global Variable(matchStatus), ==, 0))), 2);
		Set Player Variable(Event Player, time, 0);
		Stop Chasing Player Variable(Event Player, time);
	}
}

rule("Restart")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Interact) == True;
		Is Button Held(Event Player, Ultimate) == True;
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		Wait(0.500, Abort When False);
		Teleport(Event Player, First Of(Global Variable(current_ParkourArray)));
		Set Player Variable(Event Player, tempBool, True);
		Set Player Variable(Event Player, completedAllLvls, False);
		Set Player Variable(Event Player, notInGame, False);
		Stop Chasing Player Variable(Event Player, time);
		Set Player Variable(Event Player, whatCP, 0);
		Set Player Variable(Event Player, time, 0);
		Set Player Variable(Event Player, whatLevel, 0);
		Wait(0.500, Ignore Condition);
		Set Player Variable(Event Player, tempBool, False);
	}
}

rule("Skip Checkpoint")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Jump) == True;
		Is Button Held(Event Player, Interact) == True;
		Is Button Held(Event Player, Ultimate) == False;
		Or(And(Compare(Add(Player Variable(Event Player, whatCP), 1), <, Global Variable(numOfCP)), Compare(Global Variable(matchStatus),
			==, 1)), And(Compare(Player Variable(Event Player, whatCP), <, Count Of(Global Variable(current_ParkourArray))), Compare(
			Global Variable(matchStatus), ==, 0))) == True;
		Player Variable(Event Player, tempBool) == False;
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		If(Compare(Global Variable(matchStatus), ==, 1));
			Modify Player Variable(Event Player, numOfSkips, Add, 1);
			Skip If(Compare(Player Variable(Event Player, whatCP), !=, 0), 1);
			Chase Player Variable At Rate(Event Player, time, 9999, 1, Destination and Rate);
			Modify Player Variable(Event Player, whatCP, Add, 1);
			Call Subroutine(Death_Init);
		Else;
			Skip If(Compare(Player Variable(Event Player, whatCP), !=, 0), 1);
			Chase Player Variable At Rate(Event Player, time, 9999, 1, Destination and Rate);
			Modify Player Variable(Event Player, whatCP, Add, 1);
			Call Subroutine(Death_Init);
		End;
	}
}

rule("Last checkpoint")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Crouch) == True;
		Is Button Held(Event Player, Interact) == True;
		Is Button Held(Event Player, Ultimate) == False;
		Player Variable(Event Player, tempBool) == False;
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		If(Compare(Global Variable(matchStatus), ==, 1));
			Skip If(And(Compare(Player Variable(Event Player, whatCP), <, 1), Compare(Player Variable(Event Player, whatLevel), ==, 0)), 9);
			If(Compare(Player Variable(Event Player, whatCP), <, 1));
				Set Player Variable(Event Player, whatCP, Subtract(Global Variable(numOfCP), 1));
				Set Player Variable(Event Player, whatLevel, Subtract(Player Variable(Event Player, whatLevel), Global Variable(numOfCP)));
			End;
			Modify Player Variable(Event Player, numOfSkips, Add, 1);
			Skip If(Compare(Player Variable(Event Player, whatCP), !=, 0), 1);
			Chase Player Variable At Rate(Event Player, time, 9999, 1, Destination and Rate);
			Modify Player Variable(Event Player, whatCP, Subtract, 1);
			Call Subroutine(Death_Init);
		Else;
			Skip If(Compare(Player Variable(Event Player, whatCP), <, 1), 5);
			Skip If(Compare(Player Variable(Event Player, whatCP), !=, 0), 1);
			Chase Player Variable At Rate(Event Player, time, 9999, 1, Destination and Rate);
			Modify Player Variable(Event Player, whatCP, Subtract, 1);
			Call Subroutine(Death_Init);
		End;
	}
}

rule("See where next CP is")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Ultimate) == True;
		Is Button Held(Event Player, Interact) == False;
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		Wait(0.100, Abort When False);
		If(Compare(Global Variable(matchStatus), ==, 1));
			If(Player Variable(Event Player, tempBool2));
				Set Player Variable(Event Player, tempBool2, False);
				Start Camera(Event Player, Add(Value In Array(Array Slice(Global Variable(current_ParkourArray), Player Variable(Event Player,
					whatLevel), Global Variable(numOfCP)), Add(Player Variable(Event Player, whatCP), 1)), Vector(0, 30, 0)), Value In Array(
					Array Slice(Global Variable(current_ParkourArray), Player Variable(Event Player, whatLevel), Global Variable(numOfCP)), Add(
					Player Variable(Event Player, whatCP), 1)), 0);
			Else;
				Stop Camera(Event Player);
				Set Player Variable(Event Player, tempBool2, True);
			End;
		Else;
			If(Player Variable(Event Player, tempBool2));
				Set Player Variable(Event Player, tempBool2, False);
				Start Camera(Event Player, Add(Value In Array(Global Variable(current_ParkourArray), Add(Player Variable(Event Player, whatCP),
					1)), Vector(0, 30, 0)), Value In Array(Global Variable(current_ParkourArray), Add(Player Variable(Event Player, whatCP), 1)),
					0);
			Else;
				Stop Camera(Event Player);
				Set Player Variable(Event Player, tempBool2, True);
			End;
	}
}

rule("Death Command")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Reload) == True;
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		Call Subroutine(Death_Init);
	}
}

rule("Player stats update")
{
	event
	{
		Subroutine;
		player_Update_Stats;
	}

	actions
	{
		If(And(Compare(Add(Divide(Player Variable(Event Player, whatLevel), Global Variable(numOfCP)), 1), ==, 1), Or(Or(Compare(Count Of(
			Player Variable(Event Player, level1Stats)), <, 2), Compare(Player Variable(Event Player, time), <, Value In Array(
			Player Variable(Event Player, level1Stats), 0))), Compare(Player Variable(Event Player, numOfSkips), <, Value In Array(
			Player Variable(Event Player, level1Stats), 1)))));
			Destroy HUD Text(Value In Array(Player Variable(Event Player, level1Stats), 2));
			Wait(0.020, Ignore Condition);
			Set Player Variable(Event Player, level1Stats, Empty Array);
			Modify Player Variable(Event Player, level1Stats, Append To Array, Player Variable(Event Player, time));
			Modify Player Variable(Event Player, level1Stats, Append To Array, Player Variable(Event Player, numOfSkips));
			Create HUD Text(All Players(All Teams), Null, Custom String("{0}: Level 1 Time: {1} Skips: {2}", Event Player, Value In Array(
				Player Variable(Event Player, level1Stats), 0), Value In Array(Player Variable(Event Player, level1Stats), 1)), Null, Right, 1,
				White, White, White, Visible To Sort Order and String, Default Visibility);
			Modify Player Variable(Event Player, level1Stats, Append To Array, Last Text ID);
		Else If(And(Compare(Add(1, Divide(Player Variable(Event Player, whatLevel), Global Variable(numOfCP))), ==, 2), Or(Or(Compare(
				Count Of(Player Variable(Event Player, level2Stats)), <, 2), Compare(Player Variable(Event Player, time), <, Value In Array(
				Player Variable(Event Player, level2Stats), 0))), Compare(Player Variable(Event Player, numOfSkips), <, Value In Array(
				Player Variable(Event Player, level2Stats), 1)))));
			Destroy HUD Text(Value In Array(Player Variable(Event Player, level2Stats), 2));
			Wait(0.020, Ignore Condition);
			Set Player Variable(Event Player, level2Stats, Empty Array);
			Modify Player Variable(Event Player, level2Stats, Append To Array, Player Variable(Event Player, time));
			Modify Player Variable(Event Player, level2Stats, Append To Array, Player Variable(Event Player, numOfSkips));
			Create HUD Text(All Players(All Teams), Null, Custom String("{0}: Level 2 Time: {1} Skips: {2}", Event Player, Value In Array(
				Player Variable(Event Player, level2Stats), 0), Value In Array(Player Variable(Event Player, level2Stats), 1)), Null, Right, 2,
				White, White, White, Visible To Sort Order and String, Default Visibility);
			Modify Player Variable(Event Player, level2Stats, Append To Array, Last Text ID);
		Else If(And(Compare(Add(1, Divide(Player Variable(Event Player, whatLevel), Global Variable(numOfCP))), ==, 3), Or(Or(Compare(
				Count Of(Player Variable(Event Player, level3Stats)), <, 2), Compare(Player Variable(Event Player, time), <, Value In Array(
				Player Variable(Event Player, level3Stats), 0))), Compare(Player Variable(Event Player, numOfSkips), <, Value In Array(
				Player Variable(Event Player, level3Stats), 1)))));
			Destroy HUD Text(Value In Array(Player Variable(Event Player, level3Stats), 2));
			Wait(0.020, Ignore Condition);
			Set Player Variable(Event Player, level3Stats, Empty Array);
			Modify Player Variable(Event Player, level3Stats, Append To Array, Player Variable(Event Player, time));
			Modify Player Variable(Event Player, level3Stats, Append To Array, Player Variable(Event Player, numOfSkips));
			Create HUD Text(All Players(All Teams), Null, Custom String("{0}: Level 3 Time: {1} Skips: {2}", Event Player, Value In Array(
				Player Variable(Event Player, level3Stats), 0), Value In Array(Player Variable(Event Player, level3Stats), 1)), Null, Right, 3,
				White, White, White, Visible To Sort Order and String, Default Visibility);
			Modify Player Variable(Event Player, level3Stats, Append To Array, Last Text ID);
		Else If(And(Compare(Add(1, Divide(Player Variable(Event Player, whatLevel), Global Variable(numOfCP))), ==, 4), Or(Or(Compare(
				Count Of(Player Variable(Event Player, level4Stats)), <, 2), Compare(Player Variable(Event Player, time), <, Value In Array(
				Player Variable(Event Player, level4Stats), 0))), Compare(Player Variable(Event Player, numOfSkips), <, Value In Array(
				Player Variable(Event Player, level4Stats), 1)))));
			Destroy HUD Text(Value In Array(Player Variable(Event Player, level4Stats), 2));
			Wait(0.020, Ignore Condition);
			Set Player Variable(Event Player, level4Stats, Empty Array);
			Modify Player Variable(Event Player, level4Stats, Append To Array, Player Variable(Event Player, time));
			Modify Player Variable(Event Player, level4Stats, Append To Array, Player Variable(Event Player, numOfSkips));
			Create HUD Text(All Players(All Teams), Null, Custom String("{0}: Level 4 Time: {1} Skips: {2}", Event Player, Value In Array(
				Player Variable(Event Player, level4Stats), 0), Value In Array(Player Variable(Event Player, level4Stats), 1)), Null, Right, 4,
				White, White, White, Visible To Sort Order and String, Default Visibility);
			Modify Player Variable(Event Player, level4Stats, Append To Array, Last Text ID);
		Else If(And(Compare(Add(1, Divide(Player Variable(Event Player, whatLevel), Global Variable(numOfCP))), ==, 5), Or(Or(Compare(
				Count Of(Player Variable(Event Player, level5Stats)), <, 2), Compare(Player Variable(Event Player, time), <, Value In Array(
				Player Variable(Event Player, level5Stats), 0))), Compare(Player Variable(Event Player, numOfSkips), <, Value In Array(
				Player Variable(Event Player, level5Stats), 1)))));
			Destroy HUD Text(Value In Array(Player Variable(Event Player, level5Stats), 2));
			Wait(0.020, Ignore Condition);
			Set Player Variable(Event Player, level5Stats, Empty Array);
			Modify Player Variable(Event Player, level5Stats, Append To Array, Player Variable(Event Player, time));
			Modify Player Variable(Event Player, level5Stats, Append To Array, Player Variable(Event Player, numOfSkips));
			Create HUD Text(All Players(All Teams), Null, Custom String("{0}: Level 5 Time: {1} Skips: {2}", Event Player, Value In Array(
				Player Variable(Event Player, level5Stats), 0), Value In Array(Player Variable(Event Player, level5Stats), 1)), Null, Right, 5,
				White, White, White, Visible To Sort Order and String, Default Visibility);
			Modify Player Variable(Event Player, level5Stats, Append To Array, Last Text ID);
		Else If(And(Compare(Add(1, Divide(Player Variable(Event Player, whatLevel), Global Variable(numOfCP))), ==, 6), Or(Or(Compare(
				Count Of(Player Variable(Event Player, level6Stats)), <, 2), Compare(Player Variable(Event Player, time), <, Value In Array(
				Player Variable(Event Player, level6Stats), 0))), Compare(Player Variable(Event Player, numOfSkips), <, Value In Array(
				Player Variable(Event Player, level6Stats), 1)))));
			Destroy HUD Text(Value In Array(Player Variable(Event Player, level6Stats), 2));
			Wait(0.020, Ignore Condition);
			Set Player Variable(Event Player, level6Stats, Empty Array);
			Modify Player Variable(Event Player, level6Stats, Append To Array, Player Variable(Event Player, time));
			Modify Player Variable(Event Player, level6Stats, Append To Array, Player Variable(Event Player, numOfSkips));
			Create HUD Text(All Players(All Teams), Null, Custom String("{0}: Level 6 Time: {1} Skips: {2}", Event Player, Value In Array(
				Player Variable(Event Player, level6Stats), 0), Value In Array(Player Variable(Event Player, level6Stats), 1)), Null, Right, 6,
				White, White, White, Visible To Sort Order and String, Default Visibility);
			Modify Player Variable(Event Player, level6Stats, Append To Array, Last Text ID);
		Else If(And(Compare(Add(1, Divide(Player Variable(Event Player, whatLevel), Global Variable(numOfCP))), ==, 7), Or(Or(Compare(
				Count Of(Player Variable(Event Player, level7Stats)), <, 2), Compare(Player Variable(Event Player, time), <, Value In Array(
				Player Variable(Event Player, level7Stats), 0))), Compare(Player Variable(Event Player, numOfSkips), <, Value In Array(
				Player Variable(Event Player, level7Stats), 1)))));
			Destroy HUD Text(Value In Array(Player Variable(Event Player, level7Stats), 2));
			Wait(0.020, Ignore Condition);
			Set Player Variable(Event Player, level7Stats, Empty Array);
			Modify Player Variable(Event Player, level7Stats, Append To Array, Player Variable(Event Player, time));
			Modify Player Variable(Event Player, level7Stats, Append To Array, Player Variable(Event Player, numOfSkips));
			Create HUD Text(All Players(All Teams), Null, Custom String("{0}: Level 7 Time: {1} Skips: {2}", Event Player, Value In Array(
				Player Variable(Event Player, level7Stats), 0), Value In Array(Player Variable(Event Player, level7Stats), 1)), Null, Right, 7,
				White, White, White, Visible To Sort Order and String, Default Visibility);
			Modify Player Variable(Event Player, level7Stats, Append To Array, Last Text ID);
		Else If(And(Compare(Add(1, Divide(Player Variable(Event Player, whatLevel), Global Variable(numOfCP))), ==, 8), Or(Or(Compare(
				Count Of(Player Variable(Event Player, level8Stats)), <, 2), Compare(Player Variable(Event Player, time), <, Value In Array(
				Player Variable(Event Player, level8Stats), 0))), Compare(Player Variable(Event Player, numOfSkips), <, Value In Array(
				Player Variable(Event Player, level8Stats), 1)))));
			Destroy HUD Text(Value In Array(Player Variable(Event Player, level8Stats), 2));
			Wait(0.020, Ignore Condition);
			Set Player Variable(Event Player, level8Stats, Empty Array);
			Modify Player Variable(Event Player, level8Stats, Append To Array, Player Variable(Event Player, time));
			Modify Player Variable(Event Player, level8Stats, Append To Array, Player Variable(Event Player, numOfSkips));
			Create HUD Text(All Players(All Teams), Null, Custom String("{0}: Level 8 Time: {1} Skips: {2}", Event Player, Value In Array(
				Player Variable(Event Player, level8Stats), 0), Value In Array(Player Variable(Event Player, level8Stats), 1)), Null, Right, 8,
				White, White, White, Visible To Sort Order and String, Default Visibility);
			Modify Player Variable(Event Player, level8Stats, Append To Array, Last Text ID);
		Else If(And(Compare(Add(1, Divide(Player Variable(Event Player, whatLevel), Global Variable(numOfCP))), ==, 9), Or(Or(Compare(
				Count Of(Player Variable(Event Player, level9Stats)), <, 2), Compare(Player Variable(Event Player, time), <, Value In Array(
				Player Variable(Event Player, level9Stats), 0))), Compare(Player Variable(Event Player, numOfSkips), <, Value In Array(
				Player Variable(Event Player, level9Stats), 1)))));
			Destroy HUD Text(Value In Array(Player Variable(Event Player, level9Stats), 2));
			Wait(0.020, Ignore Condition);
			Set Player Variable(Event Player, level9Stats, Empty Array);
			Modify Player Variable(Event Player, level9Stats, Append To Array, Player Variable(Event Player, time));
			Modify Player Variable(Event Player, level9Stats, Append To Array, Player Variable(Event Player, numOfSkips));
			Create HUD Text(All Players(All Teams), Null, Custom String("{0}: Level 9 Time: {1} Skips: {2}", Event Player, Value In Array(
				Player Variable(Event Player, level9Stats), 0), Value In Array(Player Variable(Event Player, level9Stats), 1)), Null, Right, 9,
				White, White, White, Visible To Sort Order and String, Default Visibility);
			Modify Player Variable(Event Player, level9Stats, Append To Array, Last Text ID);
		Else If(And(Compare(Add(1, Divide(Player Variable(Event Player, whatLevel), Global Variable(numOfCP))), ==, 10), Or(Or(Compare(
				Count Of(Player Variable(Event Player, level10Stats)), <, 2), Compare(Player Variable(Event Player, time), <, Value In Array(
				Player Variable(Event Player, level10Stats), 0))), Compare(Player Variable(Event Player, numOfSkips), <, Value In Array(
				Player Variable(Event Player, level10Stats), 1)))));
			Destroy HUD Text(Value In Array(Player Variable(Event Player, level10Stats), 2));
			Wait(0.020, Ignore Condition);
			Set Player Variable(Event Player, level10Stats, Empty Array);
			Modify Player Variable(Event Player, level10Stats, Append To Array, Player Variable(Event Player, time));
			Modify Player Variable(Event Player, level10Stats, Append To Array, Player Variable(Event Player, numOfSkips));
			Create HUD Text(All Players(All Teams), Null, Custom String("{0}: Level 10 Time: {1} Skips: {2}", Event Player, Value In Array(
				Player Variable(Event Player, level10Stats), 0), Value In Array(Player Variable(Event Player, level10Stats), 1)), Null, Right,
				10, White, White, White, Visible To Sort Order and String, Default Visibility);
			Modify Player Variable(Event Player, level10Stats, Append To Array, Last Text ID);
		End;
	}
}

rule("Last lvl completed")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Add(Divide(Player Variable(Event Player, whatLevel), Global Variable(numOfCP)), 1) >= Global Variable(numOfLevels);
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		Set Player Variable(Event Player, completedAllLvls, True);
	}
}

rule("Player left")
{
	event
	{
		Player Left Match;
		All;
		All;
	}

	conditions
	{
		Count Of(Global Variable(current_ParkourArray)) > 5;
	}

	actions
	{
		Destroy HUD Text(Value In Array(Player Variable(Event Player, level1Stats), 2));
		Destroy HUD Text(Value In Array(Player Variable(Event Player, level2Stats), 2));
		Destroy HUD Text(Value In Array(Player Variable(Event Player, level3Stats), 2));
		Destroy HUD Text(Value In Array(Player Variable(Event Player, level4Stats), 2));
		Destroy HUD Text(Value In Array(Player Variable(Event Player, level5Stats), 2));
		Destroy HUD Text(Value In Array(Player Variable(Event Player, level6Stats), 2));
		Destroy HUD Text(Value In Array(Player Variable(Event Player, level7Stats), 2));
		Destroy HUD Text(Value In Array(Player Variable(Event Player, level8Stats), 2));
		Destroy HUD Text(Value In Array(Player Variable(Event Player, level9Stats), 2));
		Destroy HUD Text(Value In Array(Player Variable(Event Player, level10Stats), 2));
		Destroy Effect(Value In Array(Player Variable(Event Player, tempEffectContainer), 0));
		Destroy Effect(Value In Array(Player Variable(Event Player, tempEffectContainer), 1));
		Destroy Effect(Value In Array(Player Variable(Event Player, tempEffectContainer), 2));
	}
}

disabled rule("##################################################### DEBUG ######################################################")
{
	event
	{
		Ongoing - Global;
	}
}

disabled rule("HUD (DEBUG)")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		disabled Create HUD Text(All Players(All Teams), Custom String("{0} {1} {2}", Is In Spawn Room(Players In Slot(5, Team 1)),
			Distance Between(Host Player, Value In Array(Global Variable(CPArray), Add(Player Variable(Host Player, whatCP), 1))),
			Is In Spawn Room(Host Player)), Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility);
		disabled Create HUD Text(Host Player, Count Of(Array Slice(Global Variable(CPArray), Multiply(Global Variable(numOfCP), Global Variable(
			lvlGenCNum)), Global Variable(numOfCP))), Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility);
		disabled Create HUD Text(Host Player, Count Of(Array Slice(Global Variable(CPArray), 2, 6)), Null, Null, Left, 0, White, White, White,
			Visible To and String, Default Visibility);
		disabled Create HUD Text(Host Player, Value In Array(Array Slice(Global Variable(CPArray), Multiply(Global Variable(numOfCP),
			Global Variable(lvlGenCNum)), Global Variable(numOfCP)), Global Variable(cpGenCNum)), Null, Null, Left, 0, White, White, White,
			Visible To and String, Default Visibility);
		disabled Create Icon(Host Player, Add(Position Of(Host Player), Vector(0, 12, 0)), Arrow: Up, Visible To and Position, Red, True);
		Create HUD Text(All Players(All Teams), Custom String("Distance: {0} Pos 1: {1} Pos 2: {2}", Distance Between(First Of(
			Player Variable(Host Player, tempBool2)), Last Of(Player Variable(Host Player, tempBool2))), First Of(Player Variable(
			Host Player, tempBool2)), Last Of(Player Variable(Host Player, whatCP))), Null, Null, Left, 0, White, White, White,
			Visible To and String, Default Visibility);
		Create HUD Text(Host Player, Custom String("Index 1: {0} Index 2: {1}", Add(Multiply(Global Variable(numberOfValidCheck), 4),
			Global Variable(D)), Add(Multiply(Global Variable(numberOfValidCheck), 4), Add(Global Variable(D), 1)), Null), Null, Null,
			Left, 0, White, White, White, Visible To and String, Default Visibility);
		Create HUD Text(All Players(All Teams), Custom String("Min X: {0} Max X: {1}", Value In Array(Global Variable(
			worldVectorParameters), Add(Multiply(Global Variable(numberOfValidCheck), 4), Global Variable(D))), Value In Array(
			Global Variable(worldVectorParameters), Add(Multiply(Global Variable(numberOfValidCheck), 4), Add(Global Variable(D), 1))),
			Null), Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility);
		Create HUD Text(All Players(All Teams), Custom String("Selected Path Location Coord: {0}", Value In Array(Global Variable(
			mainPathVectors), Global Variable(tempAny)), Null, Null), Null, Null, Right, 5, White, White, White, Visible To and String,
			Default Visibility);
		Create HUD Text(Host Player, Custom String("Distance between recent Ray and path point: {0}", Distance Between(Last Of(
			Player Variable(Host Player, tempBool2)), Value In Array(Global Variable(mainPathVectors), Global Variable(tempAny))), Null,
			Null), Null, Null, Right, 6, White, White, White, Visible To and String, Default Visibility);
		Create HUD Text(Host Player, Custom String("Distance between u and Path: {0}", Distance Between(Host Player, Value In Array(
			Global Variable(mainPathVectors), Global Variable(tempAny))), Null, Null), Null, Null, Right, 7, White, White, White,
			Visible To and String, Default Visibility);
	}
}

disabled rule("Distance measurement tool")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Primary Fire) == True;
		Event Player == Host Player;
	}

	actions
	{
		Set Player Variable(Event Player, Z, Ray Cast Hit Position(Event Player, Multiply(Facing Direction Of(Event Player), 1000), Null,
			Null, False));
		If(Compare(Count Of(Player Variable(Event Player, tempBool2)), ==, 2));
			Set Player Variable(Event Player, tempBool2, Empty Array);
		End;
		Modify Player Variable(Event Player, tempBool2, Append To Array, Ray Cast Hit Position(Event Player, Multiply(Facing Direction Of(
			Event Player), 1000), All Players(All Teams), Event Player, False));
	}
}

disabled rule("See where main path is { DEBUG }")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Event Player == Host Player;
		Is Button Held(Event Player, Jump) == True;
		Is Button Held(Event Player, Interact) == True;
	}

	actions
	{
		Skip If(Global Variable(tempAny2), 1);
		Set Global Variable(tempAny, 0);
		Create HUD Text(All Players(All Teams), Custom String("You're at: Main path point {0}", Global Variable(tempAny), Null, Null),
			Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility);
		Set Global Variable(lastFirstOfDirVec, Last Text ID);
		Teleport(Event Player, Value In Array(Global Variable(mainPathVectors), Global Variable(tempAny)));
		Set Global Variable(tempAny2, True);
		Wait(2, Ignore Condition);
		Skip If(Or(Not(Is Button Held(Event Player, Jump)), Not(Is Button Held(Event Player, Interact))), 1);
		Modify Global Variable(tempAny, Add, 1);
		Loop If Condition Is True;
		Wait(3, Ignore Condition);
		Destroy HUD Text(Global Variable(lastFirstOfDirVec));
		Set Global Variable(tempAny2, False);
	}
}

disabled rule("Multi player DEBUG")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	actions
	{
		Create HUD Text(Event Player, Custom String("Your current position: {0}", Position Of(Event Player), Null, Null), Null, Null,
			Right, 0, White, White, White, Visible To and String, Default Visibility);
		Create HUD Text(Event Player, Custom String("Last location shot at: {0}", Player Variable(Event Player, Z), Null, Null), Null,
			Null, Right, 0, White, White, White, Visible To and String, Default Visibility);
	}
}

rule("################################################### Map properties ###################################################")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Set Global Variable(mapsViableAbilityDisable, Empty Array);
		Modify Global Variable(mapsViableAbilityDisable, Append To Array, Map(Hanamura));
		Modify Global Variable(mapsViableAbilityDisable, Append To Array, Map(Hanamura Winter));
		Modify Global Variable(mapsViableAbilityDisable, Append To Array, Map(Dorado));
	}
}

rule("##################################################### Hanamura ####################################################")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Or(Compare(Current Map, ==, Map(Hanamura)), Compare(Current Map, ==, Map(Hanamura Winter))) == True;
	}

	actions
	{
		"Waiting parkour vectors"
		Set Global Variable(waitingParkourArray, Empty Array);
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(12, 11.220, 21));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(13, 6.740, -21));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(13, 7.070, -48.900));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(-8.634, 2.540, -76.838));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(-16.522, 9.190, -90.417));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(-19.983, 4, -57.060));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(-0.805, 5, -46.759));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(13, 6.740, -21));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(42.067, 1.600, -57.585));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(13.459, 1, -4.429));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(12, 11.220, 21));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(-23.295, -1, -47.004));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(-16.522, 9.190, -90.417));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(34.062, 3, -20.260));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(-3.023, 2.540, -82.493));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(13, 6.740, -21));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(48.951, 14.570, 17.945));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(-14.874, 3, -45.386));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(7.271, 0.500, 38.567));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(31.446, 3, -79.218));
		Modify Global Variable(waitingParkourArray, Append To Array, Vector(12, 11.220, 21));
		"World vector parameters"
		Set Global Variable(worldVectorParameters, Empty Array);
		"Min and max X"
		Modify Global Variable(worldVectorParameters, Append To Array, -25);
		Modify Global Variable(worldVectorParameters, Append To Array, 25);
		"Min and max Y"
		Modify Global Variable(worldVectorParameters, Append To Array, -5);
		Modify Global Variable(worldVectorParameters, Append To Array, 15);
		"Min and max Z"
		Modify Global Variable(worldVectorParameters, Append To Array, 15);
		Modify Global Variable(worldVectorParameters, Append To Array, 50);
		"Min and max distance requirement"
		Modify Global Variable(worldVectorParameters, Append To Array, 25);
		Modify Global Variable(worldVectorParameters, Append To Array, 50);
		" "
		Set Global Variable(mainPathVectors, Empty Array);
		Modify Global Variable(mainPathVectors, Append To Array, Vector(-12.584, 0.573, -85.448));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(13.068, 8.652, -48.886));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(-17.393, 0.280, -25.823));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(10.313, 12.727, 20.506));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(47.532, 7.499, 10.758));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(28.762, 11.937, 3.810));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(18.902, 2.470, -58.884));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(-4.366, 8.501, -21.639));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(-28.252, 2.501, -58.210));
		Create HUD Text(All Players(All Teams), Custom String("Waiting parkour map by: DiaZ", Null, Null, Null), Null, Null, Top, 3,
			Lime Green, Lime Green, Lime Green, Visible To and String, Default Visibility);
	}
}

disabled rule("")
{
	event
	{
		Ongoing - Global;
	}
}

rule("###################################################### Dorado ######################################################")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Current Map == Map(Dorado);
	}

	actions
	{
		"World vector parameters"
		Set Global Variable(worldVectorParameters, Empty Array);
		"Min and max X"
		Modify Global Variable(worldVectorParameters, Append To Array, -20);
		Modify Global Variable(worldVectorParameters, Append To Array, 20);
		"Min and max Y"
		Modify Global Variable(worldVectorParameters, Append To Array, -10);
		Modify Global Variable(worldVectorParameters, Append To Array, 15);
		"Min and max Z"
		Modify Global Variable(worldVectorParameters, Append To Array, 15);
		Modify Global Variable(worldVectorParameters, Append To Array, 55);
		"Min and max distance requirement"
		Modify Global Variable(worldVectorParameters, Append To Array, 20);
		Modify Global Variable(worldVectorParameters, Append To Array, 55);
		Set Global Variable(mainPathVectors, Empty Array);
		Modify Global Variable(mainPathVectors, Append To Array, Vector(25.608, 5.418, -17.116));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(49.655, 3.501, 20.811));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(64.806, 8.499, -27.847));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(71.668, 18.501, 38.563));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(101.399, 11.501, -5.914));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(128.454, 19.249, 11.631));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(115.903, 12.802, 51.937));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(151.094, 12.499, 31.552));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(65.116, 17.950, 4.521));
		Modify Global Variable(mainPathVectors, Append To Array, Vector(26.066, 6.600, -40.653));
	}
}

Changelog

8 months ago 0.5.0

This revision contains no notes

YW26A
click to copy
8 months ago 0.5.0

This revision contains no notes

TV9R8
click to copy
8 months ago 0.5.0

This revision contains no notes

BN9JC
click to copy