Is it possible to have a "Grow Tree" like ability in which a unit plants a tree, and over x amount of time it grows into a normal Destructible Tree?
Okay, can someone tell me why this doesn't work?
Trigger:
- Grow Tree
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Ability being cast) Equal to Plant Tree
- Then - Actions
- Special Effect - Create a special effect at (Target point of ability being cast) using Abilities\Spells\NightElf\Barkskin\BarkSkinTarget.mdl
- Wait 5.00 seconds
- Destructible - Create a Summer Tree Wall at (Target point of ability being cast) facing (Random angle) with scale 1.00 and variation (Random integer number between 0 and 9)
- Animation - Play (Last created destructible)'s birth animation
- Special Effect - Destroy (Last created special effect)
- Else - Actions
If someone casts this spell multiple times within 5 seconds, or different players cast the spell at the same time, wouldn't that screw up the TempPoint variable?
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Plant Tree
Actions
Set TempPoint = (Target point of ability being cast)
Unit - Create 1 EffectUnit at TempPoint for Owner of (Triggering unit)...
Unit - Add 5 seconds generic Expiration timer to (Last created unit)
Custom Script: call RemoveLocation(udg_TempPoint)
Events
Unit - A unit dies
Conditions
Unit-type of (Triggering unit) Equal to EffectUnit
Actions
Set TempPoint = (Position of (Triggering unit))
Destructible - Create a Summer Tree Wall at TempPoint facing (Random angle) with scale 1.00 and variation (Random integer number between 0 and 9)
Animation - Play (Last created destructible)'s birth animation
Animation - <[I]you can also set animation speed here, to look realistic[/I]>
Custom Script: call RemoveLocation(udg_TempPoint)
This doesn't solve the problem of the variables getting screwed up with multiple casts though. Good idea though.