#Remaining cast time: how to compare?

15 messages · Page 1 of 1 (latest)

vague echo
#

Hi there! I'm new to WA development and I searched for YT videos and talked to ChatGPT, yet haven't found a solution for what I want to do.
Let's say there are multiple enemies (E1, E2, ..) with some castable abilities (A1, A2, ..). I want to have an audio notification, when the remaining cast time of any of these abilities becomes lesser then the cast time of my ability X. From my understanding of what ChatGPT tries to tell me, I need to setup a trigger with

Subevent = Spell,
Subevent suffix = Cast start```
then in the `Spell Id` put the id of `E1` spell, then create the same triggers for the rest  `E2, ...` spells, and then in the `Conditions` tab create some function that would 
```1. Calculate the X ability cast time based on my haste
2. Subtract this value from all the active "triggered" abilities from Trigger tab
3. Make a sound when the value is <0```

The issue is that ChatGPT syntax isn't precise and I haven't found any tutorials which cover complex behaviour.
Could you please suggest some WAs which I could use as a reference?
quartz mulch
#

It isn't a syntax issue, it's a issue that chatgpt is just garbage in this.

vague echo
#

So should I just dig through the git repo wiki?

bitter fern
#

Depends on how extensive you want it to be

#

You don't need a combat log trigger, the cast triggers handle actual casts way better

#

So you need one cast trigger for your own cast (unit = player) and one for the enemy casts (probably unit = nameplate, nameplate type hostile if you want it for all enemy casts. Otherwise you can specify a singular unit like target)

#

Then you can either make a TSU that watches these triggers, and do your calculations in there and then create a clone accordingly

#

!tsu

graceful badgeBOT
bitter fern
#

!watched

bitter fern
#

Or you have the enemy cast trigger be the one providing dynamic information, and then do custom condition check, comparing their cast time to yours. It gets evaluated per clone, so per enemy cast in this case

#

When you click the red "help" button in the custom condition checks code window, you get taken to the relevant wiki article. The example provided there is even more or less what you want.

#

The former method allows you more freedom/customizability, but maybe the latter is "easier", idk.

#

I can make an example for you in a couple hours if you need. Won't be at the PC for a while