- Joined
- Aug 18, 2009
- Messages
- 21
Hi,
I would like to request assistance regarding the mouse down button. I have an error where the unit i paused does not unpause at the end of the code line when using skills triggered by mouse down button.
After clicking the left mouse button I would order a unit to cast an ability. The ability pauses the unit and plays the attack animation, after 0.35 seconds the damage will be dealt in an area and unpause the triggering unit. I am using Guhun's Timer System for the timing of the damage and unpause.
I tested it multiple times with just the unit casting the ability and it unpauses the unit just fine. But when I use it with conjunction to the mouse down button, the unpause part of the code does not seem to work. I added messages to view when the part of the code is being run and it seems the end was reached.
Thanks
Below is the code I used
I would like to request assistance regarding the mouse down button. I have an error where the unit i paused does not unpause at the end of the code line when using skills triggered by mouse down button.
After clicking the left mouse button I would order a unit to cast an ability. The ability pauses the unit and plays the attack animation, after 0.35 seconds the damage will be dealt in an area and unpause the triggering unit. I am using Guhun's Timer System for the timing of the damage and unpause.
I tested it multiple times with just the unit casting the ability and it unpauses the unit just fine. But when I use it with conjunction to the mouse down button, the unpause part of the code does not seem to work. I added messages to view when the part of the code is being run and it seems the end was reached.
Thanks
Below is the code I used
-
mouse test Copy
-
Events
-
Player - Player 1 (Red) issues Mouse Down event
-
-
Conditions
-
(Trigger Mouse Button) Equal to Left Mouse Button
-
-
Actions
-
Set MouseLoc[(Player number of (Triggering player))] = (Mouse Position for Triggered Mouse Event)
-
Quest - Display to (All players) the Quest Update message: (String((X of MouseLoc[(Player number of (Triggering player))])))
-
-
-
Basic Attack
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Ability being cast) Equal to Berserk
-
-
-
-
Actions
-
Animation - Play (Triggering unit)'s attack animation
-
Set GTS_TimeOut = 0.40
-
Set GTS_Trigger = Basic Attack Timer <gen>
-
Unit - Pause (Triggering unit)
-
Trigger - Run GTS Main <gen> (checking conditions)
-
Set Location[1] = (Position of (Triggering unit))
-
Set SlashUnitArray = (Custom value of (Triggering unit))
-
Set SlashUnit[SlashUnitArray] = (Triggering unit)
-
Animation - Change SlashUnit[SlashUnitArray]'s animation speed to 160.00% of its original speed
-
Unit - Make (Triggering unit) face MouseLoc[(Player number of (Owner of (Triggering unit)))] over 0.00 seconds
-
Unit Group - Add (Triggering unit) to SlashStrikeUnits
-
-
-
Basic Attack Timer
-
Events
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
GTS_ExecutionCounter Equal to 1
-
-
Then - Actions
-
Unit Group - Pick every unit in SlashStrikeUnits and do (Actions)
-
Loop - Actions
-
Set SlashUnitArray = (Custom value of (Picked unit))
-
Set Location[1] = (Position of SlashUnit[SlashUnitArray])
-
Set Location[3] = (Location[1] offset by 200.00 towards (Facing of SlashUnit[SlashUnitArray]) degrees)
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 200.00 of Location[1] matching (((Matching unit) belongs to an enemy of (Owner of SlashUnit[SlashUnitArray])) Equal to True)) and do (Actions)
-
Loop - Actions
-
Set Location[2] = (Position of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is in SlashStrikeUnits) Equal to False
-
((Picked unit) belongs to an enemy of (Owner of SlashUnit[SlashUnitArray])) Equal to True
-
((Picked unit) is alive) Equal to True
-
((Picked unit) is Mechanical) Equal to False
-
(Angle from Location[1] to Location[2]) Greater than or equal to ((Angle from Location[1] to Location[3]) - 90.00)
-
(Angle from Location[1] to Location[2]) Less than or equal to ((Angle from Location[1] to Location[3]) + 90.00)
-
-
Then - Actions
-
Special Effect - Create a special effect at Location[2] using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
-
Special Effect - Destroy (Last created special effect)
-
Set DamageEventType = DamageTypePhysical
-
Unit - Cause SlashUnit[SlashUnitArray] to damage (Picked unit), dealing (0.00 + (1.00 x (Real((Agility of SlashUnit[SlashUnitArray] (Include bonuses)))))) damage of attack type Hero and damage type Normal
-
Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\SkeletalMageMissile\SkeletalMageMissile.mdl
-
Special Effect - Destroy (Last created special effect)
-
Unit Group - Add (Picked unit) to SlashStrikeUnits
-
Custom script: call RemoveLocation(udg_Location[2])
-
-
Else - Actions
-
Special Effect - Create a special effect at Location[2] using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
-
-
-
-
Custom script: call RemoveLocation(udg_Location[1])
-
Custom script: call RemoveLocation(udg_Location[3])
-
Quest - Display to (All players) the Quest Update message: attacked
-
Animation - Change SlashUnit[SlashUnitArray]'s animation speed to 100.00% of its original speed
-
Unit - Unpause SlashUnit[SlashUnitArray]
-
Unit - Order SlashUnit[SlashUnitArray] to Stop
-
Quest - Display to (All players) the Quest Update message: unpause
-
Unit Group - Remove (Picked unit) from SlashStrikeUnits
-
Quest - Display to (All players) the Quest Update message: remove group
-
-
-
-
Else - Actions
-
-
-
Last edited: