Bolt Misfire?

Mmage

New Member
Reaction score
7
Hello, I am trying to make a skill for my hero, it works right, the first time its used, it works fine. 2nd time, only shoots 2 bolts. Everytime after that it only shoots one bolt. Can anyone tell me why its not working?
Code:
Element Bolt Fire
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Element Bolt 
        (Unit-type of (Casting unit)) Equal to Mountain King
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Element Bolt  for (Casting unit)) Equal to 1
            Then - Actions
                Unit - Create 1 Dummy Caster 2 (Ground) for (Owner of (Casting unit)) at (Position of (Casting unit)) facing (Facing of (Casting unit)) degrees
                Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
                Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                Unit - Create 1 Dummy Caster 2 (Ground) for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 150.00 towards 90.00 degrees) facing (Facing of (Casting unit)) degrees
                Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
                Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                Unit - Create 1 Dummy Caster 2 (Ground) for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 150.00 towards 270.00 degrees) facing (Facing of (Casting unit)) degrees
                Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
                Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
            Else - Actions
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
"Casting unit" gets lost more often than not after an action that does its own casting...

Either store it in a variable, or use "Triggering unit" instead.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
well is it a channeling ability? otherwise use the event Start the effect of an ability.
also set the points into a variable and then use Custom Script - call RemoveLocation (udg_Your_Variable) to destroy them and to make it lagless like this:
Code:
Melee Initialization
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
    Actions
         Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to (==) Animate Dead
                (Level of (Ability being cast) for (Triggering unit)) Equal to (==) 1
            Then - Actions
                Set Temp_Point[1] = (Position of (Triggering unit))
                Wait 0.01 seconds
                Set Temp_Point[2] = (Temp_Point[1] offset by 150.00 towards 90.00 degrees)
                Set Temp_Point[3] = (Temp_Point[1] offset by 150.00 towards 270.00 degrees)
                Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Temp_Point[1] facing Default building facing (270.0) degrees
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
                Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Temp_Point[2] facing Default building facing (270.0) degrees
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
                Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Temp_Point[3] facing Default building facing (270.0) degrees
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
                Custom script:   call RemoveLocation (udg_Temp_Point[1])
                Custom script:   call RemoveLocation (udg_Temp_Point[2])
                Custom script:   call RemoveLocation (udg_Temp_Point[3])
            Else - Actions
 

Mmage

New Member
Reaction score
7
It took a little while to figure out what was causing the problem in the first place, once the units spawned, they didnt shoot, but Komaqtion's fix worked, thanks for helping.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top