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;
}
}