I'm having issues with a trigger that runs multiple times. Hopefully you can assist me in understanding the issue.
What I'm trying to have happen:
A unit with an inventory picks up multiple copies of the same item. Left clicking the item brings up a list of abilities that can be upgraded. Clicking an ability from the list consumes 1 copy of the item and levels up the relevant ability with 1 level.
What actually happens:
The unit has 3 copies of the item. When clicking an ability from the list it consumes all 3 copies of the item and the ability levels up 3 times instead of once.
The abilities in the list are dummy abilities, so the upgrading and removing of the item is done via a trigger. For unknown reasons this trigger runs multiple times instead of just once....
The trigger that runs multiple times looks like this:
Event:
Unit - A Unit Begins casting an ability
Condition:
(Ability being cast) Equal to "My custom dummy ability"
Actions:
Player - Set the current research level of "Custom Upgrade" to Current research level of "Custom Upgrade" + 1 for Owner of casting unit
Item - Remove Item carried by casting unit of type "My custom level up book"
What I'm trying to have happen:
A unit with an inventory picks up multiple copies of the same item. Left clicking the item brings up a list of abilities that can be upgraded. Clicking an ability from the list consumes 1 copy of the item and levels up the relevant ability with 1 level.
What actually happens:
The unit has 3 copies of the item. When clicking an ability from the list it consumes all 3 copies of the item and the ability levels up 3 times instead of once.
The abilities in the list are dummy abilities, so the upgrading and removing of the item is done via a trigger. For unknown reasons this trigger runs multiple times instead of just once....
The trigger that runs multiple times looks like this:
Event:
Unit - A Unit Begins casting an ability
Condition:
(Ability being cast) Equal to "My custom dummy ability"
Actions:
Player - Set the current research level of "Custom Upgrade" to Current research level of "Custom Upgrade" + 1 for Owner of casting unit
Item - Remove Item carried by casting unit of type "My custom level up book"