A good question. I experimented with autocasts a while ago, and unfortunately, there doesn't seem to be that much control over the autocast in data at all (unless something changed with some patch)
You can only set the autocast state for an ability via trigger (by issuing an order), but you cannot even check the current state. You can check for the state the autocast has by default via catalog (or define it from start, since you know, how you set it up), and you can track all orders changing the autocast state. For this, you would need a trigger tracking the orders given to the unit. The order to change the autocast state will actually use the same id and command index as executing the ability itself, the difference would be, that there are additional flags set for the order, which you can check in the trigger.
It might be helpful to save the current auto-cast state within the unit after each change, for example by using the unit's custom value.
There might be some dirty data workarounds (changing the owner comes to mind, that should reset the autocast state, if the ability is flagged for it, maybe disabling the ability could help as well) or some fields I have missed, I don't know. I personally would use triggers.
Here is the problem.
I have 2 auto-cast ability, I need it such that when I turn Ability A auto-cast on, it automatically turn off Ability B's auto-cast, and vise versa.
Ideas?
Any help is appreciated.
A good question. I experimented with autocasts a while ago, and unfortunately, there doesn't seem to be that much control over the autocast in data at all (unless something changed with some patch)
You can only set the autocast state for an ability via trigger (by issuing an order), but you cannot even check the current state. You can check for the state the autocast has by default via catalog (or define it from start, since you know, how you set it up), and you can track all orders changing the autocast state. For this, you would need a trigger tracking the orders given to the unit. The order to change the autocast state will actually use the same id and command index as executing the ability itself, the difference would be, that there are additional flags set for the order, which you can check in the trigger.
It might be helpful to save the current auto-cast state within the unit after each change, for example by using the unit's custom value.
There might be some dirty data workarounds (changing the owner comes to mind, that should reset the autocast state, if the ability is flagged for it, maybe disabling the ability could help as well) or some fields I have missed, I don't know. I personally would use triggers.
@Kueken531: Go
It's too bad you cannot validate the AutoCast state, because it would be rather quite easy with just Data. :\