• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Destroying tree's with a spell.

Status
Not open for further replies.
Level 8
Joined
Apr 8, 2009
Messages
499
Right now i want the "shockwave" spell to destroy trees.
+I already added trees to the allowed targets but somehow this won't work.
+I also tried creating a custom unit and setting its model to a tree BUT for some reason, this creates problems with the textures.

if anyone can help me on one of these two issues, it'll mean +rep for them ^_^
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,220
Some spells have inflexible targeting. For example you can never get death coil to target friendly living units. You may find that shockwave just can not target trees (it might even be mechanical, as it may not check destructables).

You can always trigger the spell ofcourse.
 
Level 8
Joined
Apr 8, 2009
Messages
499
Go to the trees, and change their hp to 1.

If that doesn't work:

Trigger the spell:

Pick every destructable that is affected by the spell, and kill the tree.

Already did that, doesn't change anything.....




Some spells have inflexible targeting. For example you can never get death coil to target friendly living units. You may find that shockwave just can not target trees (it might even be mechanical, as it may not check destructables).

You can always trigger the spell ofcourse.


Thought as much =\ .... problem is, i'm not really confident in my spell triggering abilities.
I probably won't be able to trigger something like "Shockwave"

do you guys know of any spell in the spellsection thats just like shockwave?
or perhaps you can help me create Shockwave?
 
Level 8
Joined
Apr 8, 2009
Messages
499
I don't know, but maybe you could create a dummy unit or 5 that cast Flame Strike or something similar along the path of the shockwave.

If hes doing that, he can just as well pick the destructables and damage them...

Both seem plausible..... and it made me wonder, is it possible to lets say,

get position of casting unit, position of targeted area from the casted spell, and sort-of enlarge that into a region?

after that its easy ofcourse to pick all trees and kill em.... but how to do that region?
 
Level 11
Joined
Jun 30, 2008
Messages
580
Well, shockwave is somewhat in a form of a triangle.

You can create a triangle that matches the shockwave.

Take the position of caster, Angle of caster, create 2 more points to form the triangle. And move the points that direction. Pick every tree that are inside those points and kill them.

Might work.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,220
Utalizing a huge circular selection of destructables centered on the mid point between the 2 points (you can retreive them) with a diameter equal to that of the distance between the two points. Inorder to make it line like, you just filter it using linear maths to check weather they lie on the line.

Shockwave is linear as far as I know, breath of fire is triangular.
 
Level 8
Joined
Apr 8, 2009
Messages
499
Well, shockwave is somewhat in a form of a triangle.

You can create a triangle that matches the shockwave.

Take the position of caster, Angle of caster, create 2 more points to form the triangle. And move the points that direction. Pick every tree that are inside those points and kill them.

Might work.

Question remains: "How?"
and like DSG said, its linear, which also happens to be what i need...


Utalizing a huge circular selection of destructables centered on the mid point between the 2 points (you can retreive them) with a diameter equal to that of the distance between the two points. Inorder to make it line like, you just filter it using linear maths to check weather they lie on the line.

Shckwave is linear as far as I know, breath of fire is triangular.

myeah... sounds as if it would work, but i have no clue how to do that xD



i'm gonna try KingMurdocs solution for now, which was creating dummy's which cast FlameStrike =destroying trees etc.etc.

But if you could post some Triggers for that solution of yours DSG i might be able understand_how/use_it.


------------EDIT------------------------------
  • SlicingSlash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Slicing Slash
    • Actions
      • Set LocCaster = (Position of (Casting unit))
      • Set LocTargetArea = (Target point of ability being cast)
      • Set RealTemp = 0.00
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set RealTemp = (RealTemp + 200.00)
          • Unit - Create 1 Dummy Slicing Slash for Player 1 (Red) at LocCaster facing LocTargetArea
          • Unit - Move (Last created unit) instantly to ((Position of (Last created unit)) offset by RealTemp towards (Facing of (Last created unit)) degrees)
          • Destructible - Pick every destructible within 256.00 of (Position of (Last created unit)) and do (If ((Destructible-type of (Picked destructible)) Equal to Summer Tree Wall Detroyable) then do (Destructible - Kill (Picked destructible)) else do (Do nothing))
          • Unit - Remove (Last created unit) from the game


FIXED.
 
Last edited:
Level 29
Joined
Mar 10, 2009
Messages
5,016
no need for dummies, do like this...

  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave
    • Actions
      • Set p1 = (Position of (Triggering unit))
      • Set distance = 100.00
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set p2 = (p1 offset by distance towards (Facing of (Triggering unit)) degrees)
          • Destructible - Pick every destructible within 150.00 of p2 and do (Actions)
            • Loop - Actions
              • Destructible - Kill (Picked destructible)
              • Custom script: call RemoveLocation(udg_p2)
          • Set distance = (distance + 100.00)
  • Custom script: call RemoveLocation(udg_p1)
EDIT: FIXED

didnt notice that, thx mortar
 
Last edited:
Status
Not open for further replies.
Top