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
 
Have you tried clearing the points in your loop, even when the distance is 150 or greater?
 
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?
 
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.
 
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 The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top