Help Needed - Flash Heal Buff

Hi,

i am making a custom game with different buffs (or nerfs) for heroes and I want to add something to Mercy’s flash heal

I would like to make it so that if she uses flash heal on a full health ally it grants them 50 overhealth for 3s or something but i am unsure how to code this in workshop,

Any help will be appreciated, TIA

I don’t have the game to hand so can’t confirm this, but I assume flash heal isn’t triggered by any of the “Is Using Ability” rules or the “Is Reloading” rule.

Off the top of my head the only way of doing it would be seeing if the reload button is pressed while the primary weapon (caduceus staff) is equipped. You will have to then use a wait rule, or chase a variable to make sure it cannot be reactivated before the cooldown is done.

I’m not sure you would go about checking that flash heal was actually used though as obviously it needs a target, also not sure how you determine the target of staff.

You could use a dealt/received healing rule as she doesn’t have any other burst heal - but I don’t think this would work as it might not trigger because of them being full health? Again not sure as I don’t have the workshop to hand right now.

I’ll give it a try if I remember next time I’m playing and try to give you something you can just import directly.

The workshop needs a complete overhaul to expose more data and options. I could go on but I won’t. Of course with the current version available as a legacy option to keep old unmaintained codes at least partially usable.

Edit: that was all about triggering the buff, I never said how to do it which in comparison, is a lot easier. Use the add health pool to player rule, then a wait rule, then remove health pool from player(last created health pool). If you have multiple heroes adding health pools with their buffs assign it to a variable and then remove it through that reference instead.

Sorry I’ve had to just type it out like that, like I said, when I can I’ll try to give you something more readable, and usable.

Thank You so much for your reply, really helpful,

I am terrible at Workshop so all thr help is appreciated! I look forward to any further replies

Expect to here from me again soon! :pachimari_grin:

The hardest bit of the workshop (aside from the bugs) is imagination, so I’m glad you want to delve in and make something fun!

variables
{
	player:
		21: nearbyPlayers
		22: beamDistance
		23: checkPos
		24: mercyBeamTarget
		25: beaming
}

subroutines
{
	1: ResetMercyTarget
	2: GetMercyBeamTarget
}

rule("[sub] Get Mercy Beam target")
{
	event
	{
		Subroutine;
		GetMercyBeamTarget;
	}

	actions
	{
		Event Player.mercyBeamTarget = Null;
		Event Player.nearbyPlayers = Players Within Radius(Position Of(Event Player), 15.500, Team Of(Event Player), Surfaces);
		Event Player.nearbyPlayers = Filtered Array(Event Player.nearbyPlayers, Current Array Element != Event Player);
		Event Player.nearbyPlayers = Sorted Array(Event Player.nearbyPlayers, Angle Between Vectors(Facing Direction Of(Event Player),
			Direction Towards(Eye Position(Event Player), Position Of(Current Array Element) + Vector(0, 1.450, 0))) + Distance Between(
			Position Of(Event Player), Position Of(Current Array Element)) * 0.406);
		Wait(0.032, Ignore Condition);
		For Player Variable(Event Player, I, 0, Count Of(Event Player.nearbyPlayers), 1);
			Event Player.beamDistance = Distance Between(Position Of(Event Player), Position Of(Event Player.nearbyPlayers[Event Player.I]));
			Event Player.checkPos = Eye Position(Event Player) + Facing Direction Of(Event Player) * Event Player.beamDistance;
			For Player Variable(Event Player, J, 1.505, -0.100, -0.150);
				If(Distance Between(Event Player.checkPos, Position Of(Event Player.nearbyPlayers[Event Player.I]) + Vector(0, Event Player.J, 0))
					<= 0.461 + 0.348 * Event Player.beamDistance);
					Event Player.mercyBeamTarget = Event Player.nearbyPlayers[Event Player.I];
					Abort;
				End;
			End;
		End;
	}
}

rule("[sub] Reset Mercy Beam target")
{
	event
	{
		Subroutine;
		ResetMercyTarget;
	}

	actions
	{
		Event Player.mercyBeamTarget = Null;
		Event Player.beaming = False;
	}
}

rule("No longer firing beam - Reset Target")
{
	event
	{
		Ongoing - Each Player;
		All;
		Mercy;
	}

	conditions
	{
		Is Firing Primary(Event Player) == False;
		Is Firing Secondary(Event Player) == False;
	}

	actions
	{
		Call Subroutine(ResetMercyTarget);
	}
}

rule("Beam distance check")
{
	event
	{
		Ongoing - Each Player;
		All;
		Mercy;
	}

	conditions
	{
		Event Player.beaming == True;
		(Is Firing Primary(Event Player) || Is Firing Secondary(Event Player)) == True;
		Is Using Ultimate(Event Player) == False;
	}

	actions
	{
		While(Distance Between(Position Of(Event Player.mercyBeamTarget), Position Of(Event Player)) <= 15.500);
			Wait(0.016, Ignore Condition);
			Wait Until(Distance Between(Event Player.mercyBeamTarget, Event Player) > 15.500 || (Is Firing Primary(Event Player)
				== False && Is Firing Secondary(Event Player) == False), 9999);
			Wait Until(Distance Between(Event Player.mercyBeamTarget, Event Player) <= 15.500 || (Is Firing Primary(Event Player)
				== False && Is Firing Secondary(Event Player) == False), 1.264);
			If((Is Firing Primary(Event Player) || Is Firing Secondary(Event Player)) == False);
				Break;
			End;
		End;
		Call Subroutine(ResetMercyTarget);
	}
}

rule("Using beam")
{
	event
	{
		Ongoing - Each Player;
		All;
		Mercy;
	}

	conditions
	{
		Is Alive(Event Player) == True;
		(Is Firing Primary(Event Player) || Is Firing Secondary(Event Player)) == True;
		Event Player.beaming == False;
		Hero Of(Event Player) == Hero(Mercy);
		Weapon(Event Player) == 1;
	}

	actions
	{
		Call Subroutine(GetMercyBeamTarget);
		If(Distance Between(Event Player.mercyBeamTarget, Event Player) <= 15.500 && Event Player.mercyBeamTarget != Null);
			Event Player.beaming = True;
		End;
		Wait(0.016, Ignore Condition);
		Loop If Condition Is True;
	}
}

rule("Player dealt healing")
{
	event
	{
		Player Dealt Healing;
		All;
		Mercy;
	}

	actions
	{
		Event Player.mercyBeamTarget = Healee;
	}
}

rule("Flash heal bonus health")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Button(Reload)) == True;
		(Ability Charge(Event Player, Button(Reload)) != 0 || Ability Cooldown(Event Player, Button(Reload)) == 0) == True;
		Hero Of(Event Player) == Hero(Mercy);
		Event Player.mercyBeamTarget != Null;
		Normalized Health(Event Player.mercyBeamTarget) == 1;
	}

	actions
	{
		Wait(0.250, Ignore Condition);
		Add Health Pool To Player(Event Player.mercyBeamTarget, Health, 50, False, True);
		Wait(3, Ignore Condition);
		Remove Health Pool From Player(Last Created Health Pool);
	}
}

That should do the trick, just copy and paste it in and as long as you don’t have 21 player variables or any subroutines you should be alright, if you do, just change the numbers in the top few rows. Lots of the hard work for finding the beam target was done year ago by Workshop.Codes user Lotto for their code PTMZ4 ([Beta] Mercy Guardian Angel / Beam targetting) - wish I could link.

Hope it works as you want it to! Any other troubles and here to help!

1 Like

instead of all of that with subroutines and stuff… why not just make a rule that;

  • checks for healing dealt by mercy
  • has conditions where: healer = mercy, button is held (reload) = true, ability cooldown (reload) = 0
  • has actions that: add health pool to player (healee, health, recoverable set to false), variable X = previous added health pool, wait 3s, remove health pool (healee, variable X)

when i’m on my computer ill try to actually do it in the workshop.

I would have done that but the person wanted the buff to apply only at max health, and there’s no way to natively check the beam target in the workshop. I would have done that otherwise, but again, it wouldn’t have triggered at max health.

1 Like

yeah that’s definitely a red zone, the only thing i can think of rn would be a condition that checks the healee’s health to see if the health pool is full, i think the value is 1, but it may not work.

I’ve done that as part of the rule that actually triggers the bonus health to see if flash heal is used, it’s just finding the beam target that takes all the extra effort (that could be done in one rule if any effort was put into adding new stuff to the workshop anymore). The player dealt/received healing rule doesn’t trigger if they’re at full health so that’s a no go.

1 Like

Sorry if my replies are coming off as short - the workshop neglect is really frustrating. Glad to see another user.

2 Likes

OMG this has worked! thank you so much for the help. i am such a noob with workshop that i just discovered this whole subroutine thing, have no clue what they are. But this works thank you!

1 Like

oh trust me, i have barely used the workshop ever since it became official that they were just gonna stop doing anything to it. them taking 2-3 seasons to fix the workshop when OW2 launched was official enough for me.

i’ve been using the workshop since 2020, it’s my most favorite thing about overwatch, and to see it be diminished is so disheartening especially because custom games and workshop are a huge part of the games soul.

just thought of this and will test in a sec, what if the healee health check was a wait until action?

edit: nvm, you cant detect if healing was dealt to a healee if their health is 100%, so your way is most effective. my way would have done it, just only if flash heal was applied to an ally thats like 199/200 or something.

This very specific request runs into multiple edge cases of the workshops limits, super frustrating because I went through almost exactly the same logic as you did - it should just be possible.

I can’t lie, I’ve been using the workshop for years and this is the first time I’ve ever used them.

It’s crazy this happened and then it was exactly the same, except slightly more broken.

Agreed, giving players the power to do anything they want whether it be logic wise, or even further like new UI elements, custom audio and textures, maps and heroes etc. would just add years upon years to the game’s lifespan. Even simpler stuff like spawning PvE units or custom objectives. Not anytime soon though by the looks of it

1 Like

year 6 of begging the devs to add fire rates, weapon spreads, recovery times, cast times, ALLOWING DECIMALS IN THE LITERAL HERO SETTINGS…

Considering almost every hero functions correctly with attack speed in stadium, the absence of a modify attack fire rate rule is just a sign of neglect to the workshop. I would assume the work done to make heroes more modifiable for Stadium would have spilt over into the workshop by now. In a perfect world every single value for a hero could be exposed and modified, as in everything.

1 Like