Issue with mercys ult

code:9766P so i have 2 issues with it, i created a mass resurrect mode (i did paste some parts from another persons code to make it more accurate) and whenever i try to create its limitations a certain way, i have trouble with it unless i seperate both into seperate rules, like this,

buggy one,
limitations
ongoing-event player
all
mercy
conditions
is using ultimate == true
actions
disallow primary, secondary, jump
wait until, not, using ultimate, number, 99999
allow primary, secondary, jump

successfulish one,
limitations
ongoing-event player
all
mercy
conditions
is using ultimate == true
actions
disallow primary, secondary, jump

non limitations
ongoing-each player
all
mercy
conditions
is using ultimate == false
actions
allow primary, secondary, jump
the buggy one makes it so when she uses her ult it disables her primary and secondary, the successfulish one doesn’t do that.



the 2nd issue is when you use mercys ult, and switch to a different hero, that hero is unable to press their ult key to activate it, thus making it unable to be used.

Couldn’t you just make a new rule like below? Not sure

if hero of (event player) != Mercy 
then allow button(Ultimate)

Also, I don’t think using “is using ultimate” is a good idea, it make things needlessly complicated; I would recomend using “ultimate charge percent = 100%” and “is button held(Ultimate==True)”

And coding tip in general, use variable names and add comment, instead of using Mercy_ and different number of dashes after Mercy to make variables, just name them like “Mercy_Health” or “Mercy_teammates_in_range” make reading it when you come back to it after a while WAY easier

As to why the first one doesn’t work, I have no idea!

1 Like

All I found about mass rez is that it had a Range of 15m, couldn’t find specification on whether the height distance between the Player’s matters or not.

Code
variables
{
	player:
		0: Environment_Death
}

rule("Player Died to Enviroment")
{
	event
	{
		Player Died;
		All;
		All;
	}

	conditions
	{
		Event Was Environment == True;
	}

	actions
	{
		Event Player.Environment_Death = True;
		Wait Until(Is Alive(Event Player), 99999);
		Event Player.Environment_Death = False;
	}
}

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

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

	actions
	{
		Disallow Button(Event Player, Button(Ultimate));
		Wait Until(Hero Of(Event Player) != Hero(Mercy), 99999);
		Allow Button(Event Player, Button(Ultimate));
	}
}

rule("Mass Rez")
{
	event
	{
		Ongoing - Each Player;
		All;
		Mercy;
	}

	conditions
	{
		Ultimate Charge Percent(Event Player) == 100;
		Is Button Held(Event Player, Button(Ultimate)) == True;
		Is Alive(Event Player) == True;
	}

	actions
	{
		Resurrect(Filtered Array(All Dead Players(Team Of(Event Player)), Distance Between(Event Player, Current Array Element)
			<= 15 && !Current Array Element.Environment_Death));
	}}
^ Is considering the distance between the players, including height.
And Mercy has no Ult voice line / there are no resurrection effects on the players being revived because... Workshop.

Aaaaaaand Players aren’t locked in place after being revived because I was lazy.

i was just curious onto why a hero couldn’t use their ultimate when you used mercys ultimate and you switched off her

Same problem as with, something disallowed the key and you never allowed it again after switching the Hero.

Disallow Button(Event Player, Button(Ultimate));

Works until the Player leaves, that’s why

Allow Button(Event Player, Button(Ultimate));

exists.

1 Like

The issue with the Wait Until action is when you have the event check for the hero like this:

rule("the wrong way")
{
	event
	{
		Ongoing - Each Player;
		All;
		Mercy;
	}
}

The rule only applies to those people who are on Mercy. So when you switch off of Mercy, the rule stops applying to that player, meaning the rule just suddenly cuts off. This results in everything after the Wait Until action to no longer execute.

When using the Wait Until action, it’s better to do it like this:

rule("the right way")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

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

So that the rule always sticks on the player even when they switch heroes. The only issue with this is that it checks through all the players, not just those on Mercy, which can be a minor server load issue. Not a big deal until you have a huuge game mode.

1 Like

Genji_kuAnd kfw kessr