Back to home

Darwin's Ana Nade Tool v1.4

EBAXM
click to copy
This game is archived.
If you with to unarchive it, click the "restore" button in the options menu.
This code can also be found at workshop.codes/EBAXM

Thumbnail for Darwin's Ana Nade Tool v1.4

Category:
Training / Drills / Tools

Author:
Darwin

Rating:
151

Version:
1.3.1

Posted:
about 1 year ago

Last updated:
4 months ago

Tags:
tools training ana nade biotic grenade drill reference baptiste ashe torbjorn

Project Links

Share this workshop!

Options

Latest update

First version

This tool shows you predicted position of your nade's point of impact. You can press Interact to toggle camera with "Nade view" to setup super-long-range "Ana nades", you can also write down coordinates/angles of all the cool new nades you have found to reproduce them in the future! Right now i cant predict if the nade will hit an obstacle on its way, so mind that. It also is a bit less accurate for short-range nades because it seems like Ana nade's gravity is different for short-range throws. Im going to update that mode to increase accuracy of predictions, fix inverted vertical control for the camera and perhaps add more features

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

	actions
	{
		Set Player Variable(Event Player, U, 10);
	}
}

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

	conditions
	{
		Is Button Held(Event Player, Ultimate) == True;
	}

	actions
	{
		Set Ultimate Charge(Event Player, 100);
	}
}

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

rule("HUD FOR POSITION AND ANGLES AND RAY")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	actions
	{
		Create HUD Text(Event Player, Position Of(Event Player), Null, Null, Top, 0.050, White, White, White, String, Default Visibility);
		Create HUD Text(Event Player, Multiply(Vertical Facing Angle Of(Event Player), -1), Null, Null, Top, 0.100, Green, White, White,
			String, Default Visibility);
		Create HUD Text(Event Player, Horizontal Facing Angle Of(Event Player), Null, Null, Top, 0.100, Red, White, White, String,
			Default Visibility);
		Create HUD Text(Event Player, String("{0} {1} {2}", String("Wall", Null, Null, Null), String("Warning", Null, Null, Null), String(
			"{0} m", Distance Between(Eye Position(Event Player), Player Variable(Event Player, F)), Null, Null)), Null, Null, Left, 0,
			White, White, White, String, Default Visibility);
	}
}

rule("HUD FLY TIME")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	actions
	{
		Create HUD Text(Event Player, String("{0} {1} {2}", String("Fly", Null, Null, Null), String("Time", Null, Null, Null), String(
			"{0} sec", Player Variable(Event Player, T), Null, Null)), Null, Null, Left, 0, Purple, White, Purple, String,
			Default Visibility);
		Create HUD Text(Event Player, Player Variable(Event Player, R), Null, Null, Right, 0, Purple, White, White, String,
			Default Visibility);
	}
}

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

rule("ZARYA GRAV CONSTANTS")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Hero Of(Event Player) == Hero(Zarya);
	}

	actions
	{
		Set Player Variable(Event Player, S, 25);
		Set Player Variable(Event Player, H, 1.500);
		Set Player Variable(Event Player, G, 10.500);
		Set Player Variable(Event Player, L, 6);
	}
}

rule("ORISA SHIELD CONSTANTS")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Hero Of(Event Player) == Hero(Orisa);
	}

	actions
	{
		Set Player Variable(Event Player, S, 25);
		Set Player Variable(Event Player, H, 1.500);
		Set Player Variable(Event Player, G, 10.500);
		Set Player Variable(Event Player, L, 3);
	}
}

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

	conditions
	{
		Hero Of(Event Player) == Hero(Ana);
	}

	actions
	{
		Set Player Variable(Event Player, S, 30);
		Set Player Variable(Event Player, H, 1);
		Set Player Variable(Event Player, G, 9.806);
		Set Player Variable(Event Player, L, 4);
	}
}

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

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

	actions
	{
		Set Player Variable(Event Player, A, Multiply(Player Variable(Event Player, S), Multiply(-1, Sine From Degrees(
			Vertical Facing Angle Of(Event Player)))));
		Set Player Variable(Event Player, B, Square Root(Multiply(Player Variable(Event Player, A), Player Variable(Event Player, A))));
		Set Player Variable(Event Player, C, Multiply(2, Multiply(Player Variable(Event Player, G), Player Variable(Event Player, H))));
		Set Player Variable(Event Player, T, Divide(Add(Player Variable(Event Player, A), Square Root(Add(Multiply(Player Variable(
			Event Player, A), Player Variable(Event Player, A)), Player Variable(Event Player, C)))), Player Variable(Event Player, G)));
		Set Player Variable(Event Player, O, Multiply(Player Variable(Event Player, S), Cosine From Degrees(Vertical Facing Angle Of(
			Event Player))));
		Set Player Variable(Event Player, R, Multiply(Player Variable(Event Player, O), Player Variable(Event Player, T)));
		disabled Set Player Variable(Event Player, R, Divide(Multiply(Raise To Power(Player Variable(Event Player, S), 2), Sine From Degrees(
			Multiply(Vertical Facing Angle Of(Event Player), -2))), Player Variable(Event Player, G)));
		Set Global Variable(L, Add(Position Of(Event Player), Multiply(Normalize(Multiply(Facing Direction Of(Event Player), Vector(1, 0,
			1))), Player Variable(Event Player, R))));
		Set Global Variable(H, Ray Cast Hit Position(Add(Global Variable(L), Multiply(100, Up)), Global Variable(L), All Players(
			All Teams), Event Player, True));
		Wait(0.016, Ignore Condition);
		Loop;
	}
}

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

rule("LANDING POINT EFFECT")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Using Ability 2(Event Player) == True;
	}

	actions
	{
		Destroy Effect(Player Variable(Event Player, E));
		Destroy Effect(Player Variable(Event Player, F));
		Set Global Variable(P, Global Variable(L));
		Create Effect(All Players(All Teams), Ring, Green, Add(Global Variable(P), Vector(0, 0, 0)), Player Variable(Event Player, L),
			Visible To Position and Radius);
		Set Player Variable(Event Player, E, Last Created Entity);
		Create Effect(All Players(All Teams), Sphere, Green, Add(Player Variable(Event Player, P), Vector(0, 0.500, 0)), 0.200,
			Visible To Position and Radius);
		Set Player Variable(Event Player, F, Last Created Entity);
	}
}

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

	actions
	{
		Create Effect(All Players(All Teams), Sphere, Purple, Add(Global Variable(L), Vector(0, 0.500, 0)), 0.200,
			Visible To Position and Radius);
		Create Effect(All Players(All Teams), Ring, Purple, Add(Global Variable(L), Vector(0, 0, 0)), Player Variable(Event Player, L),
			Visible To Position and Radius);
		Create Effect(All Players(All Teams), Ring, Purple, Add(Global Variable(L), Vector(0, -1.500, 0)), Player Variable(Event Player,
			L), Visible To Position and Radius);
		Create Effect(All Players(All Teams), Ring, Purple, Add(Global Variable(L), Vector(0, 1.500, 0)), Player Variable(Event Player, L),
			Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, Purple, Add(Global Variable(H), Vector(0, 0.500, 0)), 0.200,
			Visible To Position and Radius);
	}
}

rule("RAY CAST COLLISION CHECK")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	actions
	{
		Set Player Variable(Event Player, F, Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), 100)), All Players(All Teams), Event Player, True));
		Wait(0.016, Ignore Condition);
		Loop;
	}
}

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

rule("START cAMERA 1")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Interact) == True;
		Player Variable(Event Player, Z) != True;
		Vertical Facing Angle Of(Event Player) < 0;
	}

	actions
	{
		Wait(0.250, Ignore Condition);
		Set Player Variable(Event Player, Z, True);
		Start Camera(Event Player, Add(Global Variable(L), Add(Multiply(Normalize(Multiply(Facing Direction Of(Event Player), Vector(-1, 0,
			-1))), 10), Multiply(Up, Player Variable(Event Player, U)))), Add(Global Variable(L), Vector(0, 1, 0)), 25);
		Disallow Button(Event Player, Crouch);
		Disallow Button(Event Player, Jump);
	}
}

rule("LEAVE CAMERA 1")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Interact) == True;
		Player Variable(Event Player, Z) == True;
	}

	actions
	{
		Wait(0.250, Ignore Condition);
		Set Player Variable(Event Player, Z, False);
		Stop Camera(Event Player);
		Allow Button(Event Player, Crouch);
		Allow Button(Event Player, Jump);
	}
}

rule("CROUCH TO ZOOMOUT")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Crouch) == True;
	}

	actions
	{
		Modify Player Variable(Event Player, U, Subtract, 0.200);
		Wait(0.016, Ignore Condition);
		Loop If Condition Is True;
	}
}

rule("JUMP TO ZOOMIN")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

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

	actions
	{
		Modify Player Variable(Event Player, U, Add, 0.200);
		Wait(0.016, Ignore Condition);
		Loop If Condition Is True;
	}
}

rule("----------LYM---------COLLISION MARKER--------------")
{
	event
	{
		Ongoing - Global;
	}
}

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

	conditions
	{
		Hero Of(Event Player) == Hero(Ana);
	}

	actions
	{
		Skip If(Or(Compare(Player Variable(Event Player, I), <, 6.500), Player Variable(Event Player, W)), 1);
		Set Player Variable(Event Player, I, 0);
		Set Player Variable(Event Player, J, Add(Add(Position Of(Event Player), Up), Add(Multiply(Facing Direction Of(Event Player),
			Multiply(40, Player Variable(Event Player, I))), Multiply(Multiply(Down, 8.750), Raise To Power(Player Variable(Event Player,
			I), 2)))));
		Set Player Variable(Event Player, K, Add(Add(Position Of(Event Player), Up), Add(Multiply(Facing Direction Of(Event Player),
			Multiply(40, Add(Player Variable(Event Player, I), 0.050))), Multiply(Multiply(Down, 8.750), Raise To Power(Add(
			Player Variable(Event Player, I), 0.050), 2)))));
		Skip If(Is In Line of Sight(Player Variable(Event Player, J), Player Variable(Event Player, K), Barriers Do Not Block LOS), 4);
		Set Player Variable(Event Player, N, Ray Cast Hit Position(Player Variable(Event Player, J), Player Variable(Event Player, K),
			Null, Null, True));
		Set Player Variable(Event Player, D, Player Variable(Event Player, I));
		Skip If(Player Variable(Event Player, W), 1);
		Set Player Variable(Event Player, I, 0);
		Wait(0.016, Ignore Condition);
		Loop;
	}
}

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

	conditions
	{
		Hero Of(Event Player) == Hero(Ana);
	}

	actions
	{
		Chase Player Variable At Rate(Event Player, I, 20, 3, Destination and Rate);
		Create Effect(Filtered Array(All Players(All Teams), Compare(Player Variable(Event Player, N), !=, 0)), Sphere, Red,
			Player Variable(Event Player, N), 0.500, Visible To Position and Radius);
		Create Effect(Filtered Array(All Players(All Teams), Compare(Player Variable(Event Player, P), !=, 0)), Sphere, Green,
			Player Variable(Event Player, P), 0.500, Visible To Position and Radius);
	}
}

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

	conditions
	{
		Is Button Held(Event Player, Ability 2) == True;
		Hero Of(Event Player) == Hero(Ana);
	}

	actions
	{
		Set Player Variable(Event Player, P, Player Variable(Event Player, N));
		Abort If(Not(Player Variable(Event Player, Q)));
		Set Player Variable(Event Player, I, 0);
		Chase Player Variable At Rate(Event Player, I, 6.500, 1, Destination and Rate);
		Start Camera(Event Player, Add(Add(Position Of(Event Player), Up), Add(Multiply(Facing Direction Of(Event Player), Multiply(40,
			Min(Subtract(Player Variable(Event Player, I), 0.250), Subtract(Player Variable(Event Player, D), 0.500)))), Multiply(Multiply(
			Down, 8.750), Raise To Power(Min(Subtract(Player Variable(Event Player, I), 0.250), Subtract(Player Variable(Event Player, D),
			0.500)), 2)))), Player Variable(Event Player, K), 0);
		Set Player Variable(Event Player, W, True);
		Wait(Add(Player Variable(Event Player, D), 1.500), Ignore Condition);
		Stop Camera(Event Player);
		Chase Player Variable At Rate(Event Player, I, 6.500, 3, Destination and Rate);
		Set Player Variable(Event Player, W, False);
		Allow Button(Event Player, Crouch);
		Allow Button(Event Player, Jump);
	}
}

rule("Toggle chase cam")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Ultimate) == True;
		Hero Of(Event Player) == Hero(Ana);
	}

	actions
	{
		Set Player Variable(Event Player, Q, Not(Player Variable(Event Player, Q)));
	}
}

rule("--------------------NEW CONSTANTS---------------------")
{
	event
	{
		Ongoing - Global;
	}
}

rule("ASHE DYNAMITE CONSTANTS")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Hero Of(Event Player) == Hero(Ashe);
	}

	actions
	{
		Set Player Variable(Event Player, S, 27);
		Set Player Variable(Event Player, H, 1.200);
		Set Player Variable(Event Player, G, 9.806);
		Set Player Variable(Event Player, L, 5);
	}
}

rule("BAPTISTE HEALING CONSTANTS")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Hero Of(Event Player) == Hero(Baptiste);
	}

	actions
	{
		Set Player Variable(Event Player, S, 42);
		Set Player Variable(Event Player, H, 1.500);
		Set Player Variable(Event Player, G, 9.806);
		Set Player Variable(Event Player, L, 3);
	}
}

rule("MEI ULT CONSTANTS")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Hero Of(Event Player) == Hero(Mei);
	}

	actions
	{
		Set Player Variable(Event Player, S, 19.500);
		Set Player Variable(Event Player, H, 0);
		Set Player Variable(Event Player, G, 9.806);
		Set Player Variable(Event Player, L, 10);
	}
}

rule("TORB ULT CONSTANTS")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Hero Of(Event Player) == Hero(Torbjörn);
	}

	actions
	{
		Set Player Variable(Event Player, S, 40);
		Set Player Variable(Event Player, H, 0.500);
		Set Player Variable(Event Player, G, 30);
		Set Player Variable(Event Player, L, 2.500);
	}
}

rule("Sombra trans CONSTANTS")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Hero Of(Event Player) == Hero(Sombra);
	}

	actions
	{
		Set Player Variable(Event Player, S, 17);
		Set Player Variable(Event Player, H, 0.500);
		Set Player Variable(Event Player, G, 9.806);
		Set Player Variable(Event Player, L, 2);
	}
}

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

	actions
	{
		Set Player Variable(Event Player, H, Distance Between(Eye Position(Event Player), Ray Cast Hit Position(Eye Position(Event Player),
			Add(Eye Position(Event Player), Vector(0, -3, 0)), All Players(All Teams), Event Player, True)));
		Wait(1, Ignore Condition);
		Loop;
	}
}

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

	conditions
	{
		Hero Of(Event Player) == Hero(Junkrat);
	}

	actions
	{
		Set Player Variable(Event Player, S, 25);
		Set Player Variable(Event Player, H, 0.500);
		Set Player Variable(Event Player, G, 13);
		Set Player Variable(Event Player, L, 2);
	}
}

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

	conditions
	{
		Hero Of(Event Player) == Hero(Sigma);
	}

	actions
	{
		disabled Set Player Variable(Event Player, S, 37);
		disabled Set Player Variable(Event Player, H, 4);
		disabled Set Player Variable(Event Player, G, 18);
		Set Player Variable(Event Player, L, 1.500);
		Set Player Variable(Event Player, S, 18);
		Set Player Variable(Event Player, G, 4.700);
	}
}

disabled rule("Debug TP on Havana")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Ultimate) == True;
	}

	actions
	{
		Teleport(Event Player, Vector(218, 27, -25));
	}
}

Changelog

4 months ago 1.3.1

  • Code updated to avoid expiration

EBAXM
click to copy
10 months ago 1.3.0

  • Improved accuracy for all heroes

498NV
click to copy
12 months ago 1.3.0

  • Improved accuracy for all heroes

NEPYR
click to copy
about 1 year ago 1.3.0

  • Improved accuracy for all heroes

VDESV
click to copy
about 1 year ago 1.2.0

  • Collision marker - shows more precise impact point, but takes more time to calculate
  • Chasing camera - press Q to toggle camera that will follow your nade's path (could be laggy at times)
  • Now supports more heroes projectiles: Ashe's dynamite Mei's ult Baptiste's healing TORBJORN'S ULT

QHQ8E
click to copy
about 1 year ago 1.1.0

  • New cam controls
  • works for Zarya and Orisa now
  • Improved tooltips
  • Stability and bugfixes
  • Lobby settings adjusted

1ZH9V
click to copy
about 1 year ago 1.0.0

This revision contains no notes

VQ077
click to copy