# Creating Trees {spawning trees that will surround a target or an area}

Status
Not open for further replies.

#### tdrsmynm

Level 6
Hello thanks for viewing!
I know this is a bit easy, but I cant figure it out.

How can I spawn trees at a target or an area? Like the Sprout ability of Furion (Prophet) in Dota..

#### Light

Level 9
From the target point, create another point offset from the target by, say, 0 degrees and place a tree there. Now add it by 45 degrees and place another tree. And so on, and so on...

• Set point[0] = (Target point of ability being cast)
• For each (Integer loop) from 0 to 7, do (Actions)
• Loop - Actions
• Set facing = (0.00 + (45.00 x (Real(loop))))
• Set point[1] = (point[0] offset by 250.00 towards facing degrees)
• Destructible - Create a Summer Tree Wall at point[1] facing (Random angle) with scale 1.00 and variation 0
• Set dest[loop] = (Last created destructible)
• Custom script: call RemoveLocation(udg_point[1])
• Custom script: call RemoveLocation(udg_point[0])
I set the destructibles to a variable so you can remove them later like Sprout. (You'd need to index the destructibles properly using an indexing system if you want the trigger to be MUI, which this trigger isn't)

#### tdrsmynm

Level 6
From the target point, create another point offset from the target by, say, 0 degrees and place a tree there. Now add it by 45 degrees and place another tree. And so on, and so on...

• Set point[0] = (Target point of ability being cast)
• For each (Integer loop) from 0 to 7, do (Actions)
• Loop - Actions
• Set facing = (0.00 + (45.00 x (Real(loop))))
• Set point[1] = (point[0] offset by 250.00 towards facing degrees)
• Destructible - Create a Summer Tree Wall at point[1] facing (Random angle) with scale 1.00 and variation 0
• Set dest[loop] = (Last created destructible)
• Custom script: call RemoveLocation(udg_point[1])
• Custom script: call RemoveLocation(udg_point[0])
I set the destructibles to a variable so you can remove them later like Sprout. (You'd need to index the destructibles properly using an indexing system if you want the trigger to be MUI, which this trigger isn't)

Thanks sir I already +rep you and I will be honest.

Im new to triggers and im looking for tutorials to learn this trigger because I could barely understand it. And im not sure what variables to use for this one.

#### tdrsmynm

Level 6
also, if it would be easier that the trees would be permanent then it would be fine.

#### Light

Level 9
JASS:
``````facing - real
point - point
loop - integer
dest - destructible``````

Here are the variable names and types.

#### tdrsmynm

Level 6
This is the triggers I tried and it creates the trees in the middle of the map

#### Cokemonkey11

Spell Reviewer
Level 30
- Does the "slow" ability have a "target point", or does it have a "target unit"? (I'm guessing it has a unt)
- In that case, the trigger can't respond to "(Target point of ability being cast)"
- Instead use, "Unit -get position of (Target unit of ability being cast)"

#### tdrsmynm

Level 6
I tried your suggestion but still the same results.
Here's what I changed.
(Changed the slow ability to entangling roots)

and i tried using blink for the target point and still the same results.

#### tdrsmynm

Level 6
OMG it worked! Thanks sir. the trees are a bit far but I think it will do.

+rep

#### tdrsmynm

Level 6
If they are too far away or apart just modify the values used to spawn them

I lowered down the offset and it kinda works. Also, do you have any idea how to make it disappear after a few seconds??

#### Light

Level 9
• For each (Integer loop) from 0 to 7, do (Actions)
• Loop - Actions
• Destructible - Destroy dest[loop]
Something like that. This method is non-MUI, though.

#### Fruit Forest

Level 11
Hello thanks for viewing!
I know this is a bit easy, but I cant figure it out.

How can I spawn trees at a target or an area? Like the Sprout ability of Furion (Prophet) in Dota..

Here is MUI version with configurations. + Remove from the game, because dead desctuctibles can't be removed by decaying like corpses. and as consequence they load the game memory each spell use.

#### Attachments

• I speak for the trees!.w3x
19.5 KB · Views: 58
Status
Not open for further replies.

Replies
2
Views
695
Replies
4
Views
3K
Replies
3
Views
556
Replies
2
Views
925
Replies
6
Views
4K