I want the condition to check if player switched ROLE of the hero.
ex) Reaper to Winston
How can I put this as a condition?
I want the condition to check if player switched ROLE of the hero.
ex) Reaper to Winston
How can I put this as a condition?
I haven’t tested it yet but isn’t there a way to detect the role?
I don’t think you can. You’ll probably need some variables to check switching role.
So how could that be done? I’m no good with these things…
Here is one way how it could be done, using only one player variable which I named previous_hero in this example (the Small Message action is the one that is run when a player changed role; you could add more actions by increasing the number of actions that are skipped in the preceding Skip If action):
rule("Player Hero Changed"){
event { Ongoing - Each Player; All; All; } conditions { Has Spawned(Event Player) == True; Hero Of(Event Player) != Player Variable(Event Player, previous_hero); } actions { Skip If(And(Compare(Player Variable(Event Player, previous_hero), !=, 0), Compare(Add(Array Contains(All Tank Heroes, Hero Of(Event Player)), Multiply(Array Contains(All Support Heroes, Hero Of(Event Player)), 2)), ==, Add(Array Contains(All Tank Heroes, Player Variable(Event Player, previous_hero)), Multiply(Array Contains(All Support Heroes, Player Variable(Event Player, previous_hero)), 2)))), 1); Small Message(Event Player, Custom String("Role changed", Null, Null, Null)); Set Player Variable(Event Player, previous_hero, Hero Of(Event Player)); }
}
How to implement this rule in an existing script:
Sigh, biased.
Maybe dont cut off the “unfortunately” in the quote XD
Thanks!! it worked!!
I meant the people who didn’t allow it.