- Joined
- Jan 9, 2005
- Messages
- 2,142
Is it possible to make a unit ignore collision with trees but respect unit/building and cliff collision?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Loop

Events


Time - Every 0.05 seconds of game time

Conditions

Actions


Set TempUnit = Knight 0001 <gen>


Set TempPoint = ((Position of TempUnit) offset by 50.00 towards (Facing of TempUnit) degrees)


Destructible - Pick every destructible within (Radius-Value) of TempPoint and do (Actions)



Loop - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






IsNearToTrees Equal to False






(Destructible-type of (Picked destructible)) Equal to Summer Tree Wall






((Picked destructible) is alive) Equal to True





Then - Actions






Set IsNearToTrees = True





Else - Actions


Custom script: call RemoveLocation(udg_TempPoint)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




IsNearToTrees Equal to True



Then - Actions




Unit - Turn collision for TempUnit Off



Else - Actions




Unit - Turn collision for TempUnit On


Set IsNearToTrees = False
SetUnitX(u, x) and SetUnitY(u, y). These functions move the unit naively - that is to say it will put them in impassable terrain if you tell it to.
trigger
events
conditions
actions

set myUnit = Last created unit

Custom script: call SetUnitX(udg_myUnit, GetLocationX(udg_myPoint))

Custom script: call SetUnitY(udg_myUnit, GetLocationY(udg_myPoint))
With that said, what if I just disable the tree's collision? Is that possible?
Not really an issue since the tree is dying anyway.
If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions


(Terrain pathing at (Your_Point) of type Walkability is off) Equal to True

Then - Actions

Else - Actions
