Create
Return to post

Comparing difference between and

View raw
  • settings
  • {
  • main
  • {
  • Description: "Andy's Greenscreen - Created by @andygmb1 - Tweet me creations you make using this on twitter!"
  • }
  • lobby
  • {
  • Allow Players Who Are In Queue: Yes
  • Map Rotation: Paused
  • Max Spectators: 12
  • Max Team 2 Players: 0
  • Return To Lobby: Never
  • Swap Teams After Match: No
  • }
  • modes
  • {
  • Assault
  • {
  • enabled maps
  • {
  • Hanamura
  • }
  • }
  • Control
  • {
  • enabled maps
  • {
  • Lijiang Tower
  • }
  • }
  • Escort
  • {
  • enabled maps
  • {
  • }
  • }
  • Hybrid
  • {
  • enabled maps
  • {
  • }
  • }
  • Practice Range
  • {
  • enabled maps
  • {
  • }
  • }
  • Skirmish
  • {
  • enabled maps
  • {
  • }
  • }
  • Team Deathmatch
  • {
  • enabled maps
  • {
  • }
  • }
  • General
  • {
  • Game Mode Start: Immediately
  • Hero Limit: Off
  • Respawn Time Scalar: 0%
  • }
  • }
  • heroes
  • {
  • General
  • {
  • Spawn With Ultimate Ready: On
  • Ultimate Generation: 500%
  • Ultimate Generation - Combat: 500%
  • Ultimate Generation - Passive: 500%
  • }
  • }
  • }
  • variables
  • {
  • global:
  • 0: template_pos
  • 1: placing_screen_mode
  • 2: rotation
  • 3: template_distance
  • 4: greenscreen_height
  • 5: greenscreen_width
  • 6: placed_beam_y
  • 7: placed_beam_y_temp
  • 8: ring_effect_pos
  • 9: iter_1
  • 10: ring_effect_radius
  • 11: rings_array
  • 12: rings_array_delete
  • 13: rings_color
  • 14: rainbow_index
  • 15: iter_2
  • 16: perpendicular_screen_dir
  • 17: hero_scale_all
  • 18: freecam_mode
  • 20: freecam_position
  • 24: changing_colours
  • 25: freecam_move_speed
  • 26: player_outlines_toggle
  • 27: freecam_horizontal_initial
  • 28: freecam_vertical_initial
  • 29: freecam_horizontal_delta
  • 30: freecam_vertical_delta
  • 31: freecam_horizontal_current
  • 32: freecam_vertical_current
  • 33: attach_torb
  • 34: ring_color_string
  • 35: change_hero_pos
  • 36: emoting
  • 37: fixed_viewpoint_emoting
  • player:
  • 111: IsInMenuMode
  • 112: MenuVFX
  • 113: MenuZAxis
  • 114: MenuYAxis
  • 115: MenuXAxis
  • 116: CursorPos
  • 117: CurrActionID
  • 118: ButtonExitMenu
  • 119: ButtonProperties
  • 120: CursorX
  • 121: CursorY
  • 122: MenuEyePos
  • 123: MenuOriginalFacing
  • 124: ActionIDQueue
  • 125: CurrActionID_Secondary
  • 126: ActionIDQueue_Secondary
  • 127: __iter__
  • }
  • subroutines
  • {
  • 0: create_coloured_rings
  • 1: check_colours
  • 2: green
  • 3: blue
  • 4: red
  • 5: orange
  • 6: yellow
  • 7: purple
  • 8: aqua
  • 9: turquoise
  • 10: sky_blue
  • 11: team_2_red
  • 12: team_1_blue
  • 13: white
  • 14: lime_green
  • 15: rainbow
  • 16: create_torb_platform
  • 17: torbs_hello
  • 18: torbs_bye
  • 19: torbs_youre_welcome
  • 20: torb_yep
  • 21: please_give_colour_variables
  • 125: CreateMenuFrame
  • 126: CreateMenuButtons
  • 127: CreateMenuCursor
  • }
  • disabled rule("...........................................................................................................Andy's Green Screen")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • }
  • disabled rule("...........................................................................................................Made by @andygmb1")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • }
  • rule("global init")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • Global.player_outlines_toggle = Workshop Setting Toggle(Custom String("Greenscreen Settings"), Custom String(
  • "Disable player outlines"), True);
  • Global.hero_scale_all = 1;
  • Global.rotation = 60;
  • Global.placing_screen_mode = True;
  • Global.template_distance = 5;
  • Global.greenscreen_height = 4;
  • Global.greenscreen_width = 3.550;
  • Global.ring_effect_radius = 0.100;
  • Global.rings_array = Array();
  • Global.rings_color = 0;
  • Global.changing_colours = False;
  • Global.freecam_move_speed = 0.050;
  • Global.ring_color_string = Custom String("Green");
  • Disable Inspector Recording;
  • }
  • }
  • rule("host player init")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • }
  • actions
  • {
  • Disallow Button(Event Player, Ultimate);
  • Set Ability 2 Enabled(Event Player, False);
  • Disable Game Mode In-World UI(Event Player);
  • }
  • }
  • rule("all player init")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • }
  • actions
  • {
  • If(Global.player_outlines_toggle);
  • Start Forcing Player Outlines(Event Player, All Players(All Teams), False, White);
  • End;
  • Start Scaling Player(Event Player, Global.hero_scale_all, True);
  • }
  • }
  • rule("template pos")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Global.placing_screen_mode == True;
  • disabled Event Player.IsInMenuMode == False;
  • }
  • actions
  • {
  • Global.template_pos = Ray Cast Hit Position(Eye Position(Event Player), Eye Position(Event Player) + Facing Direction Of(
  • Event Player) * Global.template_distance, All Players(All Teams), Event Player, True);
  • }
  • }
  • rule("template effect")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Global.placing_screen_mode == True;
  • Event Player.IsInMenuMode == False;
  • }
  • actions
  • {
  • "Top Part"
  • Create Beam Effect(All Players(All Teams), Grapple Beam, Eye Position(Event Player) + Facing Direction Of(Event Player)
  • * Global.template_distance - Vector(0, Global.greenscreen_height / 2 * -1, 0) + Direction From Angles(Global.rotation, 0) * (
  • Global.greenscreen_width / 2), Eye Position(Event Player) + Facing Direction Of(Event Player)
  • * Global.template_distance - Vector(0, Global.greenscreen_height / 2 * -1, 0) - Direction From Angles(Global.rotation, 0) * (
  • Global.greenscreen_width / 2), Green, Visible To Position and Radius);
  • "Bottom Part"
  • Create Beam Effect(All Players(All Teams), Grapple Beam, Eye Position(Event Player) + Facing Direction Of(Event Player)
  • * Global.template_distance - Vector(0, Global.greenscreen_height / 2 * 1, 0) + Direction From Angles(Global.rotation, 0) * (
  • Global.greenscreen_width / 2), Eye Position(Event Player) + Facing Direction Of(Event Player)
  • * Global.template_distance - Vector(0, Global.greenscreen_height / 2 * 1, 0) - Direction From Angles(Global.rotation, 0) * (
  • Global.greenscreen_width / 2), Green, Visible To Position and Radius);
  • "Right Part"
  • Create Beam Effect(All Players(All Teams), Grapple Beam, Eye Position(Event Player) + Facing Direction Of(Event Player)
  • * Global.template_distance - Vector(0, Global.greenscreen_height / 2 * -1, 0) + Direction From Angles(Global.rotation, 0) * (
  • Global.greenscreen_width / 2), Eye Position(Event Player) + Facing Direction Of(Event Player)
  • * Global.template_distance - Vector(0, Global.greenscreen_height / 2 * 1, 0) + Direction From Angles(Global.rotation, 1) * (
  • Global.greenscreen_width / 2), Green, Visible To Position and Radius);
  • "Top Part"
  • Create Beam Effect(All Players(All Teams), Grapple Beam, Eye Position(Event Player) + Facing Direction Of(Event Player)
  • * Global.template_distance - Vector(0, Global.greenscreen_height / 2 * -1, 0) - Direction From Angles(Global.rotation, 0) * (
  • Global.greenscreen_width / 2), Eye Position(Event Player) + Facing Direction Of(Event Player)
  • * Global.template_distance - Vector(0, Global.greenscreen_height / 2 * 1, 0) - Direction From Angles(Global.rotation, 1) * (
  • Global.greenscreen_width / 2), Green, Visible To Position and Radius);
  • }
  • }
  • rule("rotation positive")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Global.placing_screen_mode == True;
  • Is Button Held(Event Player, Ability 2) == True;
  • }
  • actions
  • {
  • Global.rotation += 1;
  • Wait(0.016, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • rule("rotation negative")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Global.placing_screen_mode == True;
  • Is Button Held(Event Player, Ultimate) == True;
  • }
  • actions
  • {
  • Global.rotation -= 1;
  • Wait(0.016, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • rule("place screen")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Global.placing_screen_mode == True;
  • Event Player.IsInMenuMode == False;
  • Is Button Held(Event Player, Primary Fire) == True;
  • Is Button Held(Event Player, Interact) == False;
  • Event Player.CurrActionID != Custom String("placescreen");
  • }
  • actions
  • {
  • Allow Button(Event Player, Ultimate);
  • Set Ability 2 Enabled(Event Player, True);
  • Global.template_pos = Ray Cast Hit Position(Eye Position(Event Player), Eye Position(Event Player) + Facing Direction Of(
  • Event Player) * Global.template_distance, All Players(All Teams), Event Player, True);
  • Destroy All Effects;
  • Global.placing_screen_mode = False;
  • }
  • }
  • rule("place screen (global rule so effects persist if nobody is ingame)")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Global.placing_screen_mode == False;
  • }
  • actions
  • {
  • Global.placed_beam_y = Global.template_pos + Vector(0, Global.greenscreen_height / 2, 0);
  • For Global Variable(iter_1, 0, Global.greenscreen_height, 0.070);
  • Global.placed_beam_y_temp = Global.placed_beam_y + Vector(0, Global.iter_1 * -1, 0);
  • Create Beam Effect(All Players(All Teams), Grapple Beam, Global.placed_beam_y_temp + Direction From Angles(Global.rotation, 0) * (
  • Global.greenscreen_width / 2), Global.placed_beam_y_temp - Direction From Angles(Global.rotation, 0) * (
  • Global.greenscreen_width / 2), Green, Visible To);
  • Wait(0.016, Ignore Condition);
  • End;
  • Call Subroutine(create_coloured_rings);
  • Call Subroutine(create_torb_platform);
  • }
  • }
  • rule("destroy screen, go back to placing mode (interact)")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Global.placing_screen_mode == False;
  • Global.freecam_mode == False;
  • Event Player.CurrActionID == Custom String("placescreen");
  • }
  • actions
  • {
  • Start Rule(please_give_colour_variables, Do Nothing);
  • Start Rule(torbs_bye, Do Nothing);
  • Destroy All Effects;
  • Disallow Button(Event Player, Ultimate);
  • Set Ability 2 Enabled(Event Player, False);
  • Wait(0.016, Ignore Condition);
  • Global.placing_screen_mode = True;
  • Global.rings_array = Array();
  • Wait(0.330, Ignore Condition);
  • Event Player.IsInMenuMode = False;
  • }
  • }
  • rule("reload to change colour")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Global.changing_colours == False;
  • Global.placing_screen_mode == False;
  • Is Button Held(Event Player, Reload) == True;
  • Count Of(Global.rings_array) == 68;
  • }
  • actions
  • {
  • Global.rings_color += 1;
  • If(Global.rings_color == 14);
  • Global.rings_color = 0;
  • End;
  • Global.changing_colours = True;
  • }
  • }
  • rule("select next colour call (global rule so effects persist if nobody is ingame)")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Global.changing_colours == True;
  • Global.rings_array_delete == False;
  • }
  • actions
  • {
  • Call Subroutine(create_coloured_rings);
  • Global.changing_colours = False;
  • Wait(0.016, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • disabled rule(".............................................................................................................Colour Subroutines")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • }
  • rule("create_coloured_rings subroutine")
  • {
  • event
  • {
  • Subroutine;
  • create_coloured_rings;
  • }
  • actions
  • {
  • Global.rings_array_delete = Global.rings_array;
  • Global.rings_array = Array();
  • If(Global.rings_color != 13);
  • For Global Variable(iter_1, 0, Global.greenscreen_width, 0.105);
  • Destroy Effect(Global.rings_array_delete[0]);
  • Modify Global Variable(rings_array_delete, Remove From Array By Index, 0);
  • Destroy Effect(Global.rings_array_delete[0]);
  • Modify Global Variable(rings_array_delete, Remove From Array By Index, 0);
  • Wait(0.016, Ignore Condition);
  • Global.ring_effect_pos = Global.template_pos + Direction From Angles(Global.rotation, 0) * (Global.greenscreen_width / 2)
  • + Direction From Angles(Global.rotation, 0) * Global.iter_1 * -1;
  • Call Subroutine(check_colours);
  • Wait(0.032, Ignore Condition);
  • End;
  • Else;
  • Global.ring_color_string = Custom String("Rainbow");
  • Call Subroutine(rainbow);
  • End;
  • }
  • }
  • rule("check_colours subroutine")
  • {
  • event
  • {
  • Subroutine;
  • check_colours;
  • }
  • actions
  • {
  • If(Global.rings_color == 0);
  • Call Subroutine(green);
  • Else If(Global.rings_color == 1);
  • Call Subroutine(blue);
  • Else If(Global.rings_color == 2);
  • Call Subroutine(red);
  • Else If(Global.rings_color == 3);
  • Call Subroutine(purple);
  • Else If(Global.rings_color == 4);
  • Call Subroutine(yellow);
  • Else If(Global.rings_color == 5);
  • Call Subroutine(orange);
  • Else If(Global.rings_color == 6);
  • Call Subroutine(aqua);
  • Else If(Global.rings_color == 7);
  • Call Subroutine(turquoise);
  • Else If(Global.rings_color == 8);
  • Call Subroutine(sky_blue);
  • Else If(Global.rings_color == 9);
  • Call Subroutine(team_2_red);
  • Else If(Global.rings_color == 10);
  • Call Subroutine(team_1_blue);
  • Else If(Global.rings_color == 11);
  • Call Subroutine(lime_green);
  • Else If(Global.rings_color == 12);
  • Call Subroutine(white);
  • End;
  • }
  • }
  • rule("green")
  • {
  • event
  • {
  • Subroutine;
  • green;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, Green, Global.ring_effect_pos - Vector(0, 1, 0), Global.ring_effect_radius,
  • Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_effect_pos += Vector(0, 1, 0);
  • Create Effect(All Players(All Teams), Ring, Green, Global.ring_effect_pos, Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_color_string = Custom String("Green");
  • }
  • }
  • rule("blue")
  • {
  • event
  • {
  • Subroutine;
  • blue;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, Blue, Global.ring_effect_pos - Vector(0, 1, 0), Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_effect_pos += Vector(0, 1, 0);
  • Create Effect(All Players(All Teams), Ring, Blue, Global.ring_effect_pos, Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_color_string = Custom String("Blue");
  • }
  • }
  • rule("red")
  • {
  • event
  • {
  • Subroutine;
  • red;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, Red, Global.ring_effect_pos - Vector(0, 1, 0), Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_effect_pos += Vector(0, 1, 0);
  • Create Effect(All Players(All Teams), Ring, Red, Global.ring_effect_pos, Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_color_string = Custom String("Red");
  • }
  • }
  • rule("orange")
  • {
  • event
  • {
  • Subroutine;
  • orange;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, Orange, Global.ring_effect_pos - Vector(0, 1, 0), Global.ring_effect_radius,
  • Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_effect_pos += Vector(0, 1, 0);
  • Create Effect(All Players(All Teams), Ring, Orange, Global.ring_effect_pos, Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_color_string = Custom String("Orange");
  • }
  • }
  • rule("yellow")
  • {
  • event
  • {
  • Subroutine;
  • yellow;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, Yellow, Global.ring_effect_pos - Vector(0, 1, 0), Global.ring_effect_radius,
  • Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_effect_pos += Vector(0, 1, 0);
  • Create Effect(All Players(All Teams), Ring, Yellow, Global.ring_effect_pos, Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_color_string = Custom String("Yellow");
  • }
  • }
  • rule("purple")
  • {
  • event
  • {
  • Subroutine;
  • purple;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, Purple, Global.ring_effect_pos - Vector(0, 1, 0), Global.ring_effect_radius,
  • Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_effect_pos += Vector(0, 1, 0);
  • Create Effect(All Players(All Teams), Ring, Purple, Global.ring_effect_pos, Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_color_string = Custom String("Purple");
  • }
  • }
  • rule("aqua")
  • {
  • event
  • {
  • Subroutine;
  • aqua;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, Aqua, Global.ring_effect_pos - Vector(0, 1, 0), Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_effect_pos += Vector(0, 1, 0);
  • Create Effect(All Players(All Teams), Ring, Aqua, Global.ring_effect_pos, Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_color_string = Custom String("Aqua");
  • }
  • }
  • rule("turquoise")
  • {
  • event
  • {
  • Subroutine;
  • turquoise;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, Turquoise, Global.ring_effect_pos - Vector(0, 1, 0), Global.ring_effect_radius,
  • Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_effect_pos += Vector(0, 1, 0);
  • Create Effect(All Players(All Teams), Ring, Turquoise, Global.ring_effect_pos, Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_color_string = Custom String("Turquoise");
  • }
  • }
  • rule("sky blue")
  • {
  • event
  • {
  • Subroutine;
  • sky_blue;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, Sky Blue, Global.ring_effect_pos - Vector(0, 1, 0), Global.ring_effect_radius,
  • Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_effect_pos += Vector(0, 1, 0);
  • Create Effect(All Players(All Teams), Ring, Sky Blue, Global.ring_effect_pos, Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_color_string = Custom String("Sky Blue");
  • }
  • }
  • rule("team 2 (red)")
  • {
  • event
  • {
  • Subroutine;
  • team_2_red;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, Team 2, Global.ring_effect_pos - Vector(0, 1, 0), Global.ring_effect_radius,
  • Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_effect_pos += Vector(0, 1, 0);
  • Create Effect(All Players(All Teams), Ring, Team 2, Global.ring_effect_pos, Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_color_string = Custom String("Team 2 (red)");
  • }
  • }
  • rule("team 1 (blue)")
  • {
  • event
  • {
  • Subroutine;
  • team_1_blue;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, Team 1, Global.ring_effect_pos - Vector(0, 1, 0), Global.ring_effect_radius,
  • Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_effect_pos += Vector(0, 1, 0);
  • Create Effect(All Players(All Teams), Ring, Team 1, Global.ring_effect_pos, Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_color_string = Custom String("Team 1 (blue)");
  • }
  • }
  • rule("white")
  • {
  • event
  • {
  • Subroutine;
  • white;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, White, Global.ring_effect_pos - Vector(0, 1, 0), Global.ring_effect_radius,
  • Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_effect_pos += Vector(0, 1, 0);
  • Create Effect(All Players(All Teams), Ring, White, Global.ring_effect_pos, Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_color_string = Custom String("White");
  • }
  • }
  • rule("lime green")
  • {
  • event
  • {
  • Subroutine;
  • lime_green;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, Lime Green, Global.ring_effect_pos - Vector(0, 1, 0), Global.ring_effect_radius,
  • Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_effect_pos += Vector(0, 1, 0);
  • Create Effect(All Players(All Teams), Ring, Lime Green, Global.ring_effect_pos, Global.ring_effect_radius, Visible To);
  • Modify Global Variable(rings_array, Append To Array, Last Created Entity);
  • Global.ring_color_string = Custom String("Lime Green");
  • }
  • }
  • rule("rainbow")
  • {
  • event
  • {
  • Subroutine;
  • rainbow;
  • }
  • actions
  • {
  • For Global Variable(iter_1, 0, Global.greenscreen_width, 0.105);
  • If(Global.rainbow_index == 7);
  • Global.rainbow_index = 0;
  • End;
  • Destroy Effect(Global.rings_array_delete[0]);
  • Modify Global Variable(rings_array_delete, Remove From Array By Index, 0);
  • Destroy Effect(Global.rings_array_delete[0]);
  • Modify Global Variable(rings_array_delete, Remove From Array By Index, 0);
  • Global.ring_effect_pos = Global.template_pos + Direction From Angles(Global.rotation, 0) * (Global.greenscreen_width / 2)
  • + Direction From Angles(Global.rotation, 0) * Global.iter_1 * -1;
  • Wait(0.016, Ignore Condition);
  • If(Global.rainbow_index == 0);
  • Call Subroutine(red);
  • Global.ring_color_string = Custom String("Rainbow");
  • Else If(Global.rainbow_index == 1);
  • Call Subroutine(orange);
  • Global.ring_color_string = Custom String("Rainbow");
  • Else If(Global.rainbow_index == 2);
  • Call Subroutine(yellow);
  • Global.ring_color_string = Custom String("Rainbow");
  • Else If(Global.rainbow_index == 3);
  • Call Subroutine(green);
  • Global.ring_color_string = Custom String("Rainbow");
  • Else If(Global.rainbow_index == 4);
  • Call Subroutine(sky_blue);
  • Global.ring_color_string = Custom String("Rainbow");
  • Else If(Global.rainbow_index == 5);
  • Call Subroutine(blue);
  • Global.ring_color_string = Custom String("Rainbow");
  • Else If(Global.rainbow_index == 6);
  • Call Subroutine(purple);
  • Global.ring_color_string = Custom String("Rainbow");
  • End;
  • Global.rainbow_index += 1;
  • Wait(0.016, Ignore Condition);
  • End;
  • }
  • }
  • rule("play coloured pickup effect when screen destroyed")
  • {
  • event
  • {
  • Subroutine;
  • please_give_colour_variables;
  • }
  • actions
  • {
  • If(Global.rings_color == 0);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Green, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Else If(Global.rings_color == 1);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Blue, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Else If(Global.rings_color == 2);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Red, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Else If(Global.rings_color == 3);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Purple, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Else If(Global.rings_color == 4);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Yellow, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Else If(Global.rings_color == 5);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Orange, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Else If(Global.rings_color == 6);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Aqua, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Else If(Global.rings_color == 7);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Turquoise, Global.template_pos + Down * (Global.greenscreen_height / 2),
  • 50);
  • Else If(Global.rings_color == 8);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Sky Blue, Global.template_pos + Down * (Global.greenscreen_height / 2),
  • 50);
  • Else If(Global.rings_color == 9);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Team 2, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Else If(Global.rings_color == 10);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Team 1, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Else If(Global.rings_color == 11);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Lime Green, Global.template_pos + Down * (Global.greenscreen_height / 2),
  • 50);
  • Else If(Global.rings_color == 12);
  • Play Effect(All Players(All Teams), Good Pickup Effect, White, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Else;
  • Play Effect(All Players(All Teams), Good Pickup Effect, Orange, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Wait(0.025, Ignore Condition);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Yellow, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Wait(0.025, Ignore Condition);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Green, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Wait(0.025, Ignore Condition);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Sky Blue, Global.template_pos + Down * (Global.greenscreen_height / 2),
  • 50);
  • Wait(0.025, Ignore Condition);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Blue, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • Wait(0.025, Ignore Condition);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Purple, Global.template_pos + Down * (Global.greenscreen_height / 2), 50);
  • End;
  • }
  • }
  • disabled rule("............................................................................................................Floorbjorn bots")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • }
  • rule("create torb")
  • {
  • event
  • {
  • Subroutine;
  • create_torb_platform;
  • }
  • actions
  • {
  • Destroy All Dummy Bots;
  • "------------------------------"
  • Create Dummy Bot(Hero(Torbjörn), Team 2, 5, Global.template_pos + Vector(10, 10, 10), Vector(0, 0, 0));
  • Global.attach_torb = Last Created Entity;
  • Wait(0.100, Ignore Condition);
  • Disable Movement Collision With Players(Global.attach_torb);
  • Set Status(Global.attach_torb, Null, Rooted, 9999);
  • Set Status(Global.attach_torb, Null, Invincible, 9999);
  • Start Scaling Player(Global.attach_torb, 0.001, True);
  • "-----------------------------"
  • Global.perpendicular_screen_dir = Vector(Z Component Of(Direction From Angles(Global.rotation, 0)), 0, X Component Of(
  • Direction From Angles(Global.rotation, 0)) * -1);
  • For Global Variable(iter_2, 0, 3.500, 0.700);
  • Create Dummy Bot(Hero(Torbjörn), Team 2, -1, Global.template_pos - Direction From Angles(Global.rotation, 0)
  • * 1.425 + Direction From Angles(Global.rotation, 0) * Global.iter_2 + Vector(X Component Of(Global.perpendicular_screen_dir),
  • Global.greenscreen_height / 1.800 * -1, Z Component Of(Global.perpendicular_screen_dir)), Global.perpendicular_screen_dir);
  • Set Gravity(Last Created Entity, Absolute Value(0));
  • Start Scaling Player(Last Created Entity, 0.700, True);
  • disabled Start Holding Button(Last Created Entity, Crouch);
  • Set Status(Last Created Entity, Null, Rooted, 9999);
  • Set Status(Last Created Entity, Null, Invincible, 9999);
  • If(Count Of(Players Within Radius(Global.template_pos, 5, Team Of(Host Player), Off)) >= 1);
  • Set Invisible(Last Created Entity, All);
  • End;
  • Wait(0.016, Ignore Condition);
  • End;
  • Start Rule(torbs_hello, Do Nothing);
  • If(Count Of(Players Within Radius(Global.template_pos, 5, Team Of(Host Player), Off)) >= 1);
  • Set Invisible(Last Created Entity, All);
  • End;
  • disabled Press Button(Last Created Entity, Ability 1);
  • }
  • }
  • rule("impulse loop to keep torbs midair")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == True;
  • }
  • actions
  • {
  • While(True);
  • Apply Impulse(Event Player, Up, 0.001, To World, Cancel Contrary Motion);
  • Wait(0.016, Ignore Condition);
  • End;
  • }
  • }
  • rule("set torbs invisible if within 5m")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Count Of(Players Within Radius(Global.template_pos, 5, Team Of(Event Player), Off)) >= 1;
  • }
  • actions
  • {
  • Set Invisible(Filtered Array(All Players(All Teams), Is Dummy Bot(Current Array Element)), All);
  • }
  • }
  • rule("set torbs visible if not within 5m")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Count Of(Players Within Radius(Global.template_pos, 5, Team Of(Event Player), Off)) == 0;
  • }
  • actions
  • {
  • Set Invisible(Filtered Array(All Players(All Teams), Is Dummy Bot(Current Array Element)), None);
  • }
  • }
  • rule("torbs_hello subroutine")
  • {
  • event
  • {
  • Subroutine;
  • torbs_hello;
  • }
  • actions
  • {
  • Wait(0.300, Ignore Condition);
  • Communicate(Players In Slot(2, Team 2), Hello);
  • Wait(0.800, Ignore Condition);
  • Communicate(Players In Slot(3, Team 2), Hello);
  • Wait(1.500, Ignore Condition);
  • Communicate(Players In Slot(2, Team 2), Thanks);
  • }
  • }
  • rule("torbs_bye subroutine")
  • {
  • event
  • {
  • Subroutine;
  • torbs_bye;
  • }
  • actions
  • {
  • Wait(0.300, Ignore Condition);
  • Communicate(Players In Slot(2, Team 2), Sorry);
  • Wait(1, Ignore Condition);
  • Communicate(Players In Slot(3, Team 2), Sorry);
  • Wait(1.300, Ignore Condition);
  • Communicate(Players In Slot(2, Team 2), Goodbye);
  • }
  • }
  • rule("torbs_you're_welcome subroutine")
  • {
  • event
  • {
  • Subroutine;
  • torbs_youre_welcome;
  • }
  • actions
  • {
  • Wait(0.700, Ignore Condition);
  • Communicate(Players In Slot(2, Team 2), Yes);
  • Wait(0.800, Ignore Condition);
  • Communicate(Players In Slot(3, Team 2), You are Welcome);
  • Wait(1.500, Ignore Condition);
  • Communicate(Players In Slot(2, Team 2), You are Welcome);
  • }
  • }
  • rule("torbs_yep subroutine")
  • {
  • event
  • {
  • Subroutine;
  • torb_yep;
  • }
  • actions
  • {
  • Wait(0.700, Ignore Condition);
  • Communicate(Players In Slot(2, Team 2), Yes);
  • Wait(0.700, Ignore Condition);
  • Communicate(Players In Slot(3, Team 2), No);
  • Wait(1.200, Ignore Condition);
  • Communicate(Players In Slot(2, Team 2), Sorry);
  • }
  • }
  • rule("green screen replies to your communications")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Is In View Angle(Event Player, Global.template_pos, 120) == True;
  • Is Communicating Any(Event Player) == True;
  • }
  • actions
  • {
  • If(Is Communicating(Event Player, Hello));
  • Call Subroutine(torbs_hello);
  • Else If(Is Communicating(Event Player, Thanks));
  • Call Subroutine(torbs_youre_welcome);
  • Else If(Is Communicating(Event Player, Acknowledge) || Is Communicating(Event Player, Yes));
  • Call Subroutine(torb_yep);
  • End;
  • }
  • }
  • disabled rule("...........................................................................................................Freecam Mode")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • }
  • rule("start freecam")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Global.placing_screen_mode == False;
  • Global.freecam_mode == False;
  • Event Player.CurrActionID == Custom String("startcamera");
  • }
  • actions
  • {
  • Event Player.IsInMenuMode = False;
  • Teleport(Players In Slot(5, Team 2), Position Of(Event Player));
  • disabled Set Status(Event Player, Null, Rooted, 9999);
  • Wait(0.300, Ignore Condition);
  • Attach Players(Event Player, Players In Slot(5, Team 2), Vector(0, 0, 0));
  • disabled Start Forcing Player Position(Event Player, Position Of(Event Player), False);
  • Global.freecam_position = Eye Position(Event Player);
  • Global.freecam_horizontal_initial = Horizontal Angle From Direction(Facing Direction Of(Event Player));
  • Global.freecam_vertical_initial = Vertical Angle From Direction(Facing Direction Of(Event Player));
  • Global.freecam_horizontal_delta = 0;
  • Global.freecam_vertical_delta = 0;
  • Global.freecam_horizontal_current = Horizontal Angle From Direction(Facing Direction Of(Event Player));
  • Global.freecam_vertical_current = Vertical Angle From Direction(Facing Direction Of(Event Player));
  • Set Aim Speed(Event Player, 10);
  • Start Camera(Event Player, Global.freecam_position, Global.freecam_position + Direction From Angles(
  • Global.freecam_horizontal_current, Global.freecam_vertical_current) * 100, 10);
  • "-----------------------"
  • Chase Global Variable Over Time(freecam_position, Eye Position(Event Player) + Facing Direction Of(Event Player) * Vector(2, 0, 2)
  • + Vector(0, 0.500, 0), 1, Destination and Duration);
  • Chase Global Variable Over Time(freecam_horizontal_current, Horizontal Angle From Direction(Direction Towards(
  • Global.freecam_position, Eye Position(Event Player))), 0.800, Destination and Duration);
  • Chase Global Variable Over Time(freecam_vertical_current, Vertical Angle From Direction(Direction Towards(Global.freecam_position,
  • Eye Position(Event Player))), 0.800, Destination and Duration);
  • Wait(1, Ignore Condition);
  • Stop Chasing Global Variable(freecam_position);
  • Stop Chasing Global Variable(freecam_horizontal_current);
  • Stop Chasing Global Variable(freecam_vertical_current);
  • Global.freecam_mode = True;
  • "These 2 rules disable the non-menu HUD. This is optional, I just think it looks cleaner."
  • Disable Hero HUD(Event Player);
  • Disable Game Mode HUD(Event Player);
  • }
  • }
  • rule("stop freecam")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Global.placing_screen_mode == False;
  • Global.freecam_mode == True;
  • Is Button Held(Event Player, Interact) == True;
  • }
  • actions
  • {
  • Detach Players(Event Player);
  • Wait(0.300, Ignore Condition);
  • Stop Camera(Event Player);
  • Stop Forcing Player Position(Event Player);
  • Set Aim Speed(Event Player, 100);
  • Global.freecam_mode = False;
  • Clear Status(Event Player, Rooted);
  • "These 2 rules disable the non-menu HUD. This is optional, I just think it looks cleaner."
  • Enable Hero HUD(Event Player);
  • Enable Game Mode HUD(Event Player);
  • }
  • }
  • rule("freecam movement input")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Global.freecam_mode == True;
  • }
  • actions
  • {
  • While(True);
  • Global.freecam_position += Normalize(Direction From Angles(Global.freecam_horizontal_current, Global.freecam_vertical_current)
  • * Z Component Of(Throttle Of(Event Player)) + Direction From Angles(Global.freecam_horizontal_current + 90, 0)
  • * X Component Of(Throttle Of(Event Player))) * (Throttle Of(Event Player) != Vector(0, 0, 0)) * Global.freecam_move_speed;
  • If(Is Button Held(Event Player, Jump));
  • Global.freecam_position += Up * Global.freecam_move_speed;
  • End;
  • If(Is Button Held(Event Player, Crouch));
  • Global.freecam_position += Down * Global.freecam_move_speed;
  • End;
  • Wait(0.016, Ignore Condition);
  • Abort If Condition Is False;
  • End;
  • }
  • }
  • rule("freecam facing update")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Global.placing_screen_mode == False;
  • Global.freecam_mode == True;
  • }
  • actions
  • {
  • Wait(0.064, Abort When False);
  • Global.freecam_horizontal_delta = 40 * Angle Difference(Global.freecam_horizontal_initial, Horizontal Angle From Direction(
  • Facing Direction Of(Event Player)));
  • Global.freecam_vertical_delta = 40 * Angle Difference(Global.freecam_vertical_initial, Vertical Angle From Direction(
  • Facing Direction Of(Event Player)));
  • Set Facing(Event Player, Direction From Angles(Global.freecam_horizontal_initial, Global.freecam_vertical_initial), To World);
  • Global.freecam_horizontal_current += Global.freecam_horizontal_delta;
  • Global.freecam_vertical_current += Global.freecam_vertical_delta;
  • If(Global.freecam_vertical_current >= 90);
  • Global.freecam_vertical_current = 85;
  • Else If(Global.freecam_vertical_current <= -90);
  • Global.freecam_vertical_current = -85;
  • End;
  • Loop If Condition Is True;
  • }
  • }
  • rule("if emoting in freecam, fix camera")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Is Communicating Any Emote(Event Player) == True;
  • Global.freecam_mode == True;
  • }
  • actions
  • {
  • Stop Camera(Event Player);
  • Global.fixed_viewpoint_emoting = Global.freecam_position + Direction From Angles(Global.freecam_horizontal_current,
  • Global.freecam_vertical_current) * 100;
  • Wait(0.016, Ignore Condition);
  • Global.emoting = True;
  • Start Camera(Event Player, Global.freecam_position, Global.fixed_viewpoint_emoting, 10);
  • }
  • }
  • rule("emoting stopped while in freecam, allow player to adjust again")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Is Communicating Any Emote(Event Player) == False;
  • Global.freecam_mode == True;
  • Global.emoting == True;
  • }
  • actions
  • {
  • Stop Camera(Event Player);
  • Global.emoting = False;
  • Start Camera(Event Player, Global.freecam_position, Global.freecam_position + Direction From Angles(
  • Global.freecam_horizontal_current, Global.freecam_vertical_current) * 100, 10);
  • }
  • }
  • disabled rule(".........................................................................................................Josbird's Cursor Menu")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Create basic HUD elements")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Event Player == Host Player;
  • }
  • actions
  • {
  • "Creates a HUD at the top of the screen, beneath the objective/game mode information, telling them which button opens the menu."
  • disabled Create HUD Text(Filtered Array(All Players(All Teams), !Current Array Element.IsInMenuMode), Custom String(
  • "Press {0} to open menu", Input Binding String(Button(Interact))), Null, Null, Top, 1, Yellow, White, White,
  • Visible To and String, Default Visibility);
  • "Displays server load on the top right of the screen, above the kill feed."
  • Create HUD Text(All Players(All Teams), Server Load Average, Null, String("Server Load Average"), Right, 0, Green, Green, White,
  • Visible To and String, Default Visibility);
  • "Credits (please do not delete!)"
  • Create HUD Text(Filtered Array(All Players(All Teams), Current Array Element.IsInMenuMode), Null, Null, Custom String(
  • "Cursor Menu created by Josbird {0} Code: GETVX", Ability Icon String(Hero(Mercy), Button(Ultimate))), Right, -100, White,
  • White, Aqua, Visible To and String, Default Visibility);
  • }
  • }
  • rule("Menu activated > Start setup")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Event Player == Host Player;
  • "Triggers once whenever the menu opens."
  • Event Player.IsInMenuMode == True;
  • }
  • actions
  • {
  • "Sets aim speed to minimum to reduce camera sway while in menu."
  • Set Aim Speed(Event Player, 10);
  • "These 2 rules disable primary and secondary fire for the purposes of click detection. Though personally I haven't actually thought of a use for secondary fire yet."
  • Set Primary Fire Enabled(Event Player, False);
  • Set Secondary Fire Enabled(Event Player, False);
  • "These 2 rules disable the non-menu HUD. This is optional, I just think it looks cleaner."
  • Disable Hero HUD(Event Player);
  • Disable Game Mode HUD(Event Player);
  • "This (and the following rule) set the menu eye position to follow the player's eye position. Overwrite if you plan to separate the menu from the player's current position."
  • Event Player.MenuEyePos = Eye Position(Event Player);
  • Chase Player Variable At Rate(Event Player, MenuEyePos, Eye Position(Event Player), 100000, Destination and Rate);
  • "Stores original facing direction of player for the purpose of recording mouse movement. Don't recommend changing this."
  • Event Player.MenuOriginalFacing = Facing Direction Of(Event Player);
  • "Sets the forward axis of the menu view (into and out of the screen). Change this to match the facing direction of whatever camera you use if you decouple it from the first person view. (Make sure to normalize if the direction is not a unit vector.)"
  • Event Player.MenuZAxis = Facing Direction Of(Event Player);
  • "Sets vertical axis of menu (up and down the screen)."
  • Event Player.MenuYAxis = Direction From Angles(Horizontal Angle From Direction(Event Player.MenuZAxis),
  • Vertical Angle From Direction(Event Player.MenuZAxis) + -90);
  • "Sets horizontal axis of the menu (left and right on the screen)."
  • Event Player.MenuXAxis = Cross Product(Event Player.MenuZAxis, Event Player.MenuYAxis);
  • "These three rules scale up all 3 axes to 100 meters in order to stabilize the menu in-world texts by placing them far away from the camera view. Keep this in mind if you plan to make your own texts on the screen."
  • Event Player.MenuXAxis *= 100;
  • Event Player.MenuYAxis *= 100;
  • Event Player.MenuZAxis *= 100;
  • "This is where the magic happens. The first rule initializes the cursor position and the second moves it around the screen as the player moves their aim by projecting the angle difference onto a flat plane."
  • Event Player.CursorPos = Event Player.MenuEyePos + Event Player.MenuZAxis * 3;
  • Chase Player Variable At Rate(Event Player, CursorPos,
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * -0.750 * Angle Difference(
  • Horizontal Angle From Direction(Event Player.MenuOriginalFacing), Horizontal Angle From Direction(Facing Direction Of(
  • Event Player))) + Event Player.MenuYAxis * -0.750 * Angle Difference(Vertical Angle From Direction(
  • Event Player.MenuOriginalFacing), Vertical Angle From Direction(Facing Direction Of(Event Player))), 100000,
  • Destination and Rate);
  • "The next four rules provide a simpler way to track the position of the cursor relative to the screen. Use these instead of CursorPos to compare the cursor position to coordinates of onscreen elements."
  • Event Player.CursorX = 0;
  • Event Player.CursorY = 0;
  • Chase Player Variable At Rate(Event Player, CursorX, -0.750 * Angle Difference(Horizontal Angle From Direction(
  • Event Player.MenuOriginalFacing), Horizontal Angle From Direction(Facing Direction Of(Event Player))), 100000,
  • Destination and Rate);
  • Chase Player Variable At Rate(Event Player, CursorY, -0.750 * Angle Difference(Vertical Angle From Direction(
  • Event Player.MenuOriginalFacing), Vertical Angle From Direction(Facing Direction Of(Event Player))), 100000,
  • Destination and Rate);
  • "This rule initializes the array that stores all components of the menu in order to destroy them when it closes. Don't recommend changing this."
  • Event Player.MenuVFX = Empty Array;
  • "These subroutines do the actual work of constructing the menu. See subroutines for more details."
  • Call Subroutine(CreateMenuFrame);
  • Call Subroutine(CreateMenuButtons);
  • Call Subroutine(CreateMenuCursor);
  • }
  • }
  • rule("Menu activated > Create frame")
  • {
  • event
  • {
  • Subroutine;
  • CreateMenuFrame;
  • }
  • actions
  • {
  • "This rule constructs the 10 elements that make up the frame of the menu. If you want to resize the menu, change the position and contents of these texts to what you want. Don't make it any larger as current size is optimized to be onscreen at min FoV."
  • Abort If(False);
  • "The following 8 rules create the corner pieces of the menu frame."
  • Create In-World Text(Event Player, Custom String("┌"), World Vector Of(Local Vector Of(
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * -2.500 + Event Player.MenuYAxis * 1.050,
  • Event Player, Rotation And Translation), Event Player, Rotation And Translation), 4, Do Not Clip, Visible To and Position,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Event Player, Custom String("┐"), World Vector Of(Local Vector Of(
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * 2.500 + Event Player.MenuYAxis * 1.050,
  • Event Player, Rotation And Translation), Event Player, Rotation And Translation), 4, Do Not Clip, Visible To and Position,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Event Player, Custom String("└"), World Vector Of(Local Vector Of(
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * -2.500 + Event Player.MenuYAxis * -1.450,
  • Event Player, Rotation And Translation), Event Player, Rotation And Translation), 4, Do Not Clip, Visible To and Position,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Event Player, Custom String("┘"), World Vector Of(Local Vector Of(
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * 2.500 + Event Player.MenuYAxis * -1.450,
  • Event Player, Rotation And Translation), Event Player, Rotation And Translation), 4, Do Not Clip, Visible To and Position,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • "The following 8 rules create the edge pieces of the menu frame. Recommend removing these first if you are running low on in-world text budget."
  • Create In-World Text(Event Player, Custom String("━━━━━━━━━━━━━━━━"), World Vector Of(Local Vector Of(
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * 0 + Event Player.MenuYAxis * 1.050,
  • Event Player, Rotation And Translation), Event Player, Rotation And Translation), 4, Do Not Clip, Visible To and Position,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Event Player, Custom String("━━━━━━━━━━━━━━━━"), World Vector Of(Local Vector Of(
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * 0 + Event Player.MenuYAxis * -1.450,
  • Event Player, Rotation And Translation), Event Player, Rotation And Translation), 4, Do Not Clip, Visible To and Position,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Event Player, Custom String("┃\r\n┃\r\n┃\r\n┃\r\n┃\r\n┃\r\n┃"), World Vector Of(Local Vector Of(
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * -2.500 + Event Player.MenuYAxis * -0.700,
  • Event Player, Rotation And Translation), Event Player, Rotation And Translation), 4, Do Not Clip, Visible To and Position,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Event Player, Custom String("┃\r\n┃\r\n┃\r\n┃\r\n┃\r\n┃\r\n┃"), World Vector Of(Local Vector Of(
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * 2.500 + Event Player.MenuYAxis * -0.700,
  • Event Player, Rotation And Translation), Event Player, Rotation And Translation), 4, Do Not Clip, Visible To and Position,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • "This creates a button to close the menu using a simplified version of the default button schema detailed on workshop.codes: [button text, action ID, x position, y position, click radius]."
  • Event Player.ButtonExitMenu = Array(Custom String("X"), Custom String("placescreen"), 2.350, 1.100, 0.100);
  • "Creates the inactive text of the exit button. Becomes invisible when the cursor hovers over the button."
  • Create In-World Text(Filtered Array(Event Player, Event Player.IsInMenuMode && Distance Between(Event Player.CursorPos,
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonExitMenu[2] + Event Player.MenuYAxis * Event Player.ButtonExitMenu[3])
  • > 100 * Event Player.ButtonExitMenu[4]), Event Player.ButtonExitMenu[0],
  • Event Player.MenuEyePos + Event Player.MenuYAxis * -0.200 + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonExitMenu[2] + Event Player.MenuYAxis * Event Player.ButtonExitMenu[3],
  • 3, Do Not Clip, Visible To Position and String, Red, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • "Creates the hover text of the exit button. Becomes visible when the cursor hovers over the button."
  • Create In-World Text(Filtered Array(Event Player, Event Player.IsInMenuMode && Distance Between(Event Player.CursorPos,
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonExitMenu[2] + Event Player.MenuYAxis * Event Player.ButtonExitMenu[3])
  • <= 100 * Event Player.ButtonExitMenu[4]), Event Player.ButtonExitMenu[0],
  • Event Player.MenuEyePos + Event Player.MenuYAxis * -0.200 + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonExitMenu[2] + Event Player.MenuYAxis * Event Player.ButtonExitMenu[3],
  • 3, Do Not Clip, Visible To Position and String, Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • }
  • }
  • rule("Menu activated > Create Buttons")
  • {
  • event
  • {
  • Subroutine;
  • CreateMenuButtons;
  • }
  • actions
  • {
  • "This rule creates the actual button visuals when the menu is opened. Until we get color variables, this is where more experienced users can change button colors. In each set, 2nd action = inactive button color, 4th = hovered button color."
  • Wait(0.016, Ignore Condition);
  • " \r\nButtonProperties[0]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 0);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[0][7] && (
  • !Event Player.ButtonProperties[0][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[0][2])
  • > Event Player.ButtonProperties[0][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[0][3])
  • > Event Player.ButtonProperties[0][5] / 2)), Event Player.ButtonProperties[0][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[0][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[0][3] - 0.200), Event Player.ButtonProperties[0][8], Do Not Clip, Visible To Position and String,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[0][7] && Event Player.ButtonProperties[0][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[0][2]) <= Event Player.ButtonProperties[0][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[0][3]) <= Event Player.ButtonProperties[0][5] / 2),
  • Event Player.ButtonProperties[0][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[0][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[0][3] - 0.200), Event Player.ButtonProperties[0][8], Do Not Clip, Visible To Position and String,
  • Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[1]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 1);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[1][7] && (
  • !Event Player.ButtonProperties[1][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[1][2])
  • > Event Player.ButtonProperties[1][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[1][3])
  • > Event Player.ButtonProperties[1][5] / 2)), Global.ring_color_string,
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[1][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[1][3] - 0.200), Event Player.ButtonProperties[1][8], Do Not Clip, Visible To Position and String,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[1][7] && Event Player.ButtonProperties[1][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[1][2]) <= Event Player.ButtonProperties[1][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[1][3]) <= Event Player.ButtonProperties[1][5] / 2),
  • Global.ring_color_string,
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[1][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[1][3] - 0.200), Event Player.ButtonProperties[1][8], Do Not Clip, Visible To Position and String,
  • Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[2]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 2);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[2][7] && (
  • !Event Player.ButtonProperties[2][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[2][2])
  • > Event Player.ButtonProperties[2][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[2][3])
  • > Event Player.ButtonProperties[2][5] / 2)), Event Player.ButtonProperties[2][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[2][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[2][3] - 0.200), Event Player.ButtonProperties[2][8], Do Not Clip, Visible To Position and String,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[2][7] && Event Player.ButtonProperties[2][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[2][2]) <= Event Player.ButtonProperties[2][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[2][3]) <= Event Player.ButtonProperties[2][5] / 2),
  • Event Player.ButtonProperties[2][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[2][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[2][3] - 0.200), Event Player.ButtonProperties[2][8], Do Not Clip, Visible To Position and String,
  • Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[3]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 3);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[3][7] && (
  • !Event Player.ButtonProperties[3][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[3][2])
  • > Event Player.ButtonProperties[3][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[3][3])
  • > Event Player.ButtonProperties[3][5] / 2)), Event Player.ButtonProperties[3][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[3][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[3][3] - 0.200), Event Player.ButtonProperties[3][8], Do Not Clip, Visible To Position and String,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[3][7] && Event Player.ButtonProperties[3][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[3][2]) <= Event Player.ButtonProperties[3][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[3][3]) <= Event Player.ButtonProperties[3][5] / 2),
  • Event Player.ButtonProperties[3][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[3][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[3][3] - 0.200), Event Player.ButtonProperties[3][8], Do Not Clip, Visible To Position and String,
  • Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[4]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 4);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[4][7] && (
  • !Event Player.ButtonProperties[4][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[4][2])
  • > Event Player.ButtonProperties[4][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[4][3])
  • > Event Player.ButtonProperties[4][5] / 2)), Event Player.ButtonProperties[4][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[4][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[4][3] - 0.200), Event Player.ButtonProperties[4][8], Do Not Clip, Visible To Position and String,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[4][7] && Event Player.ButtonProperties[4][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[4][2]) <= Event Player.ButtonProperties[4][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[4][3]) <= Event Player.ButtonProperties[4][5] / 2),
  • Event Player.ButtonProperties[4][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[4][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[4][3] - 0.200), Event Player.ButtonProperties[4][8], Do Not Clip, Visible To Position and String,
  • Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[5]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 5);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[5][7] && (
  • !Event Player.ButtonProperties[5][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[5][2])
  • > Event Player.ButtonProperties[5][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[5][3])
  • > Event Player.ButtonProperties[5][5] / 2)), Global.hero_scale_all,
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[5][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[5][3] - 0.200), Event Player.ButtonProperties[5][8], Do Not Clip, Visible To Position and String,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[5][7] && Event Player.ButtonProperties[5][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[5][2]) <= Event Player.ButtonProperties[5][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[5][3]) <= Event Player.ButtonProperties[5][5] / 2), Global.hero_scale_all,
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[5][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[5][3] - 0.200), Event Player.ButtonProperties[5][8], Do Not Clip, Visible To Position and String,
  • Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[6]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 6);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[6][7] && (
  • !Event Player.ButtonProperties[6][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[6][2])
  • > Event Player.ButtonProperties[6][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[6][3])
  • > Event Player.ButtonProperties[6][5] / 2)), Event Player.ButtonProperties[6][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[6][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[6][3] - 0.200), Event Player.ButtonProperties[6][8], Do Not Clip, Visible To Position and String,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[6][7] && Event Player.ButtonProperties[6][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[6][2]) <= Event Player.ButtonProperties[6][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[6][3]) <= Event Player.ButtonProperties[6][5] / 2),
  • Event Player.ButtonProperties[6][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[6][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[6][3] - 0.200), Event Player.ButtonProperties[6][8], Do Not Clip, Visible To Position and String,
  • Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[7]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 7);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[7][7] && (
  • !Event Player.ButtonProperties[7][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[7][2])
  • > Event Player.ButtonProperties[7][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[7][3])
  • > Event Player.ButtonProperties[7][5] / 2)), Event Player.ButtonProperties[7][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[7][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[7][3] - 0.200), Event Player.ButtonProperties[7][8], Do Not Clip, Visible To Position and String,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[7][7] && Event Player.ButtonProperties[7][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[7][2]) <= Event Player.ButtonProperties[7][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[7][3]) <= Event Player.ButtonProperties[7][5] / 2),
  • Event Player.ButtonProperties[7][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[7][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[7][3] - 0.200), Event Player.ButtonProperties[7][8], Do Not Clip, Visible To Position and String,
  • Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[8]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 8);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[8][7] && (
  • !Event Player.ButtonProperties[8][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[8][2])
  • > Event Player.ButtonProperties[8][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[8][3])
  • > Event Player.ButtonProperties[8][5] / 2)), Event Player.ButtonProperties[8][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[8][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[8][3] - 0.200), Event Player.ButtonProperties[8][8], Do Not Clip, Visible To Position and String,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[8][7] && Event Player.ButtonProperties[8][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[8][2]) <= Event Player.ButtonProperties[8][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[8][3]) <= Event Player.ButtonProperties[8][5] / 2),
  • Event Player.ButtonProperties[8][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[8][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[8][3] - 0.200), Event Player.ButtonProperties[8][8], Do Not Clip, Visible To Position and String,
  • Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[9]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 9);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[9][7] && (
  • !Event Player.ButtonProperties[9][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[9][2])
  • > Event Player.ButtonProperties[9][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[9][3])
  • > Event Player.ButtonProperties[9][5] / 2)), Event Player.ButtonProperties[9][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[9][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[9][3] - 0.200), Event Player.ButtonProperties[9][8], Do Not Clip, Visible To Position and String,
  • White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[9][7] && Event Player.ButtonProperties[9][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[9][2]) <= Event Player.ButtonProperties[9][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[9][3]) <= Event Player.ButtonProperties[9][5] / 2),
  • Event Player.ButtonProperties[9][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[9][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[9][3] - 0.200), Event Player.ButtonProperties[9][8], Do Not Clip, Visible To Position and String,
  • Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[10]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 10);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[10][7] && (
  • !Event Player.ButtonProperties[10][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[10][2])
  • > Event Player.ButtonProperties[10][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[10][3])
  • > Event Player.ButtonProperties[10][5] / 2)), Event Player.ButtonProperties[10][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[10][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[10][3] - 0.200), Event Player.ButtonProperties[10][8], Do Not Clip,
  • Visible To Position and String, White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[10][7] && Event Player.ButtonProperties[10][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[10][2]) <= Event Player.ButtonProperties[10][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[10][3]) <= Event Player.ButtonProperties[10][5] / 2),
  • Event Player.ButtonProperties[10][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[10][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[10][3] - 0.200), Event Player.ButtonProperties[10][8], Do Not Clip,
  • Visible To Position and String, Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[11]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 11);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[11][7] && (
  • !Event Player.ButtonProperties[11][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[11][2])
  • > Event Player.ButtonProperties[11][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[11][3])
  • > Event Player.ButtonProperties[11][5] / 2)), Event Player.ButtonProperties[11][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[11][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[11][3] - 0.200), Event Player.ButtonProperties[11][8], Do Not Clip,
  • Visible To Position and String, White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[11][7] && Event Player.ButtonProperties[11][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[11][2]) <= Event Player.ButtonProperties[11][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[11][3]) <= Event Player.ButtonProperties[11][5] / 2),
  • Event Player.ButtonProperties[11][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[11][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[11][3] - 0.200), Event Player.ButtonProperties[11][8], Do Not Clip,
  • Visible To Position and String, Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[12]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 12);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[12][7] && (
  • !Event Player.ButtonProperties[12][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[12][2])
  • > Event Player.ButtonProperties[12][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[12][3])
  • > Event Player.ButtonProperties[12][5] / 2)), Event Player.ButtonProperties[12][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[12][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[12][3] - 0.200), Event Player.ButtonProperties[12][8], Do Not Clip,
  • Visible To Position and String, White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[12][7] && Event Player.ButtonProperties[12][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[12][2]) <= Event Player.ButtonProperties[12][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[12][3]) <= Event Player.ButtonProperties[12][5] / 2),
  • Event Player.ButtonProperties[12][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[12][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[12][3] - 0.200), Event Player.ButtonProperties[12][8], Do Not Clip,
  • Visible To Position and String, Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[13]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 13);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[13][7] && (
  • !Event Player.ButtonProperties[13][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[13][2])
  • > Event Player.ButtonProperties[13][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[13][3])
  • > Event Player.ButtonProperties[13][5] / 2)), Event Player.ButtonProperties[13][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[13][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[13][3] - 0.200), Event Player.ButtonProperties[13][8], Do Not Clip,
  • Visible To Position and String, Green, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[13][7] && Event Player.ButtonProperties[13][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[13][2]) <= Event Player.ButtonProperties[13][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[13][3]) <= Event Player.ButtonProperties[13][5] / 2),
  • Event Player.ButtonProperties[13][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[13][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[13][3] - 0.200), Event Player.ButtonProperties[13][8], Do Not Clip,
  • Visible To Position and String, Lime Green, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[14]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 14);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[14][7] && (
  • !Event Player.ButtonProperties[14][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[14][2])
  • > Event Player.ButtonProperties[14][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[14][3])
  • > Event Player.ButtonProperties[14][5] / 2)), Event Player.ButtonProperties[14][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[14][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[14][3] - 0.200), Event Player.ButtonProperties[14][8], Do Not Clip,
  • Visible To Position and String, White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[14][7] && Event Player.ButtonProperties[14][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[14][2]) <= Event Player.ButtonProperties[14][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[14][3]) <= Event Player.ButtonProperties[14][5] / 2),
  • Event Player.ButtonProperties[14][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[14][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[14][3] - 0.200), Event Player.ButtonProperties[14][8], Do Not Clip,
  • Visible To Position and String, Yellow, Default Visibility);
  • Visible To Position and String, Red, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • " \r\nButtonProperties[15]"
  • Abort If(Count Of(Event Player.ButtonProperties) <= 15);
  • Create In-World Text(Filtered Array(Event Player, Event Player.ButtonProperties[15][7] && (
  • !Event Player.ButtonProperties[15][6] || Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[15][2])
  • > Event Player.ButtonProperties[15][4] / 2 || Absolute Value(Event Player.CursorY - Event Player.ButtonProperties[15][3])
  • > Event Player.ButtonProperties[15][5] / 2)), Event Player.ButtonProperties[15][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[15][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[15][3] - 0.200), Event Player.ButtonProperties[15][8], Do Not Clip,
  • Visible To Position and String, White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player,
  • Event Player.ButtonProperties[15][7] && Event Player.ButtonProperties[15][6] && Absolute Value(
  • Event Player.CursorX - Event Player.ButtonProperties[15][2]) <= Event Player.ButtonProperties[15][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[15][3]) <= Event Player.ButtonProperties[15][5] / 2),
  • Event Player.ButtonProperties[15][0],
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonProperties[15][2] + Event Player.MenuYAxis * (
  • Event Player.ButtonProperties[15][3] - 0.200), Event Player.ButtonProperties[15][8], Do Not Clip,
  • Visible To Position and String, Yellow, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • }
  • }
  • rule("Menu activated > Create cursor")
  • {
  • event
  • {
  • Subroutine;
  • CreateMenuCursor;
  • }
  • actions
  • {
  • "The next four rules create the actual cursor that the player can move around. For the cursor to render over all other text, it must be the last in-world text to become visible. Thus, we create two identical cursors that alternate visibility every frame."
  • Create In-World Text(Filtered Array(Event Player, Total Time Elapsed % 0.032 > 0.016), Custom String("▲"), World Vector Of(
  • Local Vector Of(Event Player.CursorPos + Event Player.MenuYAxis * -0.200, Event Player, Rotation And Translation),
  • Event Player, Rotation And Translation), 3, Do Not Clip, Visible To and Position, White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • Create In-World Text(Filtered Array(Event Player, Total Time Elapsed % 0.032 < 0.016), Custom String("▲"), World Vector Of(
  • Local Vector Of(Event Player.CursorPos + Event Player.MenuYAxis * -0.200, Event Player, Rotation And Translation),
  • Event Player, Rotation And Translation), 3, Do Not Clip, Visible To and Position, White, Default Visibility);
  • Modify Player Variable(Event Player, MenuVFX, Append To Array, Last Text ID);
  • }
  • }
  • rule("Menu deactivated > Clean up")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Event Player == Host Player;
  • "Triggers once whenever the menu is closed. Technically also triggers when the game starts but that, uh, probably won't cause any problems."
  • Event Player.IsInMenuMode == False;
  • }
  • actions
  • {
  • "Return aim speed to normal."
  • Set Aim Speed(Event Player, 100);
  • "Reenable buttons previously reserved for menu clicking."
  • Set Primary Fire Enabled(Event Player, True);
  • Set Secondary Fire Enabled(Event Player, True);
  • "Reenable the HUD."
  • Enable Game Mode HUD(Event Player);
  • Enable Hero HUD(Event Player);
  • "Loops through all the components of the menu, destroying each one. Note that there is currently no wait in here, so if the array has a lot of elements, the server may be under a lot of stress for a moment. This may be a good place to reduce load if needed."
  • For Player Variable(Event Player, __iter__, 0, Count Of(Event Player.MenuVFX), 1);
  • "Since trying to destroy the wrong type of entity doesn't cause any errors, we simply try each type on the current entity, allowing for any type of effect or icon to be placed in MenuVFX for cleanup when the menu is closed."
  • Destroy In-World Text(Event Player.MenuVFX[Event Player.__iter__]);
  • Destroy Effect(Event Player.MenuVFX[Event Player.__iter__]);
  • Destroy Icon(Event Player.MenuVFX[Event Player.__iter__]);
  • Destroy HUD Text(Event Player.MenuVFX[Event Player.__iter__]);
  • End;
  • }
  • }
  • rule("Force menu exit on emote")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Event Player == Host Player;
  • "I added this in because emoting prevents you from moving your aim, thus making the cursor immovable. Remove at your own peril."
  • Event Player.IsInMenuMode == True;
  • Is Communicating Any Emote(Event Player) == True;
  • }
  • actions
  • {
  • Event Player.IsInMenuMode = False;
  • }
  • }
  • rule("Cursor bounding box")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Event Player == Host Player;
  • Event Player.IsInMenuMode == True;
  • "Checks if the cursor is more than 0.1 screen units outside of the bounding box. If you resize the screen make sure to change this as well."
  • (Absolute Value(Event Player.CursorX) > 2.600 || Absolute Value(Event Player.CursorY) > 1.350) == True;
  • }
  • actions
  • {
  • "Clamps the player's horizontal facing to the range of valid screen space. Screen border values should replace the 2.500s and 1.250s here if you resize the screen."
  • Set Facing(Event Player, Direction From Angles(Min(Max(Horizontal Angle From Direction(Facing Direction Of(Event Player)),
  • Horizontal Angle From Direction(Event Player.MenuOriginalFacing) - 2.500 / 0.750), Horizontal Angle From Direction(
  • Event Player.MenuOriginalFacing) + 2.500 / 0.750), Min(Max(Vertical Angle From Direction(Facing Direction Of(Event Player)),
  • Vertical Angle From Direction(Event Player.MenuOriginalFacing) - 1.250 / 0.750), Vertical Angle From Direction(
  • Event Player.MenuOriginalFacing) + 1.250 / 0.750)), To World);
  • "Double checks every 100ms that the cursor is not still outside the bounds of the menu. This is necessary because if the player moves their aim fast enough, they could overcome the border if they were fast enough."
  • Wait(0.100, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • rule("Detect primary fire button press")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Event Player == Host Player;
  • "Rather than checking for a button click in conditions, we only check for a mouse click so that the player can't press down primary fire then move the cursor onto the button."
  • Event Player.IsInMenuMode == True;
  • Is Button Held(Event Player, Primary Fire) == True;
  • }
  • actions
  • {
  • "Clears the primary action ID queue."
  • Event Player.ActionIDQueue = Empty Array;
  • "Checks if the cursor is currently within radius of the exit button."
  • If(Distance Between(Event Player.CursorPos,
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonExitMenu[2] + Event Player.MenuYAxis * Event Player.ButtonExitMenu[3])
  • <= 100 * Event Player.ButtonExitMenu[4]);
  • "Add the exit button's action ID to the primary action ID queue."
  • Modify Player Variable(Event Player, ActionIDQueue, Append To Array, Event Player.ButtonExitMenu[1]);
  • End;
  • "For each button, checks if the cursor is within that button's click area."
  • For Player Variable(Event Player, __iter__, 0, Count Of(Event Player.ButtonProperties), 1);
  • If(Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[Event Player.__iter__][2])
  • <= Event Player.ButtonProperties[Event Player.__iter__][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[Event Player.__iter__][3])
  • <= Event Player.ButtonProperties[Event Player.__iter__][5] / 2);
  • "If so, add that button's primary action ID to the queue."
  • Modify Player Variable(Event Player, ActionIDQueue, Append To Array, Event Player.ButtonProperties[Event Player.__iter__][1]);
  • End;
  • End;
  • "Set the current action ID variable to the first button clicked for one tick."
  • Event Player.CurrActionID = First Of(Event Player.ActionIDQueue);
  • Wait(0.016, Ignore Condition);
  • Event Player.CurrActionID = Null;
  • }
  • }
  • rule("Detect secondary fire button press")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Dummy Bot(Event Player) == False;
  • Event Player == Host Player;
  • "Rather than checking for a button click in conditions, we only check for a mouse click so that the player can't press down secondary fire then move the cursor onto the button."
  • Event Player.IsInMenuMode == True;
  • Is Button Held(Event Player, Secondary Fire) == True;
  • }
  • actions
  • {
  • "Clears the secondary action ID queue."
  • Event Player.ActionIDQueue_Secondary = Empty Array;
  • "Checks if the cursor is currently within radius of the exit button."
  • If(Distance Between(Event Player.CursorPos,
  • Event Player.MenuEyePos + Event Player.MenuZAxis * 3 + Event Player.MenuXAxis * Event Player.ButtonExitMenu[2] + Event Player.MenuYAxis * Event Player.ButtonExitMenu[3])
  • <= 100 * Event Player.ButtonExitMenu[4]);
  • "Add the exit button's action ID to the secondary action ID queue."
  • Modify Player Variable(Event Player, ActionIDQueue_Secondary, Append To Array, Event Player.ButtonExitMenu[1]);
  • End;
  • "For each button, checks if the cursor is within that button's click area."
  • For Player Variable(Event Player, __iter__, 0, Count Of(Event Player.ButtonProperties), 1);
  • If(Absolute Value(Event Player.CursorX - Event Player.ButtonProperties[Event Player.__iter__][2])
  • <= Event Player.ButtonProperties[Event Player.__iter__][4] / 2 && Absolute Value(
  • Event Player.CursorY - Event Player.ButtonProperties[Event Player.__iter__][3])
  • <= Event Player.ButtonProperties[Event Player.__iter__][5] / 2);
  • "If so, add that button's secondary action ID to the queue."
  • Modify Player Variable(Event Player, ActionIDQueue_Secondary, Append To Array,
  • Event Player.ButtonProperties[Event Player.__iter__][9]);
  • End;
  • End;
  • "Set the current action ID variable to the first button clicked for one tick."
  • Event Player.CurrActionID_Secondary = First Of(Event Player.ActionIDQueue_Secondary);
  • Wait(0.016, Ignore Condition);
  • Event Player.CurrActionID_Secondary = Null;
  • }
  • }
  • rule(">>>EDIT BUTTON & LABEL STARTING VALUES HERE<<<")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • "This rule currently resets all buttons to their initial states any time the menu is opened. If you want button states to persist between menu uses, disable this condition."
  • Event Player.IsInMenuMode == True;
  • }
  • actions
  • {
  • "Empty the button properties array."
  • Event Player.ButtonProperties = Empty Array;
  • "Sample button"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String("Greenscreen Colour"),
  • Custom String("colourchange"), -1.400, 0.500, 1.800, 0.150, True, True, 3, Null, Null, Null)));
  • "Colour button (disabled)"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Global.ring_color_string, Custom String(
  • "dont do ****"), -1.400, 0.200, 0.100, 0.100, False, True, 3, Null, Null, Null)));
  • "Right Arrow"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String("▶"), Custom String(
  • "colourincrease"), -0.650, 0.200, 0.300, 0.150, True, True, 4, Null, Null, Null)));
  • "Left Arrow"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String("◀"), Custom String(
  • "colourdecrease"), -2.125, 0.200, 0.300, 0.150, True, True, 4, Null, Null, Null)));
  • "Sample button"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String("Player Size (tiny/big)"),
  • Custom String("sizeincrease"), -1.400, -0.200, 1.800, 0.150, True, True, 3, Null, Null, Null)));
  • "Colour button (disabled)"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Global.hero_scale_all, False, -1.400, -0.500,
  • 0.100, 0.100, False, True, 3, Null, Null, Null)));
  • "Right Arrow"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String("▶"), Custom String(
  • "sizeincrease"), -0.650, -0.500, 0.300, 0.150, True, True, 4, Null, Null, Null)));
  • "Left Arrow"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String("◀"), Custom String(
  • "sizedecrease"), -2.125, -0.500, 0.300, 0.150, True, True, 4, Null, Null, Null)));
  • "Sample button"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String("Enter Freecam Mode"),
  • Custom String("startcamera"), 1.200, 0.500, 1.800, 0.150, True, True, 3, Null, Null, Null)));
  • "Sample button"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String("Change Hero"), Custom String(
  • "changehero"), 1.200, 0.175, 1.600, 0.150, True, True, 3, Null, Null, Null)));
  • "Sample button"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String("▶"), False, 0.300, 0.200, 0.150,
  • 0.150, False, True, 4, Null, Null, Null)));
  • "Sample button"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String("▶"), False, 0.300, 0.525, 0.150,
  • 0.150, False, True, 4, Null, Null, Null)));
  • "Sample button"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String("Set Greenscreen Location"),
  • Custom String("placescreen"), 0, -0.950, 2.600, 0.150, True, True, 4, Null, Null, Null)));
  • "Sample button"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String(
  • "Andygmb's Greenscreen (code: AND2Y)"), False, 0, 0.825, 4, 0.150, True, True, 4, Null, Null, Null)));
  • "Sample button"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String("End Match"), Custom String(
  • "endmatch"), 1.200, -0.150, 1.600, 0.150, True, True, 3, Null, Null, Null)));
  • "Sample button"
  • Modify Player Variable(Event Player, ButtonProperties, Append To Array, Array(Array(Custom String("▶"), False, 0.300, -0.125,
  • 0.150, 0.150, False, True, 4, Null, Null, Null)));
  • }
  • }
  • rule("Action ID \"endmatch\"")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Event Player.CurrActionID == Custom String("endmatch");
  • }
  • actions
  • {
  • Declare Team Victory(Team 1);
  • }
  • }
  • rule("Action ID \"colourchange\"")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player.CurrActionID == Custom String("colourchange");
  • }
  • actions
  • {
  • Play Effect(Event Player, Buff Impact Sound, White, Eye Position(Event Player), 100);
  • Press Button(Event Player, Reload);
  • }
  • }
  • rule("Action ID \"colourdecrease\"")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player.CurrActionID == Custom String("colourdecrease");
  • Event Player == Host Player;
  • Global.changing_colours == False;
  • Global.placing_screen_mode == False;
  • Count Of(Global.rings_array) == 68;
  • }
  • actions
  • {
  • Play Effect(Event Player, Debuff Impact Sound, White, Eye Position(Event Player), 100);
  • Global.rings_color -= 1;
  • If(Global.rings_color <= -1);
  • Global.rings_color = 13;
  • End;
  • Global.changing_colours = True;
  • }
  • }
  • rule("Action ID \"colourincrease\"")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player.CurrActionID == Custom String("colourincrease");
  • Event Player == Host Player;
  • Global.changing_colours == False;
  • Global.placing_screen_mode == False;
  • Count Of(Global.rings_array) == 68;
  • }
  • actions
  • {
  • Play Effect(Event Player, Buff Impact Sound, White, Eye Position(Event Player), 100);
  • Press Button(Event Player, Reload);
  • }
  • }
  • rule("Action ID \"sizedecrease\"")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player.CurrActionID == Custom String("sizedecrease");
  • Event Player == Host Player;
  • }
  • actions
  • {
  • Play Effect(Event Player, Debuff Impact Sound, White, Eye Position(Event Player), 100);
  • Global.hero_scale_all -= 0.100;
  • }
  • }
  • rule("Action ID \"sizeincrease\"")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Event Player.CurrActionID == Custom String("sizeincrease");
  • }
  • actions
  • {
  • Play Effect(Event Player, Buff Impact Sound, White, Eye Position(Event Player), 100);
  • Global.hero_scale_all += 0.100;
  • }
  • }
  • rule("Interact while screen is placed but not in freecam mode to spawn menu")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Global.placing_screen_mode == False;
  • Global.freecam_mode == False;
  • Event Player.IsInMenuMode == False;
  • Is Button Held(Event Player, Interact) == True;
  • }
  • actions
  • {
  • Event Player.IsInMenuMode = True;
  • }
  • }
  • rule("Action ID \"changehero\"")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Event Player.CurrActionID == Custom String("changehero");
  • }
  • actions
  • {
  • Global.change_hero_pos = Position Of(Event Player);
  • Set Player Allowed Heroes(Event Player, Filtered Array(All Heroes, Current Array Element != Hero Of(Event Player)));
  • Set Player Allowed Heroes(Event Player, All Heroes);
  • }
  • }
  • rule("If you just changed hero, tp back to prev location")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Has Spawned(Event Player) == True;
  • Is Dummy Bot(Event Player) == False;
  • Global.change_hero_pos != Null;
  • }
  • actions
  • {
  • Teleport(Event Player, Global.change_hero_pos);
  • }
  • }
  • rule("Action ID \"exit\"")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Event Player.CurrActionID == Custom String("exit");
  • }
  • actions
  • {
  • Play Effect(Event Player, Debuff Impact Sound, White, Eye Position(Event Player), 100);
  • Event Player.IsInMenuMode = False;
  • }
  • }
  • rule("loop message")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • }
  • actions
  • {
  • If(Global.freecam_mode);
  • Small Message(Event Player, Custom String("Press {0} to exit freecam mode", Input Binding String(Button(Interact))));
  • End;
  • If(Global.placing_screen_mode);
  • Small Message(Event Player, Custom String("Press {0} to place screen", Input Binding String(Button(Primary Fire))));
  • Small Message(Event Player, Custom String("Press {0}/{1} to rotate screen", Input Binding String(Button(Ultimate)),
  • Input Binding String(Button(Ability 2))));
  • End;
  • If(!Global.placing_screen_mode && !Global.freecam_mode && !Event Player.IsInMenuMode);
  • Small Message(Event Player, Custom String("Shortcut: {0} changes colours", Input Binding String(Button(Reload))));
  • Small Message(Event Player, Custom String("Press {0} to open menu", Input Binding String(Button(Interact))));
  • End;
  • Wait(3.500, Ignore Condition);
  • Loop;
  • }
  • }
  • rule("display cursor menu straight away")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player == Host Player;
  • Has Spawned(Event Player) == True;
  • }
  • actions
  • {
  • Global.placing_screen_mode = False;
  • Event Player.IsInMenuMode = True;
  • }
  • }
  • rule("if in setup set match time to 3")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is In Setup == True;
  • }
  • actions
  • {
  • Set Match Time(3);
  • }
  • }
  • rule("if in assembling heroes set time to 3")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Assembling Heroes == True;
  • }
  • actions
  • {
  • Set Match Time(3);
  • }
  • }
  • rule("if game in progress set time to 59mins")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Game In Progress == True;
  • Is In Setup == False;
  • Is Assembling Heroes == False;
  • }
  • actions
  • {
  • Set Match Time(3599);
  • }
  • }
  • rule("match time at 16 mins, reset")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Match Time <= 1000;
  • Is In Setup == False;
  • Is Assembling Heroes == False;
  • Is Game In Progress == True;
  • }
  • actions
  • {
  • Set Match Time(3599);
  • }
  • }
Join the Workshop.codes Discord