- Joined
- Nov 25, 2014
- Messages
- 24
I want to be able to detect when a player clicks a button in the gui. For example,
if Some player clicks (button:Chain Lightning)
then... do this... (in addition to whatever the button would normally cause to happen)
or something very similar at least...
How can I do it? Will this require JASS? I feel like this is a novice question, but I've struggled in determining a solution through tinkering or forum scouring!
Edit: Here's the answer. (Assuming we want to detect an ability being pressed, this is similar to an ability being used. A separate trigger will be needed for other GUI.) Use the "channel" ability to have max control over the customization of your ability. To use multiple channel abilities on the same unit, simply change the "Date - Base Order ID" for each one so that the ID is unique per ability. In triggers then put...
if Some player clicks (button:Chain Lightning)
then... do this... (in addition to whatever the button would normally cause to happen)
or something very similar at least...
How can I do it? Will this require JASS? I feel like this is a novice question, but I've struggled in determining a solution through tinkering or forum scouring!
Edit: Here's the answer. (Assuming we want to detect an ability being pressed, this is similar to an ability being used. A separate trigger will be needed for other GUI.) Use the "channel" ability to have max control over the customization of your ability. To use multiple channel abilities on the same unit, simply change the "Date - Base Order ID" for each one so that the ID is unique per ability. In triggers then put...
-
Events
- Unit - A unit Begins channeling an ability
-
Conditions
- (Ability being cast) Equal to [Your Ability]
- (Whatever conditions you want)
-
Actions
- (Whatever actions you want)
- Refer to the unit as "Triggering Unit"
Last edited: