Why doesn't this work?

variables
{
player:
0: charge
}

rule(“charge”)
{
event
{
Ongoing - Each Player;
Team 1;
Hanzo;
}

conditions
{
	Is Button Held(Event Player, Primary Fire) == True;
}

actions
{
	Event Player.charge = 0;
	While(Is Button Held(Event Player, Primary Fire));
		Wait(0.020, Ignore Condition);
		Event Player.charge = Ability Charge(Event Player, Button(Primary Fire));
	End;
}

}

I don’t know why but nothing happens? Is hanzo’s primary fire not part of the ability charge counter thing? It definitely should, right?

Edit: further testing, I can’t find what the ability charge does track. I change the rule to affect all heroes, and set everything that was primary fire to track secondary fire, and nothing happend for Doomfist, Symmetra, and Zenyatta. Does it have to do with setting it to a variable?

The charge itself is bound to ability 2 (Storm Arrow) at the points or phases of initializing the charge, switch to is in Storm Arrow state and either leaves the state on consuming all charges or cancel it by pressng the ability 2 key again. In Storm Arrow state active you allow Primary Fire when actually fired to consume those charges. Guess you need to use Is firing primary instead of button is held.

Oh, I am trying to track the charge on Hanzo’s regular primary fire, not storm arrows. Is there anyway to do that?

You mean his ammunition or do you wanna create a custom firing counter instead?

Hanzos Primary Fire has no charge system at all its bound to his Storm arrow ability as i explained.

So it would be Ability Charge(Event Player, Button(Ability 2)) while you using ability 2 and firing primary weapon to track the charges.

Well what the end goal is to be able to find where exactly Hanzo’s arrows land, and so I need the charge of the arrow to calculate the arc and speed of the arrow, and they apply that in some way to a ray cast to find where the arrow projectile will land. Then I use the speed of the arrow to time it properly to play the effect exactly when the arrow lands.

Oh then you got misslead or missinformed Ability Charge is referred to the how many times an ability can be used e.g. Symmetra has by default 3 Turrets she can place in the world not the charge of speed, power or casting time :D. Thats not possible you need to find another way of getting the arrows speed for your calculaion, unfortunately we have no access to the projectile stats after all, so its hard to achieve that. Ability Charge in Hanzo’s context are the amount of Storm Arrows he can shoot, while he is in that mentioned state.

I really think it should be renamed to “ability charges” as that more accurately describes what it tracks. Does it also track Tracer’s blinks and Junkrat’s concussion mines?

Yeah it does. And i agree it should be renamed to something else instead of charge.

So you need to define your own charge value for your primary fire shoots unfortunately.