• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Tree Targeting

Status
Not open for further replies.
As the name suggests, I need a way to target a tree through triggers. However, The problem lies in that all the spells that I know of won't work because it either destroys the tree or doesn't let me use repeatedly.

Eat Tree - Destroys the tree.
War Club - Destroys the Tree.
Sentinel - Can only use on any given tree once.
Harvest - Would work but I need to prevent it from actually doing anything with the lumber it carries.
(Which Im not sure I can do. Can I get rid of that through triggers some how?)

I tried to use regular attacks instead of spells but there isn't an event that recognizes when a unit attacks a tree.

And as I said, I need to be able to order it through triggers, so I can't just use channel or fireball.

If anyone can think of a way to get around this I would be greatly Appreciative.

Edit: I Do suppose I could make the tree a structure, but I'm planning on making a lot of them and that could get laggy.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Why don't you use any ability with 0.01 duration and make it target Destructible? It can be heal or something like that.

I didn't know Channel couldn't be ordered with triggers... Not even using "OrderId"?

Use "Target Destructible of Ability Being cast" as comparison for the trigger.
 
You can order channel using triggers, you just can't use it to target a destructible.
Maybe this can describe it better:
144484-albums5193-picture57699.png
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Unless you're going to dinamically generate destructibles/trees

  • Destructible - Pick every destructible in (Playable map area) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
        • Then - Actions
          • Trigger - Add to (This trigger) the event (Destructible - (Picked destructible) dies)
        • Else - Actions
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I don't think so. It's done in Map Initialization and won't take long to load. Won't lag either when a Tree dies.

Damage Detection Systems every 0.03 seconds creates specific unit events for every unit in the map to detect damage source and it doesn't lag. This is going to happen just once, and since you're going to revive any dying destructible, there's no need to destroy and recreate the trigger.

I think it's safe
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You can only use Eat Tree and Sentinel as it does not affect your unit.

War Club gives you damage modifer, thus ruin the unit with additional damage and such
While Harvest gives you a Lumber to carry

Eat Tree
You can use this, however you cannot get rid of the sound of "falling trees" or timber, it would not affect the game, but would affect the gameplay of a player

Sentinel
You also can use this but you cannot get rid of the Owl Sound.

I used Eat Tree for the test map below, does not need you to let your Destructibles be added to a trigger, it is fairly simple and with a trick :)

NOTE: Trees have variation, I don't know how to match the last killed destructible with its own variation, that's what spoil the system now

Solution: I think you have to set all your trees to all the same variation (if 0, all the trees in the map is 0 for that particular region for example)
 

Attachments

  • Simple Tree System.w3x
    13.3 KB · Views: 58
Level 25
Joined
May 11, 2007
Messages
4,650
Can a unit with harvest have the ability "return lumber"?

Because then you could have a trigger that activates when the hero with the harvest spell is used, then it adds "return lumber" and tells the hero to return the lumber, and then reduces the player's lumber with 1.
 
Status
Not open for further replies.
Top