Using Arrays with "Players On Hero"

Hello group. Long time no see!

TL;DR: So I’m trying to update some scripts. Even though i thought the Blizzard Dev team abandoned the Workshop, it seems some functions are working now, that weren’t before. So back to tinkering with my game modes.

Here’s my issue:
Im tryint to group several hero’s into an Array to use for a check condition. If I separate each “Players on Hero” by an AND or OR function, it works just fine, but this IMO bloats the function too much. Especially as i add More hero’s to this function.

This works & currently what im using:

{
	(Has Status(Victim, Rooted) && !Is True For Any(Players On Hero(Hero(Zarya), Team Of(Event Player)), Is Using Ultimate(
		Current Array Element)) && !Is True For Any(Players On Hero(Hero(Sigma), Team Of(Event Player)), Is Using Ultimate(
		Event Player))) == True;
}

What im trying to do, and Doesn’t work:

{
	"Test 3"
	(Has Status(Victim, Rooted) && !Is True For Any(Players On Hero(Array(Hero(Zarya), Hero(Sigma)), Team Of(Event Player)),
		Is Using Ultimate(Current Array Element))) == True;
}

It WILL however work, so long as the Array has only 1 element (for example, Only Zarya) However if i add another element to the Array (whether it’s another Hero or simply NULL) it breaks.

As i add More hero’s to the function, the larger the 1st rule gets. So IF there was a way i could lump all the hero’s together, it would just make things simpler.

Here’s a testing script for proof on concept. LMK if you know a better way to go about this:

rule("An Array of Hero's")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		"This works"
		(Is Using Ultimate(Players On Hero(Hero(Zarya), Team Of(Event Player))) || Is Using Ultimate(Players On Hero(Hero(Sigma), Team Of(
			Event Player)))) == True;
		"This Does Not"
		disabled Is True For Any(Players On Hero(Array(Hero(Zarya), Hero(Sigma)), Team Of(Event Player)), Is Using Ultimate(Current Array Element))
			== True;
	}

	actions
	{
		Play Effect(All Players(All Teams), Ring Explosion, Color(Red), Position Of(Event Player), 5);
		Wait(1, Ignore Condition);
		Loop If Condition Is True;
	}
}

Well the idea was to create a trigger for when someone was caught in Junkrat’s trap. & the only way i found reliably to do so, was to have a Player Delt Damage Rule with a condition that checked the status of the victim IF they were Rooted.
However, being caught in Grav, Flux & now CageFight all give the same Status effect. & if Junkrat shoots someone stuck in those Ults, the Conditions will be met. SO, i need a way to filter out those effects. I could very well just ADD Mauga into the already existing Condition i have for Zarya & Sig. But I figured i’d ask IF there was a better way to going about it.

Also, now that i think about it (haven’t tested it yet to confirm) Cassidy’s Flashbang might give that Status effect too. Unlike Rat trap, Grav or Flux where you are frozen in place, CageFight you can still move around, but the Status effect the Workshop gives for that instance is Rooted…so ya…Cree may need to be filtered out too…

No, the Event Ability is only active while he’s throwing it. So while the animation of it bouncing on the ground…once it’s placed (and activated via someone stepping on it) the workshop Event Ability doesn’t trigger & thus no way to detect (via damage only at least) someones stuck in it. So i figured out the Dealt Damage Rule does trigger (cuz rat get’s credit FOR the damage of someone being cought by it) and so long as they have a Status of Rooted at the same time, i was able to create the trigger i needed.
Mauga can Run through trap no problem, the Rooted Status never appears cuz he’s never actually trapped in it. Orisa same thing IF Fortify is active While she walks into it. However, if she uses Fortify to free herself, that’s its own issue, but i solved that already.

Anyways, like i said before. I DO have a working script for doing this…I just figured someone smarter them me knew a better way. Thanks though.

Just to clear things up, Event Ability isn’t the same as Is Using Ability.

Event Ability for Damage Dealt / Took events can be used to filter which Abilties the rule executes with.

Since Junk wasn’t reworked and this already existed in Ow1 it should detect just fine if someone triggers his trap specifically, however due to immunities doesn’t on its own specify whether someone was rooted by it.

Ah ok, i didn’t realize that. Good to know! I learned somethen new today lol.
So, after testing it out, you’re correct. The Event Ability = Ability 2 (within a Player Delt Damage Rule) works just fine…But, that still leaves me with needing a way to Filter out Exceptions. So, now i can remove the IS Rooted check for Dealt Damage via Ability 2. But need to have Conditions for IF Mauga or Orisa is using their Ability 1 (Shift). What would be a good way to go about That, over what I’ve used before (regarding IF they r using Ults)

As always, Thanks Teawy for the help

There are two ways:

  1. Add condition checks in the same rule you want to fetch the Is rooted Status, if Victim is either of these Heroes and using their ability 2s.
  2. Seperate On Going Each Player rule, check if either heroe is using ability to (Mauga or Orisa) and give them a flag variable to be set to true, then in the Detection rule for is rooted you additionally check if any victim has that flag variable not set to true.

Due to the size of my Game, adding Rules JUST to check for IF a specific hero is using an Ability isn’t with in the budget. Im around 99% used up on available “elements” we’re alaudid for these Scripts. I need to trim fat here n there wherever i can.
Thanks though.

Well then take the risk of taking a compromission. The workshop is very limited and not in a good spot nowdays, i would re consider some parts and sort out what is most important, what should remain within my capacities. Dropping unnecessary things might help. Good luck with your project though.