• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Make shockwave destroy trees

Status
Not open for further replies.
Hi i want to help somebody with a skill. A shockwave that will destroy trees but i can't make this skill to work fine. Can somebody tell me want i need to change here? Thx +rep
  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave...
    • Actions
      • Set ShockwaveCasterPoint = (Position of (Triggering unit))
      • Set Distance = 100.00
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set ShockwaveCasterPoint2 = (ShockwaveCasterPoint offset by Distance towards (Facing of (Triggering unit)) degrees)
          • Destructible - Pick every destructible within 125.00 of ShockwaveCasterPoint2 and do (Actions)
            • Loop - Actions
              • Destructible - Kill (Picked destructible)
              • Custom script: call RemoveLocation (udg_ShockwaveCasterPoint2)
          • Set Distance = (Distance + 100.00)
      • Custom script: call RemoveLocation (udg_ShockwaveCasterPoint)
 
Move this out of (to go after) the destructible-picking loop: Custom script: call RemoveLocation (udg_ShockwaveCasterPoint2). Instead of using the facing angle you should use the angle between the caster's position and the targeted cast point.

Improvements, but these shouldn't 'make' the trigger 'work'.
so i need to make a new trigger to make this to work fine?
 
Level 39
Joined
Feb 27, 2007
Messages
5,019
No... you change what I said you should change. And then read the second half of my reply which says it shouldn't fix anything.

Nobody can help you here until you put in some debug messages and figure out what isn't running. That trigger looks like it should kill destructibles in 5 125-range areas situated 100-500 units from the caster in the direct ion it's facing.
 
No... you change what I said you should change. And then read the second half of my reply which says it shouldn't fix anything.

Nobody can help you here until you put in some debug messages and figure out what isn't running. That trigger looks like it should kill destructibles in 5 125-range areas situated 100-500 units from the caster in the direct ion it's facing.
Ok thx now is working fine
  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave...
    • Actions
      • Set ShockwaveCasterPoint = (Position of (Triggering unit))
      • Set Distance = 200.00
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set ShockwaveCasterPoint2 = (ShockwaveCasterPoint offset by Distance towards (Angle from ShockwaveCasterPoint to (Target point of ability being cast)) degrees)
          • Destructible - Pick every destructible within 150.00 of ShockwaveCasterPoint2 and do (Actions)
            • Loop - Actions
              • Destructible - Kill (Picked destructible)
          • Custom script: call RemoveLocation (udg_ShockwaveCasterPoint2)
          • Set Distance = (Distance + 100.00)
      • Custom script: call RemoveLocation (udg_ShockwaveCasterPoint)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,555
Some more improvements can be made:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave...
    • Actions
      • Set ShockwaveCasterPoint = (Position of (Triggering unit))
      • Set ShockwaveCasterPoint2 = (Target point of ability being cast)
      • Set Distance = 200.00
      • Set Angle = (Angle from ShockwaveCasterPoint to ShockwaveCasterPoint2)
      • Custom script: call RemoveLocation (udg_ShockwaveCasterPoint2)
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set ShockwaveCasterPoint2 = (ShockwaveCasterPoint offset by Distance towards Angle degrees)
          • Destructible - Pick every destructible within 150.00 of ShockwaveCasterPoint2 and do (Actions)
            • Loop - Actions
              • Destructible - Kill (Picked destructible)
          • Custom script: call RemoveLocation (udg_ShockwaveCasterPoint2)
          • Set Distance = (Distance + 100.00)
      • Custom script: call RemoveLocation (udg_ShockwaveCasterPoint)
This fixes a memory leak -> (Target point of ability being cast) and calculates the Angle only once instead of doing it 5 times.

Also, if you want a Shockwave that Destroys trees as it collides with them you can use a system like this:
I also attached a custom shockwave spell I made in GUI a year ago, it's not perfect but gets the job done.
 

Attachments

  • Custom Shockwave.w3x
    24.5 KB · Views: 7
Some more improvements can be made:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave...
    • Actions
      • Set ShockwaveCasterPoint = (Position of (Triggering unit))
      • Set ShockwaveCasterPoint2 = (Target point of ability being cast)
      • Set Distance = 200.00
      • Set Angle = (Angle from ShockwaveCasterPoint to ShockwaveCasterPoint2)
      • Custom script: call RemoveLocation (udg_ShockwaveCasterPoint2)
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set ShockwaveCasterPoint2 = (ShockwaveCasterPoint offset by Distance towards Angle degrees)
          • Destructible - Pick every destructible within 150.00 of ShockwaveCasterPoint2 and do (Actions)
            • Loop - Actions
              • Destructible - Kill (Picked destructible)
          • Custom script: call RemoveLocation (udg_ShockwaveCasterPoint2)
          • Set Distance = (Distance + 100.00)
      • Custom script: call RemoveLocation (udg_ShockwaveCasterPoint)
This fixes a memory leak -> (Target point of ability being cast) and calculates the Angle only once instead of doing it 5 times.

Also, if you want a Shockwave that Destroys trees as it collides with them you can use a system like this:
I also attached a custom shockwave spell I made in GUI a year ago, it's not perfect but gets the job done.
Thx @Uncle for your answer but it seems that this trigger will not destroy trees. I will give my friend your map. Like you said my friend didn't like my trigger because the trees will die instantly...

I found this skill too
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,555
You'll have to add in the tree destruction yourself. All of these custom shockwave systems (and really any trigger that interacts with nearby units) use the same method for damaging units.

Every X seconds -> Set a Point -> Pick every unit within range of that Point -> Deal damage to (Picked unit)

So all you have to do is add in your Tree destruction actions there as well:
  • Destructible - Pick every destructible within 150.00 of ThePoint and do (Actions)
    • Loop - Actions
      • Destructible - Kill (Picked destructible)
Then you can add an If Then Else to Filter the (Picked destructible) so that you only destroy trees, unless you want any kind of Destructible to be destroyed.
 
You'll have to add in the tree destruction yourself. All of these custom shockwave systems (and really any trigger that interacts with nearby units) use the same method for damaging units.

Every X seconds -> Set a Point -> Pick every unit within range of that Point -> Deal damage to (Picked unit)

So all you have to do is add in your Tree destruction actions there as well:
  • Destructible - Pick every destructible within 150.00 of ThePoint and do (Actions)
    • Loop - Actions
      • Destructible - Kill (Picked destructible)
Then you can add an If Then Else to Filter the (Picked destructible) so that you only destroy trees, unless you want any kind of Destructible to be destroyed.
I already gave him this ability
If he will not be able to make this one to work, i will give him this trigger that you send me . Thx again @Uncle for your help
 
Status
Not open for further replies.
Top