Help With An Ability

Jagan

New Member
Reaction score
30
Hi people, I need someone to look at my triggers and tell me what's wrong. It works fine for the first few casts but after a while it stops working. The dummy moves as intended but the damage and slow is not applied. Thanks in advance!

PS. Oh and if there are any leaks, please point me in removing them! :)

Code:
Chakram Throw Init
Events
    Unit - A unit Starts the effect of an ability
Conditions
    (Ability being cast) Equal to Chakram Throw (Soul Hunter)
Actions
    Set ChakramThrowDistance = 0.00
    Set ChakramThrowCaster = (Triggering unit)
    Set ChakramThrowCasterPoint = (Position of ChakramThrowCaster)
    Set ChakramThrowTargetPoint = (Target point of ability being cast)
    Unit - Make ChakramThrowCaster face ChakramThrowTargetPoint over 0.01 seconds
    Unit - Create 1 Dummy Unit (Chakram Throw) for (Owner of ChakramThrowCaster) at ChakramThrowCasterPoint facing ChakramThrowTargetPoint
    Set ChakramThrowDummyUnit = (Last created unit)
    Set ChakramThrowDummyPoint = (Position of ChakramThrowDummyUnit)
    Set ChakramThrowFacingDirection = (Facing of ChakramThrowDummyUnit)
    Trigger - Turn on Chakram Throw Move And Damage <gen>
    Countdown Timer - Start ChakramThrowTimer as a Repeating timer that will expire in 0.04 seconds
    Custom script:   call RemoveLocation (udg_ChakramThrowCasterPoint)

Code:
Chakram Throw Move And Damage
    Events
        Time - ChakramThrowTimer expires
    Conditions
    Actions
        Set ChakramThrowDistance = (ChakramThrowDistance + 36.00)
        Set ChakramThrowDummyPoint = (Position of ChakramThrowDummyUnit)
        Set ChakramThrowOffset = (ChakramThrowDummyPoint offset by 30.00 towards ChakramThrowFacingDirection degrees)
        Set ChakramThrowGroup = (Units within 225.00 of ChakramThrowDummyPoint matching ((((Matching unit) belongs to an enemy of (Owner of ChakramThrowCaster)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Match
        Unit - Move ChakramThrowDummyUnit instantly to ChakramThrowOffset, facing ChakramThrowFacingDirection degrees
        Custom script:   set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in ChakramThrowGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is in ChakramThrowAddUnitGroup) Equal to False
                    Then - Actions
                        Unit Group - Add (Picked unit) to ChakramThrowAddUnitGroup
                        Unit - Cause ChakramThrowCaster to damage (Picked unit), dealing (25.00 + (75.00 x (Real((Level of Chakram Throw (Soul Hunter) for ChakramThrowCaster))))) damage of attack type Spells and damage type Normal
                        Unit - Create 1 Dummy Unit for (Owner of ChakramThrowCaster) at (Position of (Picked unit)) facing Default building facing degrees
                        Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                        Unit - Add Chakram Throw (Maim) to (Last created unit)
                        Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ChakramThrowDistance Greater than (600.00 + (100.00 x (Real((Level of Chakram Throw (Soul Hunter) for ChakramThrowCaster)))))
            Then - Actions
                Countdown Timer - Pause ChakramThrowTimer
                Unit - Add a 0.01 second Generic expiration timer to ChakramThrowDummyUnit
                Set ChakramThrowDistance = 0.00
                Trigger - Turn off (This trigger)
            Else - Actions
        Custom script:   call RemoveLocation (udg_ChakramThrowDummyPoint)
        Custom script:   call RemoveLocation (udg_ChakramThrowOffset)
        Custom script:   call RemoveLocation (udg_ChakramThrowTargetPoint)

EDIT: The map is uploaded HERE
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
Did you try putting a debug message in the Pick Every Unit action to see that it is actually run? If that is the part that doesn't work, I would start there to see what, if anything, is running.
You might also try having it display how many units are in the group before you run that, just to make sure that it actually has some units in it....
 

Jagan

New Member
Reaction score
30
Did you try putting a debug message in the Pick Every Unit action to see that it is actually run? If that is the part that doesn't work, I would start there to see what, if anything, is running.
You might also try having it display how many units are in the group before you run that, just to make sure that it actually has some units in it....

Well it only works for the first few casts. Could it be a leak somewhere? And how exactly do you add debug messages? Could you point me in the right direction?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
Game - Display to All Players the message, or something like that.

Add one in there and see what happens after a few casts.

Failing any enlightenment from that, upload the map.
 

Jagan

New Member
Reaction score
30
It still works only for the first few casts. I'm going to upload the map in my first post. Please check it out for me. Thanks.
 

Expelliarmus

Where to change the sig?
Reaction score
48
Err...bump?
I haven't checked through throughly, but I think it's the unit group problem. It's adding the units in CharkramTrhowAddUnitGroup, which filters the hit unit right? On your next cast, the unit is already in that group... meaning it won't it hit.

EDIT
try adding
Unit Group - Remove all units from ChakramThrowAddUnitGroup
in
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        ChakramThrowDistance Greater than (600.00 + (100.00 x (Real((Level of Chakram Throw (Soul Hunter) for ChakramThrowCaster)))))
    Then - Actions
        Countdown Timer - Pause ChakramThrowTimer
        Unit - Add a 0.01 second Generic expiration timer to ChakramThrowDummyUnit
        Set ChakramThrowDistance = 0.00
        Unit Group - Remove all units from ChakramThrowAddUnitGroup
        Trigger - Turn off (This trigger)
    Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top