not avoiding obstacles while moving

warroom99

New Member
Reaction score
15
as u all know when there is a barel or a tree in the way..

me ------> x ----> #

it will avoid the "x".

is it possible that when an obstacle is in the way the unit will just bump the obstacle and stop??
 

waaaks!

Zinctified
Reaction score
255
u need to count the trees nearby the moving unit periodically (like in ur trigger that moves the unit), if the counted trees or destructible is equal to or greater than 1, then stop the sliding trigger
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
You could have a periodic trigger checking if there is something in the way.
Then order the unit to stop.

EDIT1: Beaten. =[

EDIT2: Your going to have to be careful because once the unit comes in range he will keep getting stopped so your going to have to move him outside the range.

EDIT3: Something like this:
Code:
Stop
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        Set Unit_Group = (Units in (Playable map area))
        Unit Group - Pick every unit in Unit_Group and do (Actions)
            Loop - Actions
                Set Point1 = (Position of (Picked unit))
                Destructible - Pick every destructible within 96.00 of Point1 and do (Set Integer = (Integer + 1))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Integer Greater than or equal to 1
                    Then - Actions
                        Unit - Order (Picked unit) to Stop
                        Set Point2 = (Point1 offset by 32.00 towards ((Facing of (Picked unit)) + 180.00) degrees)
                        Unit - Move (Picked unit) instantly to Point2
                    Else - Actions
                Custom script:   call RemoveLocation(udg_Point2)
                Set Integer = 0
                Custom script:   call RemoveLocation(udg_Point1)
        Custom script:   call DestroyGroup(udg_Unit_Group)

EDIT4: Turn of the collision of the destructibles aswell. It makes it look nicer.

Lol, how many times do I want to edit this post. xD
 

warroom99

New Member
Reaction score
15
how about if it is a terrain?

or a cave? a unit? hmm.. that would be many. and counting it will b useless cause when u order the unit to move to the specified point it will automatically find a way and will not go straight
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
You have to turn the collision off.
So it try's to run straight though it. But the trigger stops its.
 

warroom99

New Member
Reaction score
15
i tried turning off collision but it finds its way around the cliff and does not passes it unless i click at the clif walls
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top