- Joined
- Apr 24, 2012
- Messages
- 5,113
-
Destroy Tree
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- ---------------------------------------- --------
-
-------- Creating Tree Cutter --------
-
-------- ---------------------------------------- --------
-
Set DT_Loc = (Center of (Playable map area))
-
Unit - Create 1 Peasant for Neutral Extra at DT_Loc facing Default building facing degrees
-
Set DT_Cutter = (Last created unit)
-
Unit - Hide DT_Cutter
-
Custom script: call UnitAddAbility(udg_DT_Cutter,'Aloc')
-
Custom script: call RemoveLocation(udg_DT_Loc)
-
Custom script: endfunction
-
-------- ---------------------------------------- --------
-
-------- This function checks if a destructable is a tree or not --------
-
-------- ---------------------------------------- --------
-
Custom script: function IsDestructableTree takes nothing returns boolean
-
Custom script: return IssueTargetOrderById(udg_DT_Cutter, OrderId("harvest"), udg_DT_Dest) and IssueImmediateOrderById(udg_DT_Cutter, OrderId("stop"))
-
Custom script: endfunction
-
-------- ---------------------------------------- --------
-
-------- This function destroy trees --------
-
-------- ---------------------------------------- --------
-
Custom script: function DestroyTree takes nothing returns nothing
-
Destructible - Kill DT_Dest
-
Custom script: endfunction
-
-------- ---------------------------------------- --------
-
-------- Reset --------
-
-------- ---------------------------------------- --------
-
Custom script: function InitDestroyTree takes nothing returns nothing
-
Custom script: local trigger t = GetTriggeringTrigger()
-
Custom script: call TriggerClearActions(t)
-
Custom script: call TriggerAddAction(t,function DestroyTree)
-
Custom script: call TriggerAddCondition(t,Filter(function IsDestructableTree))
-
-
I have been figuring that one,i dont know whats wrong,i just follower Mag's tips and it doesnt work.