Charge Skill problem

yunusowic

New Member
Reaction score
7
I made this charge skill and it works fine. But when i cast, the hero goes to this certain point in the map. It will not charge to the target but it charges to this point. And stops when it reaches that point. Here is the trigger.

Trigger:
  • Enrage Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Enrage
    • Actions
      • Sound - Play BerserkerCaster <gen> at 100.00% volume, attached to (Triggering unit)
      • Unit - Create 1 Dummy of the Map for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add Enrage Stun to (Last created unit)
      • Unit - Set level of Enrage Stun for (Last created unit) to (Level of Enrage for (Triggering unit))
      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Unit - Turn collision for (Triggering unit) Off
      • Unit - Pause (Triggering unit)
      • Set Real[4] = (100.00 x (Real((Level of Enrage for (Triggering unit)))))
      • Set Target[(Custom value of (Triggering unit))] = (Target unit of ability being cast)
      • Set Unit[(Custom value of (Triggering unit))] = (Triggering unit)
      • Custom script: call SetUnitAnimationByIndex( udg_Unit[GetUnitUserData(GetTriggerUnit())], 5)
      • Trigger - Turn on Enrage Damage <gen>


Trigger:
  • Enrage Damage
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to Etiket, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Unit[(Integer A)] Not equal to No unit
            • Then - Actions
              • Custom script: call RemoveLocation (udg_Point[GetForLoopIndexA()])
              • Custom script: call RemoveLocation (udg_TPoint[GetForLoopIndexA()])
              • Custom script: call RemoveLocation (udg_Move[GetForLoopIndexA()])
              • Set TPoint[(Integer A)] = (Position of Target[(Integer A)])
              • Set Point[(Integer A)] = (Position of Unit[(Integer A)])
              • Set EnrageAngle[(Integer A)] = (Angle from Point[(Integer A)] to TPoint[(Integer A)])
              • Set Move[(Integer A)] = (Point[(Integer A)] offset by 12.00 towards EnrageAngle[(Integer A)] degrees)
              • Destructible - Pick every destructible within 140.00 of (Position of Unit[(Integer A)]) and do (Destructible - Kill (Picked destructible))
              • Custom script: call SetUnitX(udg_Unit[GetForLoopIndexA()], GetLocationX(udg_Move[GetForLoopIndexA()]))
              • Custom script: call SetUnitY(udg_Unit[GetForLoopIndexA()], GetLocationY(udg_Move[GetForLoopIndexA()]))
              • Unit - Make Unit[(Integer A)] face EnrageAngle[(Integer A)] over 0.00 seconds
              • Unit Group - Pick every unit in (Random 1 units from (Units within 140.00 of Point[(Integer A)] matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is in Damaged) Equal to False)) and (((Matching unit) belongs to an enemy of (Owner of Unit[(Integer A)])) Equal to Tru and do (Actions)
                • Loop - Actions
                  • Unit Group - Add (Picked unit) to Damaged
                  • Unit - Cause Unit[(Integer A)] to damage (Picked unit), dealing Real[4] damage of attack type Spells and damage type Normal
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Incinerate\IncinerateBuff.mdl
                  • Special Effect - Destroy (Last created special effect)
              • Destructible - Pick every destructible within 140.00 of (Position of Unit[(Integer A)]) and do (Destructible - Kill (Picked destructible))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between Point[(Integer A)] and TPoint[(Integer A)]) Less than or equal to 150.00
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                  • Custom script: call RemoveLocation (udg_Move[GetForLoopIndexA()])
                  • Custom script: call RemoveLocation (udg_Point[GetForLoopIndexA()])
                  • Custom script: call RemoveLocation (udg_TPoint[GetForLoopIndexA()])
                  • Animation - Reset Unit[(Integer A)]'s animation
                  • Unit - Remove Enrage buff from Unit[(Integer A)]
                  • Unit - Unpause Unit[(Integer A)]
                  • Unit - Turn collision for Unit[(Integer A)] On
                  • Set Unit[(Integer A)] = No unit
                  • Set Target[(Integer A)] = No unit
                  • Unit Group - Remove all units from Damaged
                • Else - Actions
            • Else - Actions
 

Cheddar

This is the way it was meant to be.
Reaction score
126
Have you tried clearing the points in your loop, even when the distance is 150 or greater?
 

simonake

New Member
Reaction score
72
Here are leaks that i found
Trigger:
  • Unit Group - Pick every unit in (Random 1 units from (Units within 140.00 of Point[(Integer A)] matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is in Damaged) Equal to False)) and (((Matching unit) belongs to an enemy of (Owner of Unit[(Integer A)])) Equal to Tru and do (Actions)

and this might be another leak, im not sure...
Trigger:
  • Destructible - Pick every destructible within 140.00 of (Position of Unit[(Integer A)])


(Might be because the periodic trigger is never closed...) hehe, does it work the first time? and then not anymore?
 

yunusowic

New Member
Reaction score
7
Have you tried clearing the points in your loop, even when the distance is 150 or greater?

Yes, didn't work.

(Might be because the periodic trigger is never closed...) hehe, does it work the first time? and then not anymore?

It is closed when the distance is <= to 150. What do you mean by first time? It never works right but when the periodic trigger is first started it works right for one time. I added

Trigger:
  • Destructible - Create a Summer Tree Wall at TPoint[(Integer A)] facing (Random angle) with scale 1.00 and variation 1


action to the periodic trigger. Normally it should create many trees near the targets location but when i cast the spell it only creates 1 tree at targets location then starts creating trees at this certain point in map where the hero charges. The Target or TPoint variable is somehow changed, maybe thats the problem.
 

yunusowic

New Member
Reaction score
7
Trigger:
  • Set Target[(Custom value of (Triggering unit))] = (Target unit of ability being cast)


I moved this to top of the first triggers actions and its working.
 
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