Ordering Attack Move when ramp is blocked

Oninuva

You can change this now in User CP.
Reaction score
221
When you order an attack move to the computers units, they won't attack stuff blocking the ramp, and they just move some where else and just stand there..

For example

Cliff ------\ RAMP / ------------------------------------------------ (computers move somewhere here)


and yes, the ramp is blocked, (same was a terran would wall off). Is there anyway around that? That the computer would path to the ramp and attack it?
 

Cheekything

TH.net Regular
Reaction score
5
I don't know what the command would be but by blocked do you mean units or a doodad?

Because if your using a doodad you might want to put it on the hostile team and then they should auto attack it.

If you means units then you want to check if the unit is within attack range then if it isn't cancel attack and attack nearest hostile unit.
 

Oninuva

You can change this now in User CP.
Reaction score
221
It's a unit, same as if a terran walls in, supply depot, bunker, rax, etc

What do you mean by check if unit is in attack range?
 

Severon

New Member
Reaction score
7
order the units to attack move to the top of the ramp?

...Did you read the question? If the top of the ramp is walled off and she orders an attack move to the "top of the ramp" the pathing algorithm for the AI finds that the ramp is block and makes them move else where.
 

Cheekything

TH.net Regular
Reaction score
5
It's a unit, same as if a terran walls in, supply depot, bunker, rax, etc

What do you mean by check if unit is in attack range?

All units have a range that they can attack with, I believe you can trigger the AI to check it and then create a temp region or aura and to then attack a random target or closest target within that region/aura.
 

Oninuva

You can change this now in User CP.
Reaction score
221
I've even given computer vision of the entire map. Could you elaborate more on what your suggesting Cheekthing, not really understanding what your saying :p
 

Frozenwind

System maker
Reaction score
99
I think you should do something like this:

Code:
Events
    whenever u need it
Conditions
    your problem :P
Local Variables
    temp_Boolean = boolean variable (default = false)
Actions
    While temp_Boolean == false
        if AI - way available from attackerposition to targetpoint ==true //[COLOR="SeaGreen"]not sure what exactly is the name of the command, but it checks if there is a way available from A to B[/COLOR]
            then
                set temp_Boolean == true [COLOR="SeaGreen"]//Will break the loop - there is a way, so they won't get stuck somewhere[/COLOR]
            else
                order "your attacking unit" to attack "target point with polar offset 1 towards (Angle from targetpoint to attackerposition

Basically, the while function makes your units attack a closer point all the time (I recommend you use a variable for the 2 points though - makes it a lot easier), until they find a point which they can reach. This will only be near the wall if the wall is in a straight line though, but it's a start.


If there is a way around, this won't work though. But atm I don't have a solution for that. I assume the wall is rather far away from the way around?
 
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