Create
Return to post

Comparing difference between and

View raw
  • settings
  • {
  • main
  • {
  • Description: "|-----------------------------------------------| | Field Of View (FOV) Visualizer | | By Lotto | |-----------------------------------------------| Press [Interact] to toggle between different cameras. Use scope with Widow/Ana/Ashe to see their scoped FOV."
  • }
  • lobby
  • {
  • Max Team 1 Players: 11
  • Max Team 2 Players: 0
  • }
  • modes
  • {
  • Assault
  • {
  • Limit Roles: 2 Of Each Role Per Team
  • enabled maps
  • {
  • Hanamura
  • }
  • }
  • Control
  • {
  • Limit Roles: 2 Of Each Role Per Team
  • enabled maps
  • {
  • }
  • }
  • Escort
  • {
  • Limit Roles: 2 Of Each Role Per Team
  • enabled maps
  • {
  • }
  • }
  • Hybrid
  • {
  • Limit Roles: 2 Of Each Role Per Team
  • enabled maps
  • {
  • }
  • }
  • }
  • extensions
  • {
  • Beam Effects
  • }
  • }
  • variables
  • {
  • global:
  • 2: horizontalFov
  • 3: aspect
  • 4: aspectArray
  • 5: a
  • 6: showEdges
  • player:
  • 1: camState
  • 2: hFov
  • 3: vFov
  • 4: i
  • 5: pos
  • }
  • rule("Initial Global")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • Global.horizontalFov = Workshop Setting Integer(Custom String("FOV Visualizer"), Custom String("FOV (Horizontal)"), 103, 20, 200,
  • 1);
  • Global.aspect = Workshop Setting Combo(Custom String("FOV Visualizer"), Custom String("Aspect Ratio"), 0, Array(Custom String(
  • "16;9"), Custom String("16;10"), Custom String("4;3")), 0);
  • Global.aspectArray = Array(1.778, 1.600, 1.333);
  • Global.a = Global.aspectArray[Global.aspect];
  • Global.showEdges = Workshop Setting Toggle(Custom String("FOV Visualizer"), Custom String("Show edges"), True, 0) == True;
  • Pause Match Time;
  • Create HUD Text(All Players(All Teams), Null, Null, Custom String("Press [{0}] to toggle between different cameras.",
  • Input Binding String(Button(Interact))), Left, 0, Color(White), Color(White), Color(White), Visible To and String,
  • Default Visibility);
  • Create HUD Text(All Players(All Teams), Null, Null, Custom String("Hold [{0}] to change hero.", Input Binding String(Button(
  • Interact))), Left, 1, Color(White), Color(White), Color(White), Visible To and String, Default Visibility);
  • Create HUD Text(All Players(All Teams), Null, Null, Custom String("HFOV: {0} VFOV: {1}", Local Player.hFov, Local Player.vFov),
  • Right, 0, Color(White), Color(White), Color(White), Visible To and String, Default Visibility);
  • Create HUD Text(All Players(All Teams), Null, Null, Custom String("Hold [{0}] and use {1} / {2} to reduce or increase the FOV.",
  • Input Binding String(Button(Reload)), Input Binding String(Button(Primary Fire)), Input Binding String(Button(
  • Secondary Fire))), Right, 0, Color(White), Color(White), Color(White), Visible To and String, Default Visibility);
  • }
  • }
  • rule("FOV visualizer")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Has Spawned(Event Player) == True;
  • }
  • actions
  • {
  • "Made by Lotto"
  • Event Player.hFov = Global.horizontalFov;
  • Event Player.vFov = 2 * Arctangent In Degrees(Tangent From Degrees(Event Player.hFov / 2) / Global.a, 1);
  • Event Player.i = -0.500;
  • While(Event Player.i <= 0.500);
  • Create Beam Effect(All Players(All Teams), Torbjörn Turret Sight Beam, Update Every Frame(Eye Position(Event Player)),
  • Update Every Frame(Eye Position(Event Player) + 100 * (Tangent From Degrees(Evaluate Once(Event Player.i) * Event Player.hFov)
  • * Cross Product(Facing Direction Of(Event Player), Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(
  • Event Player)), Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90)) + Tangent From Degrees(
  • Event Player.vFov * -1 / 2) * Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(Event Player)),
  • Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90) + Facing Direction Of(Event Player))), Color(Team 1),
  • Visible To Position and Radius);
  • Create Beam Effect(All Players(All Teams), Torbjörn Turret Sight Beam, Update Every Frame(Eye Position(Event Player)),
  • Update Every Frame(Eye Position(Event Player) + 100 * (Tangent From Degrees(Evaluate Once(Event Player.i) * Event Player.hFov)
  • * Cross Product(Facing Direction Of(Event Player), Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(
  • Event Player)), Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90)) + Tangent From Degrees(
  • Event Player.vFov / 2) * Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(Event Player)),
  • Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90) + Facing Direction Of(Event Player))), Color(Team 1),
  • Visible To Position and Radius);
  • Create Beam Effect(All Players(All Teams), Torbjörn Turret Sight Beam, Update Every Frame(Eye Position(Event Player)),
  • Update Every Frame(Eye Position(Event Player) + 100 * (Tangent From Degrees(Event Player.hFov * -1 / 2) * Cross Product(
  • Facing Direction Of(Event Player), Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(Event Player)),
  • Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90)) + Tangent From Degrees(Evaluate Once(Event Player.i)
  • * Event Player.vFov) * Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(Event Player)),
  • Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90) + Facing Direction Of(Event Player))), Color(Team 1),
  • Visible To Position and Radius);
  • Create Beam Effect(All Players(All Teams), Torbjörn Turret Sight Beam, Update Every Frame(Eye Position(Event Player)),
  • Update Every Frame(Eye Position(Event Player) + 100 * (Tangent From Degrees(Event Player.hFov / 2) * Cross Product(
  • Facing Direction Of(Event Player), Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(Event Player)),
  • Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90)) + Tangent From Degrees(Evaluate Once(Event Player.i)
  • * Event Player.vFov) * Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(Event Player)),
  • Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90) + Facing Direction Of(Event Player))), Color(Team 1),
  • Visible To Position and Radius);
  • Create Beam Effect(Event Player.camState == 0 ? Remove From Array(All Players(All Teams), Event Player) : All Players(All Teams),
  • Torbjörn Turret Sight Beam, Update Every Frame(Eye Position(Event Player)), Update Every Frame(Eye Position(Event Player)
  • + 100 * (Tangent From Degrees(Evaluate Once(Event Player.i) * Event Player.hFov) * Cross Product(Facing Direction Of(
  • Event Player), Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(Event Player)),
  • Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90)) + Tangent From Degrees(Event Player.vFov * -1 / 2)
  • * Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(
  • Facing Direction Of(Event Player)) - 90) + Facing Direction Of(Event Player))), Color(Team 1), Visible To Position and Radius);
  • Create Beam Effect(Event Player.camState == 0 ? Remove From Array(All Players(All Teams), Event Player) : All Players(All Teams),
  • Torbjörn Turret Sight Beam, Update Every Frame(Eye Position(Event Player)), Update Every Frame(Eye Position(Event Player)
  • + 100 * (Tangent From Degrees(Evaluate Once(Event Player.i) * Event Player.hFov) * Cross Product(Facing Direction Of(
  • Event Player), Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(Event Player)),
  • Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90)) + Tangent From Degrees(Event Player.vFov / 2)
  • * Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(
  • Facing Direction Of(Event Player)) - 90) + Facing Direction Of(Event Player))), Color(Team 1), Visible To Position and Radius);
  • Create Beam Effect(Event Player.camState == 0 ? Remove From Array(All Players(All Teams), Event Player) : All Players(All Teams),
  • Torbjörn Turret Sight Beam, Update Every Frame(Eye Position(Event Player)), Update Every Frame(Eye Position(Event Player)
  • + 100 * (Tangent From Degrees(Event Player.hFov * -1 / 2) * Cross Product(Facing Direction Of(Event Player),
  • Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(
  • Facing Direction Of(Event Player)) - 90)) + Tangent From Degrees(Evaluate Once(Event Player.i) * Event Player.vFov)
  • * Direction From Angles(Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(
  • Facing Direction Of(Event Player)) - 90) + Facing Direction Of(Event Player))), Color(Team 1), Visible To Position and Radius);
  • Create Beam Effect(Event Player.camState == 0 ? Remove From Array(All Players(All Teams), Event Player) : All Players(All Teams),
  • Torbjörn Turret Sight Beam, Update Every Frame(Eye Position(Event Player)), Update Every Frame(Eye Position(Event Player)
  • + 100 * (Tangent From Degrees(Event Player.hFov / 2) * Cross Product(Facing Direction Of(Event Player), Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90)) + Tangent From Degrees(Evaluate Once(Event Player.i) * Event Player.vFov) * Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90) + Facing Direction Of(Event Player))), Color(Team 1), Visible To Position and Radius);
  • Event Player.i = Event Player.i + 0.100;
  • End;
  • If(Global.showEdges == True);
  • Create Beam Effect(All Players(All Teams), Torbjörn Turret Sight Beam, Update Every Frame(Eye Position(Event Player)
  • + Tangent From Degrees(Event Player.hFov / 2) * Cross Product(Facing Direction Of(Event Player), Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90)) + Tangent From Degrees(Event Player.vFov / 2) * Direction From Angles(Horizontal Angle From Direction(
  • Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90)
  • + Facing Direction Of(Event Player)), Update Every Frame(Eye Position(Event Player) + Tangent From Degrees(
  • Event Player.hFov * -1 / 2) * Cross Product(Facing Direction Of(Event Player), Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90)) + Tangent From Degrees(Event Player.vFov / 2) * Direction From Angles(Horizontal Angle From Direction(
  • Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90)
  • + Facing Direction Of(Event Player)), Color(Team 2), Visible To Position and Radius);
  • Create Beam Effect(All Players(All Teams), Torbjörn Turret Sight Beam, Update Every Frame(Eye Position(Event Player)
  • + Tangent From Degrees(Event Player.hFov / 2) * Cross Product(Facing Direction Of(Event Player), Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90)) + Tangent From Degrees(Event Player.vFov / 2) * Direction From Angles(Horizontal Angle From Direction(
  • Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90)
  • + Facing Direction Of(Event Player)), Update Every Frame(Eye Position(Event Player) + Tangent From Degrees(
  • Event Player.hFov / 2) * Cross Product(Facing Direction Of(Event Player), Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90)) + Tangent From Degrees(Event Player.vFov * -1 / 2) * Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90) + Facing Direction Of(Event Player)), Color(Team 2), Visible To Position and Radius);
  • Create Beam Effect(All Players(All Teams), Torbjörn Turret Sight Beam, Update Every Frame(Eye Position(Event Player)
  • + Tangent From Degrees(Event Player.hFov * -1 / 2) * Cross Product(Facing Direction Of(Event Player), Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90)) + Tangent From Degrees(Event Player.vFov * -1 / 2) * Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90) + Facing Direction Of(Event Player)), Update Every Frame(Eye Position(Event Player)
  • + Tangent From Degrees(Event Player.hFov / 2) * Cross Product(Facing Direction Of(Event Player), Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90)) + Tangent From Degrees(Event Player.vFov * -1 / 2) * Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90) + Facing Direction Of(Event Player)), Color(Team 2), Visible To Position and Radius);
  • Create Beam Effect(All Players(All Teams), Torbjörn Turret Sight Beam, Update Every Frame(Eye Position(Event Player)
  • + Tangent From Degrees(Event Player.hFov * -1 / 2) * Cross Product(Facing Direction Of(Event Player), Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90)) + Tangent From Degrees(Event Player.vFov * -1 / 2) * Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90) + Facing Direction Of(Event Player)), Update Every Frame(Eye Position(Event Player)
  • + Tangent From Degrees(Event Player.hFov * -1 / 2) * Cross Product(Facing Direction Of(Event Player), Direction From Angles(
  • Horizontal Angle From Direction(Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(
  • Event Player)) - 90)) + Tangent From Degrees(Event Player.vFov / 2) * Direction From Angles(Horizontal Angle From Direction(
  • Facing Direction Of(Event Player)), Vertical Angle From Direction(Facing Direction Of(Event Player)) - 90)
  • + Facing Direction Of(Event Player)), Color(Team 2), Visible To Position and Radius);
  • End;
  • Disable Game Mode HUD(Event Player);
  • }
  • }
  • rule("Scoped")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Firing Secondary(Event Player) == True;
  • }
  • actions
  • {
  • If(Hero Of(Event Player) == Hero(Widowmaker) || Hero Of(Event Player) == Hero(Ana));
  • Event Player.hFov = 50.939;
  • Event Player.vFov = 2 * Arctangent In Degrees(Tangent From Degrees(Event Player.hFov / 2) / Global.a, 1);
  • Else If(Hero Of(Event Player) == Hero(Ashe));
  • Event Player.hFov = 65.800;
  • Event Player.vFov = 2 * Arctangent In Degrees(Tangent From Degrees(Event Player.hFov / 2) / Global.a, 1);
  • End;
  • Wait Until(Is Firing Secondary(Event Player) == False, 9999);
  • Event Player.hFov = Global.horizontalFov;
  • Event Player.vFov = 2 * Arctangent In Degrees(Tangent From Degrees(Event Player.hFov / 2) / Global.a, 1);
  • }
  • }
  • rule("Toggle camera (Interact)")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Button Held(Event Player, Button(Interact)) == True;
  • }
  • actions
  • {
  • If(Event Player.camState == 0);
  • Start Camera(Event Player, Facing Direction Of(Event Player) * 0.200 + Ray Cast Hit Position(Eye Position(Event Player),
  • Eye Position(Event Player) + World Vector Of(Vector(Empty Array, 1.200, Empty Array), Event Player, Rotation)
  • + Facing Direction Of(Event Player) * Vector(-4, -4, -4), All Players(All Teams), Event Player, True), Eye Position(
  • Event Player) + World Vector Of(Vector(Empty Array, -20, Empty Array), Event Player, Rotation) + Facing Direction Of(
  • Event Player) * 500, 50);
  • Event Player.camState = 1;
  • Else If(Event Player.camState == 1);
  • Start Camera(Event Player, Direction From Angles(Horizontal Facing Angle Of(Event Player) - 90, Vertical Facing Angle Of(
  • Event Player)) * 0.200 + Ray Cast Hit Position(Eye Position(Event Player), Eye Position(Event Player) + World Vector Of(Vector(
  • Empty Array, 2, 6), Event Player, Rotation) + Direction From Angles(Horizontal Facing Angle Of(Event Player) - 90,
  • Vertical Facing Angle Of(Event Player)) * Vector(-10, -10, -10), All Players(All Teams), Event Player, True), Eye Position(
  • Event Player) + World Vector Of(Vector(Empty Array, 2, 6), Event Player, Rotation) + Direction From Angles(
  • Horizontal Facing Angle Of(Event Player) - 90, Vertical Facing Angle Of(Event Player)) * 500, 50);
  • Event Player.camState = 2;
  • Else;
  • Stop Camera(Event Player);
  • Event Player.camState = 0;
  • End;
  • }
  • }
  • rule("Change hero (hold F)")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Button Held(Event Player, Button(Interact)) == True;
  • }
  • actions
  • {
  • Wait(0.800, Abort When False);
  • Event Player.pos = Position Of(Event Player);
  • Stop Camera(Event Player);
  • Event Player.camState = 0;
  • Set Player Allowed Heroes(Event Player, Filtered Array(All Heroes, Hero Of(Event Player) != Current Array Element));
  • Wait(0.250, Ignore Condition);
  • Set Player Allowed Heroes(Event Player, All Heroes);
  • }
  • }
  • rule("Teleport hero back after selecting new hero")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is In Spawn Room(Event Player) == True;
  • Event Player.pos != Null;
  • }
  • actions
  • {
  • Teleport(Event Player, Event Player.pos);
  • Event Player.pos = Null;
  • }
  • }
  • rule("Adjust FOV with Reload + Primary / Secondary")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Button Held(Event Player, Button(Reload)) == True;
  • }
  • actions
  • {
  • Set Primary Fire Enabled(Event Player, False);
  • Set Secondary Fire Enabled(Event Player, False);
  • Wait Until(Is Button Held(Event Player, Button(Primary Fire)) || Is Button Held(Event Player, Button(Secondary Fire))
  • || Is Button Held(Event Player, Button(Reload)) == False, 99999);
  • While(Is Button Held(Event Player, Button(Reload)));
  • If(Is Button Held(Event Player, Button(Primary Fire)));
  • Event Player.hFov -= 1;
  • Event Player.vFov = 2 * Arctangent In Degrees(Tangent From Degrees(Event Player.hFov / 2) / Global.a, 1);
  • Else If(Is Button Held(Event Player, Button(Secondary Fire)));
  • Event Player.hFov += 1;
  • Event Player.vFov = 2 * Arctangent In Degrees(Tangent From Degrees(Event Player.hFov / 2) / Global.a, 1);
  • End;
  • Wait(0.220, Ignore Condition);
  • End;
  • Set Primary Fire Enabled(Event Player, True);
  • Set Secondary Fire Enabled(Event Player, True);
  • }
  • }
Join the Workshop.codes Discord