Concept: turret gun in a capital ship. When in the ship, right-clicking in any direction will cause a laser to fire in that direction.
Trigger:
There are 3 conditions, the third of which should stop the trigger from firing when the bear is summoned, but it's not.
1. Unit-type comparison. The summon bear ability and the right-click will both meet this condition.
2. cooldownTurret = false. This is a timer so you can only cast 5 times a second. It should work for both the summon bear ability and the right-click.
3. Issued order = move or smart. This is the condition that should rule out the summon bear ability! The order to summon a bear is: summongrizzly, but for some reason this trigger is still firing! The bear summoned ability is changed so that there is no summoned bear (number of summoned units = zero), so it's not the case that a bear is being summoned and ordered to move... The issued order, according to the first action, is "smart".
Is there another condition I could put in to distinguish the summon bear ability from the right-click?
Does anyone have any idea why this is happening.
p.s. This trigger also fires when I cast an ability based on Item Mana Regain, but not when I cast mirror image or divine shield.
Trigger:
-
Command Ship Turret
-
Events
-
Unit - A unit Is issued an order targeting a point
-
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Command Ship Gunner
-
cooldownTurret[(Player number of (Owner of (Triggering unit)))] Equal to False
-
((Issued order) Equal to (Order(move))) or ((Issued order) Equal to (Order(smart)))
-
-
Actions
-
Game - Display to (All players) the text: (String((Issued order)))
-
Set tempUnit = (Triggering unit)
-
Set tempInteger = (Player number of (Owner of tempUnit))
-
-------- - --------
-
-------- ----fire --------
-
-------- - --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Mana of tempUnit) Greater than or equal to 3.00
-
-
Then - Actions
-
Set tempPoint = (Target point of issued order)
-
Set x = (X of tempPoint)
-
Set y = (Y of tempPoint)
-
Custom script: call RemoveLocation (udg_tempPoint)
-
Custom script: set udg_CreateX = GetUnitX(udg_RepublicCommandShip)
-
Custom script: set udg_CreateY = GetUnitY(udg_RepublicCommandShip)
-
Custom script: call MoveLocation(udg_LocationMove1, udg_CreateX, udg_CreateY)
-
Custom script: call MoveLocation(udg_LocationMove2, udg_x, udg_y)
-
Unit - Set mana of tempUnit to ((Mana of tempUnit) - 3.00)
-
Set CreationShipType = Laser Red
-
Set CreationPlayerOwner = (Owner of tempUnit)
-
Set CreationUnitOwner = tempUnit
-
Set CreationAngle = (Angle from LocationMove1 to LocationMove2)
-
Trigger - Run Create Laser Cannon <gen> (ignoring conditions)
-
Set cooldownTurret[tempInteger] = True
-
Wait 0.20 game-time seconds
-
Set cooldownTurret[(Player number of (Owner of (Triggering unit)))] = False
-
-
Else - Actions
-
Game - Display to PlayerGroup[tempInteger] the text: |c00ffff66No energy...
-
-
-
-
There are 3 conditions, the third of which should stop the trigger from firing when the bear is summoned, but it's not.
1. Unit-type comparison. The summon bear ability and the right-click will both meet this condition.
2. cooldownTurret = false. This is a timer so you can only cast 5 times a second. It should work for both the summon bear ability and the right-click.
3. Issued order = move or smart. This is the condition that should rule out the summon bear ability! The order to summon a bear is: summongrizzly, but for some reason this trigger is still firing! The bear summoned ability is changed so that there is no summoned bear (number of summoned units = zero), so it's not the case that a bear is being summoned and ordered to move... The issued order, according to the first action, is "smart".
Is there another condition I could put in to distinguish the summon bear ability from the right-click?
Does anyone have any idea why this is happening.
p.s. This trigger also fires when I cast an ability based on Item Mana Regain, but not when I cast mirror image or divine shield.