Create
Return to post

Comparing difference between and

View raw
  • settings
  • {
  • main
  • {
  • Description: "Ultimate Frisbee in Overwatch! Throw passes to teammates, and catch them in your end zone to score! Intercept enemy passes! Keep the disc in bounds or it will reset to midfield. (By nobody#1774. Beta. More to come!)"
  • }
  • lobby
  • {
  • Allow Players Who Are In Queue: Yes
  • Map Rotation: After A Game
  • Match Voice Chat: Enabled
  • Max Spectators: 12
  • Max Team 1 Players: 3
  • Max Team 2 Players: 3
  • Return To Lobby: Never
  • Team Balancing: After A Game
  • }
  • modes
  • {
  • Team Deathmatch
  • {
  • enabled maps
  • {
  • Workshop Expanse
  • Workshop Expanse Night
  • Workshop Island
  • Workshop Island Night
  • }
  • }
  • General
  • {
  • Enemy Health Bars: Off
  • Game Length In Minutes: 15
  • Game Mode Start: Manual
  • Hero Limit: Off
  • Kill Feed: Off
  • }
  • }
  • heroes
  • {
  • General
  • {
  • Primary Fire: Off
  • Ultimate Generation: 10%
  • Ultimate Generation - Combat: 0%
  • Ultimate Generation - Passive: 0%
  • Ana
  • {
  • Biotic Grenade: Off
  • Sleep Dart Cooldown Time: 400%
  • }
  • Bastion
  • {
  • Configuration: Tank Weapon Knockback Scalar: 50%
  • Infinite Ultimate Duration: On
  • Movement Speed: 200%
  • Projectile Speed: 50%
  • Spawn With Ultimate Ready: On
  • }
  • Brigitte
  • {
  • Shield Bash Cooldown Time: 500%
  • Whip Shot Cooldown Time: 500%
  • }
  • Echo
  • {
  • Focusing Beam: Off
  • Sticky Bombs: Off
  • }
  • Genji
  • {
  • Primary Fire: Off
  • Secondary Fire: Off
  • }
  • Hanzo
  • {
  • Primary Fire: Off
  • Storm Arrows: Off
  • }
  • Junkrat
  • {
  • Concussion Mine Cooldown Time: 500%
  • Steel Trap Cooldown Time: 500%
  • }
  • Lúcio
  • {
  • Soundwave Cooldown Time: 500%
  • }
  • McCree
  • {
  • Combat Roll Cooldown Time: 50%
  • Flashbang Cooldown Time: 300%
  • Secondary Fire: Off
  • }
  • Mei
  • {
  • Primary Fire: Off
  • Secondary Fire: Off
  • }
  • Pharah
  • {
  • Concussive Blast Cooldown Time: 500%
  • }
  • Reinhardt
  • {
  • Charge: Off
  • Primary Fire: Off
  • }
  • Roadhog
  • {
  • Chain Hook Cooldown Time: 500%
  • }
  • Sombra
  • {
  • Hack Cooldown Time: 500%
  • }
  • Symmetra
  • {
  • Primary Fire: Off
  • Secondary Fire: Off
  • Sentry Turret: Off
  • }
  • Torbjörn
  • {
  • Deploy Turret: Off
  • Weapons Enabled: Forge Hammer Only
  • }
  • Zarya
  • {
  • Ammunition Clip Size Scalar: 25%
  • Movement Speed: 120%
  • }
  • Zenyatta
  • {
  • Jump Vertical Speed: 125%
  • Movement Gravity: 50%
  • Movement Speed: 125%
  • Orb of Discord: Off
  • Orb of Harmony: Off
  • }
  • disabled heroes
  • {
  • Bastion
  • Doomfist
  • }
  • }
  • }
  • }
  • variables
  • {
  • global:
  • 0: PLAYERS_All
  • 3: VECTORS_Field_Boundaries
  • 4: VECTORS_Player_Spawns_Team1
  • 5: VECTOR_Disc_Spawn
  • 6: PLAYER_Holding_Disc
  • 7: PLAYER_Threw_Disc
  • 8: BOOL_Disc_Thrown
  • 9: PLAYERS_Disc_Visible
  • 10: BOOL_Initialized
  • 11: ENTITY_Disc1
  • 13: EFFECT_Disc_Outer_Sphere
  • 14: VECTOR_Disc_Curve_Impulse
  • 15: VECTOR_Disc_Thrown_From
  • 16: INT_Disc_Curve_Speed
  • 17: TEAM_Possession
  • 18: TEAM_Not_Possession
  • 20: INT_Disc_Outer_Orb_Width
  • 21: INT_Loop_Control
  • 22: PLAYERS_Temp
  • 23: VECTORS_Player_Spawns_Team2
  • 24: REAL_Disc_Pickup_Radius
  • 25: EFFECT_Holding_Disc
  • 26: STRING_HUD_Possession_Enforced
  • 27: REAL_Disc_Holder_Ring_Radius
  • 28: REAL_Disc_Catch_Radius
  • 29: REAL_Disc_Lift_Max_Accel
  • 30: VECTOR_Disc_Initial_Throw
  • 31: BOOL_Out_Of_Bounds
  • 32: BOOL_Scored
  • 33: BOOL_Possession_Changing
  • 34: BOOL_80s
  • player:
  • 0: BOOL_Throwing_Disc
  • 1: INT_Curve_Angle
  • 2: INT_Last_Facing_Angle
  • 3: INT_Turn_Rate
  • 4: STRINGS_HUD_Disc_Status
  • }
  • subroutines
  • {
  • 0: EFFECTS_Field_Create
  • 1: POSSESSION_Swap
  • 2: DISC_Reset
  • 3: PLAYERS_Reset
  • 5: HUD_Init
  • 6: DISC_Create
  • 8: PLAYER_Takes_Disc
  • 9: PLAYER_Check_Out_Of_Bounds
  • 10: PLAYER_Check_for_Scoring
  • }
  • rule("MAP: Workshop Expanse")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Current Map == Map(Workshop Expanse) || Current Map == Map(Workshop Expanse Night)) == True;
  • }
  • actions
  • {
  • Global.VECTOR_Disc_Spawn = Vector(-0.015, 1.248, 0.071);
  • Global.VECTORS_Field_Boundaries = Array(Array(Vector(-25, 0, 50), Vector(25, 0, 50)), Array(Vector(-25, 0, 30), Vector(25, 0, 30)),
  • Array(Vector(-25, 0, -30), Vector(25, 0, -30)), Array(Vector(-25, 0, -50), Vector(25, 0, -50)), Array(Vector(-25, 0, 50),
  • Vector(-25, 0, -50)), Array(Vector(25, 0, 50), Vector(25, 0, -50)));
  • Global.VECTORS_Player_Spawns_Team1 = Array(Vector(0, 0, -10), Vector(-10, 0, -10), Vector(10, 0, -10));
  • Global.VECTORS_Player_Spawns_Team2 = Array(Vector(0, 0, 10), Vector(10, 0, 10), Vector(-10, 0, 10));
  • }
  • }
  • rule("MAP: Workshop Island")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Current Map == Map(Workshop Island) || Current Map == Map(Workshop Island Night)) == True;
  • }
  • actions
  • {
  • Global.BOOL_80s = True;
  • Global.VECTOR_Disc_Spawn = Vector(0, 0, 0);
  • Global.VECTORS_Field_Boundaries = Array(Array(Vector(-20, 0, 20), Vector(20, 0, 20)), Array(Vector(-20, 0, 12), Vector(20, 0, 12)),
  • Array(Vector(-20, 0, -12), Vector(20, 0, -12)), Array(Vector(-20, 0, -20), Vector(20, 0, -20)), Array(Vector(-20, 0, 20),
  • Vector(-20, 0, -20)), Array(Vector(20, 0, 20), Vector(20, 0, -20)));
  • Global.VECTORS_Player_Spawns_Team1 = Array(Vector(0, 0, -20), Vector(-20, 0, -20), Vector(20, 0, -20));
  • Global.VECTORS_Player_Spawns_Team2 = Array(Vector(0, 0, 20), Vector(20, 0, 20), Vector(-20, 0, 20));
  • }
  • }
  • rule("INIT")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Global.BOOL_Initialized == Null;
  • }
  • actions
  • {
  • Global.BOOL_Initialized = True;
  • Global.REAL_Disc_Catch_Radius = 2;
  • Global.REAL_Disc_Pickup_Radius = 1.500;
  • Global.REAL_Disc_Holder_Ring_Radius = 3;
  • Global.REAL_Disc_Lift_Max_Accel = 0.450;
  • Global.INT_Disc_Outer_Orb_Width = 0.500;
  • Wait(5, Ignore Condition);
  • Call Subroutine(EFFECTS_Field_Create);
  • Call Subroutine(DISC_Create);
  • Call Subroutine(HUD_Init);
  • Global.TEAM_Possession = Random Value In Array(Array(Team 1, Team 2));
  • Call Subroutine(POSSESSION_Swap);
  • }
  • }
  • rule("PLAYER: Joins")
  • {
  • event
  • {
  • Player Joined Match;
  • All;
  • All;
  • }
  • actions
  • {
  • Event Player.BOOL_Throwing_Disc = False;
  • Event Player.STRINGS_HUD_Disc_Status = Array(Custom String("No disc"), Custom String("Now you can"), Custom String(
  • "Spawn a disc"));
  • Global.PLAYERS_All = All Players(All Teams);
  • If(Global.PLAYERS_Disc_Visible != Empty Array);
  • Global.PLAYERS_Disc_Visible = All Players(All Teams);
  • End;
  • Create HUD Text(Event Player, Event Player.STRINGS_HUD_Disc_Status[0], Event Player.STRINGS_HUD_Disc_Status[1],
  • Event Player.STRINGS_HUD_Disc_Status[2], Top, 0, White, Turquoise, White, String, Default Visibility);
  • Set Damage Dealt(Event Player, 0);
  • }
  • }
  • rule("PLAYER: Spawns")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Has Spawned(Event Player) == True;
  • }
  • actions
  • {
  • Event Player.INT_Curve_Angle = 25;
  • Set Ultimate Charge(Event Player, 25);
  • }
  • }
  • rule("PLAYER: Change hero")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Button Held(Event Player, Interact) == True;
  • Is Button Held(Event Player, Ultimate) == True;
  • }
  • actions
  • {
  • Set Player Allowed Heroes(Event Player, Filtered Array(All Heroes, Hero Of(Event Player) != Current Array Element));
  • Wait(0.250, Ignore Condition);
  • Reset Player Hero Availability(Event Player);
  • }
  • }
  • rule("PLAYER: Leaves")
  • {
  • event
  • {
  • Player Left Match;
  • All;
  • All;
  • }
  • actions
  • {
  • Big Message(All Players(All Teams), Custom String("Player left match. Resetting..."));
  • "Wait a moment to allow other rules to finish. Race conditions..."
  • Wait(1, Ignore Condition);
  • Call Subroutine(DISC_Reset);
  • Call Subroutine(PLAYERS_Reset);
  • }
  • }
  • rule("START: Game mode starts")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Game In Progress == True;
  • }
  • actions
  • {
  • Global.STRING_HUD_Possession_Enforced = Custom String("Enforced: can only pick up disc with possession");
  • Set Team Score(Team 1, 0);
  • Set Team Score(Team 2, 0);
  • Wait(1, Ignore Condition);
  • Call Subroutine(DISC_Reset);
  • Call Subroutine(PLAYERS_Reset);
  • }
  • }
  • rule("PLAYER: Set throw angle")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Button Held(Event Player, Reload) == True;
  • Is Button Held(Event Player, Interact) == False;
  • }
  • actions
  • {
  • If(Event Player.INT_Curve_Angle < 50);
  • Event Player.INT_Curve_Angle += 5;
  • Else;
  • Event Player.INT_Curve_Angle = 0;
  • End;
  • Set Ultimate Charge(Event Player, Event Player.INT_Curve_Angle);
  • Wait(0.100, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • rule("PLAYER: Picks up disc")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Global.PLAYER_Holding_Disc == Null;
  • Is Button Held(Event Player, Crouch) == True;
  • Is On Ground(Global.ENTITY_Disc1) == True;
  • Speed Of(Global.ENTITY_Disc1) == 0;
  • Distance Between(Position Of(Event Player), Position Of(Global.ENTITY_Disc1)) <= Global.REAL_Disc_Pickup_Radius;
  • (Is Game In Progress == False || Team Of(Event Player) == Global.TEAM_Possession) == True;
  • Global.BOOL_Disc_Thrown == False;
  • }
  • actions
  • {
  • Global.PLAYER_Holding_Disc = Event Player;
  • Small Message(All Players(All Teams), Custom String("{0} picked up disc", Event Player));
  • Call Subroutine(PLAYER_Takes_Disc);
  • }
  • }
  • rule("PLAYER: Begins throwing disc")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Global.PLAYER_Holding_Disc == Event Player;
  • Global.BOOL_Disc_Thrown == False;
  • Event Player.BOOL_Throwing_Disc == False;
  • Is Button Held(Event Player, Primary Fire) == True;
  • }
  • actions
  • {
  • Stop Holding Button(Event Player, Crouch);
  • Event Player.STRINGS_HUD_Disc_Status = Array(Custom String("Throwing disc"), Custom String("Now you can"), Custom String(
  • "Aim up slightly, and release the disc while turning slowly"));
  • Event Player.BOOL_Throwing_Disc = True;
  • }
  • }
  • rule("PLAYER: Record turn rate while throwing")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player.BOOL_Throwing_Disc == True;
  • }
  • actions
  • {
  • Event Player.INT_Turn_Rate = Angle Difference(Event Player.INT_Last_Facing_Angle, Horizontal Facing Angle Of(Event Player));
  • Event Player.INT_Last_Facing_Angle = Horizontal Facing Angle Of(Event Player);
  • Wait(0.100, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • rule("PLAYER: Throws disc")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player.BOOL_Throwing_Disc == True;
  • Is Button Held(Event Player, Primary Fire) == False;
  • }
  • actions
  • {
  • Event Player.BOOL_Throwing_Disc = False;
  • Global.PLAYER_Holding_Disc = Null;
  • Global.PLAYER_Threw_Disc = Event Player;
  • Global.PLAYERS_Disc_Visible = Global.PLAYERS_All;
  • Clear Status(Event Player, Rooted);
  • Event Player.STRINGS_HUD_Disc_Status = Array(Custom String("Disc thrown"), Custom String("Now you can"), Custom String(
  • "Go pick it up or catch a thrown one"));
  • "Destroy holding-disc effect."
  • Destroy Effect(Global.EFFECT_Holding_Disc);
  • Global.EFFECT_Holding_Disc = Null;
  • "Record position of throw."
  • Global.VECTOR_Disc_Thrown_From = Position Of(Event Player);
  • Global.VECTOR_Disc_Initial_Throw = Facing Direction Of(Event Player) * Vector(1, 0, 1);
  • "Calcuate and set disc curve vector and speed."
  • Global.VECTOR_Disc_Curve_Impulse = Event Player.INT_Curve_Angle - 25 < 0 ? Vector(1, 0, 0) : Vector(-1, 0, 0);
  • If(Event Player.INT_Curve_Angle <= 25);
  • Global.INT_Disc_Curve_Speed = Absolute Value(Event Player.INT_Curve_Angle - 25) / 25;
  • Else If(Event Player.INT_Curve_Angle == 25);
  • Global.INT_Disc_Curve_Speed = 0;
  • Else;
  • Global.INT_Disc_Curve_Speed = (Event Player.INT_Curve_Angle - 25) / 25;
  • End;
  • "Set dummy bot to facing direction of player."
  • Set Facing(Global.ENTITY_Disc1, Facing Direction Of(Event Player), To World);
  • Stop Forcing Player Position(Global.ENTITY_Disc1);
  • "Apply impulse to disc (capped to 40)."
  • Apply Impulse(Global.ENTITY_Disc1, Facing Direction Of(Event Player), Min(40, Absolute Value(Event Player.INT_Turn_Rate) * 2),
  • To World, Incorporate Contrary Motion);
  • "Wait one frame (?) before setting variable indicating disc has been thrown. Trying to avoid it being instantly detected as on the ground again."
  • Wait(0.032, Ignore Condition);
  • Global.BOOL_Disc_Thrown = True;
  • Set Crouch Enabled(Event Player, True);
  • }
  • }
  • rule("PLAYER: Catches disc")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Is Button Held(Event Player, Jump) || Is Button Held(Event Player, Crouch)) == True;
  • Global.PLAYER_Holding_Disc == Null;
  • Is On Ground(Global.ENTITY_Disc1) == False;
  • Distance Between(Eye Position(Event Player), Position Of(Global.ENTITY_Disc1)) <= Global.REAL_Disc_Catch_Radius;
  • "Safe zone for passer equal to the radius of the visible ring."
  • Distance Between(Position Of(Event Player), Global.VECTOR_Disc_Thrown_From) >= Global.REAL_Disc_Holder_Ring_Radius;
  • }
  • actions
  • {
  • If(Team Of(Event Player) == Team Of(Global.PLAYER_Threw_Disc));
  • Small Message(All Players(All Teams), Custom String("{0} caught {1}'s pass", Event Player, Global.PLAYER_Threw_Disc));
  • Else;
  • Small Message(All Players(All Teams), Custom String("{0} intercepted {1}'s pass", Event Player, Global.PLAYER_Threw_Disc));
  • Global.BOOL_Possession_Changing = True;
  • End;
  • Call Subroutine(PLAYER_Takes_Disc);
  • }
  • }
  • rule("PLAYER: Lands on ground with disc")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Global.PLAYER_Holding_Disc == Event Player;
  • Is On Ground(Event Player) == True;
  • Global.BOOL_Disc_Thrown == True;
  • }
  • actions
  • {
  • Global.BOOL_Disc_Thrown = False;
  • Call Subroutine(PLAYER_Check_Out_Of_Bounds);
  • If(Global.BOOL_Out_Of_Bounds == True);
  • Small Message(All Players(All Teams), Custom String("Catching player landed out of bounds"));
  • Call Subroutine(POSSESSION_Swap);
  • Call Subroutine(DISC_Reset);
  • Call Subroutine(PLAYERS_Reset);
  • "Not out of bounds."
  • Else;
  • "If player is not alone on team, check for self-catch."
  • If(Count Of(Filtered Array(All Players(Team Of(Event Player)), !Is Dummy Bot(Current Array Element))) > 1);
  • If(Event Player == Global.PLAYER_Threw_Disc);
  • Small Message(All Players(All Teams), Custom String("{0} caught own pass", Event Player));
  • Call Subroutine(POSSESSION_Swap);
  • Abort;
  • End;
  • Else;
  • Call Subroutine(PLAYER_Check_for_Scoring);
  • If(Global.BOOL_Scored == True);
  • Wait(1, Ignore Condition);
  • Call Subroutine(POSSESSION_Swap);
  • Call Subroutine(DISC_Reset);
  • Call Subroutine(PLAYERS_Reset);
  • End;
  • "e.g. interception"
  • If(Global.BOOL_Possession_Changing == True);
  • Call Subroutine(POSSESSION_Swap);
  • End;
  • End;
  • Call Subroutine(PLAYER_Check_for_Scoring);
  • If(Global.BOOL_Scored == True);
  • Wait(1, Ignore Condition);
  • Call Subroutine(POSSESSION_Swap);
  • Call Subroutine(DISC_Reset);
  • Call Subroutine(PLAYERS_Reset);
  • "e.g. interception"
  • Else If(Global.BOOL_Possession_Changing == True);
  • Call Subroutine(POSSESSION_Swap);
  • End;
  • End;
  • }
  • }
  • rule("DISC: Apply sideways motion in air")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Global.ENTITY_Disc1;
  • Is In Air(Event Player) == True;
  • Global.BOOL_Disc_Thrown == True;
  • }
  • actions
  • {
  • Apply Impulse(Event Player, Global.VECTOR_Disc_Curve_Impulse, Global.INT_Disc_Curve_Speed, To Player, Incorporate Contrary Motion);
  • "WIP: simulate disc lift"
  • Apply Impulse(Event Player, Vector(0, 1, 0), Min(Global.REAL_Disc_Lift_Max_Accel, Absolute Value(Speed Of In Direction(
  • Event Player, Global.VECTOR_Disc_Initial_Throw) / 2)), To World, Incorporate Contrary Motion);
  • Wait(0.100, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • rule("DISC: Comes to rest on ground")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Global.ENTITY_Disc1;
  • Global.PLAYER_Holding_Disc == Null;
  • Is On Ground(Event Player) == True;
  • Speed Of(Event Player) == 0;
  • Global.BOOL_Disc_Thrown == True;
  • }
  • actions
  • {
  • Global.BOOL_Disc_Thrown = False;
  • Call Subroutine(POSSESSION_Swap);
  • Call Subroutine(PLAYER_Check_Out_Of_Bounds);
  • If(Global.BOOL_Out_Of_Bounds == True);
  • Small Message(All Players(All Teams), Custom String("Disc landed out of bounds"));
  • Call Subroutine(DISC_Reset);
  • Call Subroutine(PLAYERS_Reset);
  • Else;
  • Small Message(All Players(All Teams), Custom String("Pass not caught"));
  • End;
  • }
  • }
  • rule("DISC: (Workshop Island) Move back toward island")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Global.ENTITY_Disc1;
  • Is In Air(Event Player) == True;
  • Global.BOOL_Disc_Thrown == True;
  • (X Component Of(Position Of(Event Player)) > 20 || Z Component Of(Position Of(Event Player)) > 20 || X Component Of(Position Of(
  • Event Player)) < -20 || Z Component Of(Position Of(Event Player)) < -20) == True;
  • (Current Map == Map(Workshop Island) || Current Map == Map(Workshop Island Night)) == True;
  • Y Component Of(Position Of(Event Player)) > 0;
  • }
  • actions
  • {
  • Apply Impulse(Event Player, Vector(1, 0, 1) * Direction Towards(Position Of(Event Player), Vector(0, 0, 0)), 2, To World,
  • Incorporate Contrary Motion);
  • Wait(0.100, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • rule("DISC: Dies")
  • {
  • event
  • {
  • Player Died;
  • All;
  • All;
  • }
  • conditions
  • {
  • Global.ENTITY_Disc1 == Event Player;
  • }
  • actions
  • {
  • Small Message(All Players(All Teams), Custom String("Disc fell out of bounds"));
  • Modify Team Score(Team Of(Global.ENTITY_Disc1), 1);
  • Respawn(Event Player);
  • Call Subroutine(DISC_Reset);
  • Call Subroutine(PLAYERS_Reset);
  • Call Subroutine(POSSESSION_Swap);
  • }
  • }
  • rule("SUBR: HUD_Init")
  • {
  • event
  • {
  • Subroutine;
  • HUD_Init;
  • }
  • actions
  • {
  • Global.STRING_HUD_Possession_Enforced = Custom String("Not enforced before game begins");
  • "Create instructional HUDs."
  • Create HUD Text(Global.PLAYERS_All, Custom String("Set Angle"), Custom String("Ultimate charge 0-24=left, 26-50=right"),
  • Custom String("Reload"), Right, 0, Orange, Orange, White, Visible To and String, Default Visibility);
  • Create HUD Text(Global.PLAYERS_All, Custom String("CATCH DISC"), Custom String(
  • "While near disc in midair "), Custom String("Hold Jump or Crouch"), Right, 0, White, Turquoise,
  • White, Visible To and String, Default Visibility);
  • Create HUD Text(Global.PLAYERS_All, Custom String("Throw disc"), Custom String(" while turning (slowly!)"), Custom String(
  • "Hold and release Primary Fire"), Right, 0, White, Turquoise, White, Visible To and String, Default Visibility);
  • Create HUD Text(Global.PLAYERS_All, Custom String("Pick up disc"), Custom String("While next to disc"), Custom String(
  • "Crouch "), Right, 0, White, Turquoise, White, Visible To and String,
  • Default Visibility);
  • Create HUD Text(Global.PLAYERS_All, Custom String("SCORE BY"), Custom String("Having team possession"), Custom String(
  • "Catching disc in your team's goal"), Right, 0, White, Turquoise, White, Visible To and String, Default Visibility);
  • Create HUD Text(Global.PLAYERS_All, Custom String("CHANGE HERO"), Null, Custom String("Interact + Ultimate"), Right, 0, White,
  • Turquoise, White, Visible To and String, Default Visibility);
  • Create HUD Text(Global.PLAYERS_All, Custom String("Share code"), Custom String("https://workshop.codes/ultimate-frisbee"),
  • Custom String("6AW6H"), Left, 0, White, White, White, Visible To and String, Default Visibility);
  • "Create status HUDs."
  • Create HUD Text(Global.TEAM_Possession, Custom String(""), Null, Null, Left, 0, White, White, White, Visible To and String,
  • Default Visibility);
  • Create HUD Text(All Players(Global.TEAM_Possession), Custom String("POSSESSION"), Global.STRING_HUD_Possession_Enforced,
  • Custom String("Our team"), Top, 0, White, Turquoise, White, Visible To and String, Default Visibility);
  • Create HUD Text(All Players(Global.TEAM_Not_Possession), Custom String("POSSESSION"), Global.STRING_HUD_Possession_Enforced,
  • Custom String("Other team"), Top, 0, White, Turquoise, White, Visible To and String, Default Visibility);
  • }
  • }
  • rule("SUBR: DISC_Create")
  • {
  • event
  • {
  • Subroutine;
  • DISC_Create;
  • }
  • actions
  • {
  • "Create dummy bot for disc."
  • Create Dummy Bot(Hero(Torbjörn), Team 2, 5, Global.VECTOR_Disc_Spawn, Vector(0, 0, 0));
  • Global.ENTITY_Disc1 = Last Created Entity;
  • Set Gravity(Global.ENTITY_Disc1, 50);
  • Set Invisible(Global.ENTITY_Disc1, All);
  • disabled Set Status(Global.ENTITY_Disc1, Null, Phased Out, 9999);
  • Teleport(Global.ENTITY_Disc1, Global.VECTOR_Disc_Spawn);
  • "Create disc visual effects."
  • Create Effect(Global.PLAYERS_Disc_Visible, Sphere, Orange, Position Of(Global.ENTITY_Disc1), Global.INT_Disc_Outer_Orb_Width,
  • Visible To Position and Radius);
  • Global.EFFECT_Disc_Outer_Sphere = Last Created Entity;
  • Create Effect(Global.PLAYERS_All, Sphere, White, Position Of(Global.ENTITY_Disc1), 0.300, Visible To Position and Radius);
  • }
  • }
  • rule("SUBR: EFFECTS_Field_Create (Creates a football-like field, with lines A-D being end-zone lines across the width, E-F sidelines)")
  • {
  • event
  • {
  • Subroutine;
  • EFFECTS_Field_Create;
  • }
  • actions
  • {
  • If(Global.BOOL_80s == True);
  • "Line A"
  • Create Beam Effect(Global.PLAYERS_All, Good Beam, Global.VECTORS_Field_Boundaries[0][0], Global.VECTORS_Field_Boundaries[0][1],
  • Sky Blue, Visible To Position and Radius);
  • "Line B"
  • Create Beam Effect(Global.PLAYERS_All, Good Beam, Global.VECTORS_Field_Boundaries[1][0], Global.VECTORS_Field_Boundaries[1][1],
  • Sky Blue, Visible To Position and Radius);
  • "Line C"
  • Create Beam Effect(Global.PLAYERS_All, Good Beam, Global.VECTORS_Field_Boundaries[2][0], Global.VECTORS_Field_Boundaries[2][1],
  • Purple, Visible To Position and Radius);
  • "Line D"
  • Create Beam Effect(Global.PLAYERS_All, Good Beam, Global.VECTORS_Field_Boundaries[3][0], Global.VECTORS_Field_Boundaries[3][1],
  • Purple, Visible To Position and Radius);
  • "Line E"
  • Create Beam Effect(Global.PLAYERS_All, Good Beam, Global.VECTORS_Field_Boundaries[4][0], Global.VECTORS_Field_Boundaries[4][1],
  • White, Visible To Position and Radius);
  • "Line F"
  • Create Beam Effect(Global.PLAYERS_All, Good Beam, Global.VECTORS_Field_Boundaries[5][0], Global.VECTORS_Field_Boundaries[5][1],
  • White, Visible To Position and Radius);
  • Else;
  • "Line A"
  • Create Beam Effect(Global.PLAYERS_All, Good Beam, Global.VECTORS_Field_Boundaries[0][0], Global.VECTORS_Field_Boundaries[0][1],
  • Team 1, Visible To Position and Radius);
  • "Line B"
  • Create Beam Effect(Global.PLAYERS_All, Good Beam, Global.VECTORS_Field_Boundaries[1][0], Global.VECTORS_Field_Boundaries[1][1],
  • Team 1, Visible To Position and Radius);
  • "Line C"
  • Create Beam Effect(Global.PLAYERS_All, Good Beam, Global.VECTORS_Field_Boundaries[2][0], Global.VECTORS_Field_Boundaries[2][1],
  • Team 2, Visible To Position and Radius);
  • "Line D"
  • Create Beam Effect(Global.PLAYERS_All, Good Beam, Global.VECTORS_Field_Boundaries[3][0], Global.VECTORS_Field_Boundaries[3][1],
  • Team 2, Visible To Position and Radius);
  • "Line E"
  • Create Beam Effect(Global.PLAYERS_All, Good Beam, Global.VECTORS_Field_Boundaries[4][0], Global.VECTORS_Field_Boundaries[4][1],
  • White, Visible To Position and Radius);
  • "Line F"
  • Create Beam Effect(Global.PLAYERS_All, Good Beam, Global.VECTORS_Field_Boundaries[5][0], Global.VECTORS_Field_Boundaries[5][1],
  • White, Visible To Position and Radius);
  • End;
  • }
  • }
  • rule("SUBR: DISC_Reset")
  • {
  • event
  • {
  • Subroutine;
  • DISC_Reset;
  • }
  • actions
  • {
  • Global.PLAYER_Holding_Disc = Null;
  • Global.PLAYER_Threw_Disc = Null;
  • Global.BOOL_Disc_Thrown = False;
  • Global.BOOL_Scored = False;
  • Global.BOOL_Out_Of_Bounds = False;
  • Global.BOOL_Possession_Changing = False;
  • Global.PLAYERS_Disc_Visible = All Players(All Teams);
  • Destroy Effect(Global.EFFECT_Holding_Disc);
  • Global.EFFECT_Holding_Disc = Null;
  • Start Forcing Player Position(Global.ENTITY_Disc1, Position Of(Global.VECTOR_Disc_Spawn), False);
  • Wait(0.100, Ignore Condition);
  • Stop Forcing Player Position(Global.ENTITY_Disc1);
  • }
  • }
  • rule("SUBR: PLAYERS_Reset")
  • {
  • event
  • {
  • Subroutine;
  • PLAYERS_Reset;
  • }
  • actions
  • {
  • "Reset team 1 players."
  • Global.PLAYERS_Temp = Randomized Array(Filtered Array(All Players(Team 1), !Is Dummy Bot(Current Array Element)));
  • For Global Variable(INT_Loop_Control, 0, Count Of(Global.PLAYERS_Temp), 1);
  • Set Status(Global.PLAYERS_Temp[Global.INT_Loop_Control], Null, Rooted, 9999);
  • Start Forcing Player Position(Global.PLAYERS_Temp[Global.INT_Loop_Control],
  • Global.VECTORS_Player_Spawns_Team1[Global.INT_Loop_Control], False);
  • Wait(0.320, Ignore Condition);
  • Stop Forcing Player Position(Global.PLAYERS_Temp[Global.INT_Loop_Control]);
  • End;
  • "Reset team 2 players."
  • Global.PLAYERS_Temp = Randomized Array(Filtered Array(All Players(Team 2), !Is Dummy Bot(Current Array Element)));
  • For Global Variable(INT_Loop_Control, 0, Count Of(Global.PLAYERS_Temp), 1);
  • Set Status(Global.PLAYERS_Temp[Global.INT_Loop_Control], Null, Rooted, 9999);
  • Start Forcing Player Position(Global.PLAYERS_Temp[Global.INT_Loop_Control],
  • Global.VECTORS_Player_Spawns_Team2[Global.INT_Loop_Control], False);
  • Wait(0.320, Ignore Condition);
  • Stop Forcing Player Position(Global.PLAYERS_Temp[Global.INT_Loop_Control]);
  • End;
  • "Unroot and enable crouching for all players."
  • Wait(1, Ignore Condition);
  • Global.PLAYERS_Temp = All Players(All Teams);
  • For Global Variable(INT_Loop_Control, 0, Count Of(Global.PLAYERS_All), 1);
  • Clear Status(Global.PLAYERS_Temp[Global.INT_Loop_Control], Rooted);
  • Set Crouch Enabled(Global.PLAYERS_Temp[Global.INT_Loop_Control], True);
  • Set Facing(Global.PLAYERS_Temp[Global.INT_Loop_Control], Direction Towards(Position Of(
  • Global.PLAYERS_Temp[Global.INT_Loop_Control]), Position Of(Global.ENTITY_Disc1)), To World);
  • End;
  • }
  • }
  • rule("SUBR: POSSESSION_Swap")
  • {
  • event
  • {
  • Subroutine;
  • POSSESSION_Swap;
  • }
  • actions
  • {
  • Global.BOOL_Possession_Changing = False;
  • Small Message(All Players(All Teams), Custom String("Turnover"));
  • Destroy Effect(Global.EFFECT_Disc_Outer_Sphere);
  • If(Global.TEAM_Possession == Team 1);
  • Global.TEAM_Possession = Team 2;
  • Global.TEAM_Not_Possession = Team 1;
  • "Create disc visual effects."
  • If(Global.BOOL_80s == True);
  • Create Effect(Global.PLAYERS_Disc_Visible, Sphere, Purple, Position Of(Global.ENTITY_Disc1), Global.INT_Disc_Outer_Orb_Width,
  • Visible To Position and Radius);
  • Else;
  • Create Effect(Global.PLAYERS_Disc_Visible, Sphere, Team 2, Position Of(Global.ENTITY_Disc1), Global.INT_Disc_Outer_Orb_Width,
  • Visible To Position and Radius);
  • End;
  • Else;
  • Global.TEAM_Possession = Team 1;
  • Global.TEAM_Not_Possession = Team 2;
  • "Create disc visual effects."
  • If(Global.BOOL_80s == True);
  • Create Effect(Global.PLAYERS_Disc_Visible, Sphere, Sky Blue, Position Of(Global.ENTITY_Disc1), Global.INT_Disc_Outer_Orb_Width,
  • Visible To Position and Radius);
  • Else;
  • Create Effect(Global.PLAYERS_Disc_Visible, Sphere, Team 1, Position Of(Global.ENTITY_Disc1), Global.INT_Disc_Outer_Orb_Width,
  • Visible To Position and Radius);
  • End;
  • End;
  • Global.EFFECT_Disc_Outer_Sphere = Last Created Entity;
  • }
  • }
  • rule("SUBR: PLAYER_Takes_Disc")
  • {
  • event
  • {
  • Subroutine;
  • PLAYER_Takes_Disc;
  • }
  • actions
  • {
  • Global.PLAYER_Holding_Disc = Event Player;
  • Global.PLAYERS_Disc_Visible = Empty Array;
  • Set Crouch Enabled(Event Player, False);
  • If(Global.BOOL_80s == True);
  • If(Team Of(Event Player) == Team 1);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Sky Blue, Event Player, 0.500);
  • Else;
  • Play Effect(All Players(All Teams), Good Pickup Effect, Purple, Event Player, 0.500);
  • End;
  • Else;
  • If(Team Of(Event Player) == Team 1);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Team 1, Event Player, 0.500);
  • Else;
  • Play Effect(All Players(All Teams), Good Pickup Effect, Team 2, Event Player, 0.500);
  • End;
  • End;
  • "Create team-colored holding-disc ring effect."
  • If(Global.BOOL_80s == True);
  • If(Team Of(Event Player) == Team 1);
  • Create Effect(Global.PLAYERS_All, Ring, Sky Blue, Event Player, Global.REAL_Disc_Holder_Ring_Radius,
  • Visible To Position and Radius);
  • Else;
  • Create Effect(Global.PLAYERS_All, Ring, Purple, Event Player, Global.REAL_Disc_Holder_Ring_Radius, Visible To Position and Radius);
  • End;
  • Else;
  • If(Team Of(Event Player) == Team 1);
  • Create Effect(Global.PLAYERS_All, Ring, Team 1, Event Player, Global.REAL_Disc_Holder_Ring_Radius, Visible To Position and Radius);
  • Else;
  • Create Effect(Global.PLAYERS_All, Ring, Team 2, Event Player, Global.REAL_Disc_Holder_Ring_Radius, Visible To Position and Radius);
  • End;
  • End;
  • Global.EFFECT_Holding_Disc = Last Created Entity;
  • "Update player's status HUD."
  • Event Player.STRINGS_HUD_Disc_Status = Array(Custom String("Holding disc"), Custom String("To throw"), Custom String(
  • "hold Primary Fire, rotate slowly, and release"));
  • Set Status(Event Player, Null, Rooted, 9999);
  • Start Forcing Player Position(Global.ENTITY_Disc1, Position Of(Event Player), True);
  • }
  • }
  • rule("SUBR: PLAYER_Check_Out_Of_Bounds (checks Event Player, which may be disc or player holding it)")
  • {
  • event
  • {
  • Subroutine;
  • PLAYER_Check_Out_Of_Bounds;
  • }
  • actions
  • {
  • "Check for out-of-bounds."
  • If(Z Component Of(Position Of(Event Player)) > Z Component Of(Global.VECTORS_Field_Boundaries[0][0]) || X Component Of(Position Of(
  • Event Player)) > X Component Of(Global.VECTORS_Field_Boundaries[0][1]) || Z Component Of(Position Of(Event Player))
  • < Z Component Of(Global.VECTORS_Field_Boundaries[3][0]) || X Component Of(Position Of(Event Player)) < X Component Of(
  • Global.VECTORS_Field_Boundaries[0][0]));
  • Global.BOOL_Out_Of_Bounds = True;
  • End;
  • }
  • }
  • rule("SUBR: PLAYER_Check_for_Scoring")
  • {
  • event
  • {
  • Subroutine;
  • PLAYER_Check_for_Scoring;
  • }
  • actions
  • {
  • "Disc holder within team 1 end zone"
  • If(Global.TEAM_Possession == Team 1 && X Component Of(Position Of(Global.PLAYER_Holding_Disc)) >= X Component Of(
  • Global.VECTORS_Field_Boundaries[0][0]) && X Component Of(Position Of(Global.PLAYER_Holding_Disc)) <= X Component Of(
  • Global.VECTORS_Field_Boundaries[0][1]) && Z Component Of(Position Of(Global.PLAYER_Holding_Disc)) <= Z Component Of(
  • Global.VECTORS_Field_Boundaries[0][0]) && Z Component Of(Position Of(Global.PLAYER_Holding_Disc)) >= Z Component Of(
  • Global.VECTORS_Field_Boundaries[1][0]));
  • Modify Team Score(Team 1, 1);
  • Big Message(All Players(All Teams), Custom String("{0} scored on a pass from {1}!", Global.PLAYER_Holding_Disc,
  • Global.PLAYER_Threw_Disc));
  • Global.BOOL_Scored = True;
  • "Disc holder within team 2 end zone"
  • Else If(Global.TEAM_Possession == Team 2 && X Component Of(Position Of(Global.PLAYER_Holding_Disc)) >= X Component Of(
  • Global.VECTORS_Field_Boundaries[2][0]) && X Component Of(Position Of(Global.PLAYER_Holding_Disc)) <= X Component Of(
  • Global.VECTORS_Field_Boundaries[2][1]) && Z Component Of(Position Of(Global.PLAYER_Holding_Disc)) <= Z Component Of(
  • Global.VECTORS_Field_Boundaries[2][0]) && Z Component Of(Position Of(Global.PLAYER_Holding_Disc)) >= Z Component Of(
  • Global.VECTORS_Field_Boundaries[3][0]));
  • Modify Team Score(Team 2, 1);
  • Big Message(All Players(All Teams), Custom String("{0} scored on a pass from {1}!", Global.PLAYER_Holding_Disc,
  • Global.PLAYER_Threw_Disc));
  • Global.BOOL_Scored = True;
  • End;
  • }
  • }
  • rule("BASTION: Activate tank config")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • Bastion;
  • }
  • conditions
  • {
  • Has Spawned(Event Player) == True;
  • }
  • actions
  • {
  • Set Ultimate Ability Enabled(Event Player, True);
  • Set Ultimate Charge(Event Player, 100);
  • Press Button(Event Player, Ultimate);
  • }
  • }
  • rule("DISC: (Workshop Island) Move back toward island")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Global.ENTITY_Disc1;
  • Is In Air(Event Player) == True;
  • Global.BOOL_Disc_Thrown == True;
  • (X Component Of(Position Of(Event Player)) > 20 || Z Component Of(Position Of(Event Player)) > 20 || X Component Of(Position Of(
  • Event Player)) < -20 || Z Component Of(Position Of(Event Player)) < -20) == True;
  • }
  • actions
  • {
  • Apply Impulse(Event Player, Vector(1, 0, 1) * Direction Towards(Position Of(Event Player), Vector(0, 0, 0)), 2, To World,
  • Incorporate Contrary Motion);
  • Wait(0.100, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
Join the Workshop.codes Discord