Is there any way to make a no-pathing that will not affect a specific player?
I have a river crossing the map horizontally, enemy units are spawned from each side and make their way through the flooding water. The human player must cross the river (vertically) but I don't want him to be able to reach the spots on the side, where the enemy units are spawned. Is there something like a no-pathing tool, or doodads like "path blockers" that can work to prevent a player from reaching an area while units from another player can walk freely through them? I bet I will have to combine triggers and/or data to make something like this, so if you have any idea on how to make a "player-specific path blocker", I'd be glad to hear it...
You could easily create a small region to fit down the side of the path you want it to, and set a trigger to say if (Unit enters Region) and set the conditions to Unit owned by Player X. Then make the actions something basic, like Set a small square not too far away from the region u just set to move that unit instantly to, so he cannot pass the first region.
@Pshyched: GoThat's what I thought. It actually works... kind of...
I'm using WASD movement in this map and it seems like, when you move diagonally, the trigger is not "strong" enough to push you away from the region. And it also does some weird moves, because the order from the trigger comes in conflict with any movement you do (either by clicking or using WASD movement). So basically, the trigger method works but it looks ugly. Sometimes it will even stop pushing your unit away if you insist too much, which is why I wasn't too confident about this method.
I'm thinking of creating a trigger that will force the player in the river to stay within the (X,Y) map coordinates (as if it was the map border), where X is set to the limit I don't want him to cross. I don't know if it's doable but I'll try. Any other idea (invisible "walling unit" following the player on an axis, or something like that)?
if you want to block a specific unit of a player, which is not used by any other player, then just create a new pathingblocker unit which only uses one unused collisionflag together with this specific unit. This way the pathingblocker prevents this unit only from moving through it and if you want to change it later in the game you can easily destroy those blockers via trigger.
@TheKC: GoThanks for the suggestion. I need to block a unit type which is some kind of hero. There are 2 human players, and they both have a hero of the same type, so I guess your method will work as long as they are flagged to collide with the blocking unit.
Anyway, I just found some trigger-based method to do what I wanted, I'll show it here so that anyone can know how it's done. I fear it could be very laggy if played through BattleNet, though (because of the speed at which it is periodically checked)... I tried increasing the delay, "every 0.2 seconds" was not fast enough.
Force coordinates (left side)
Events
Timer - Every 0.05 seconds of Game Time
Conditions
(X of (Position of THE_UNIT_VARIABLE)) <= X_LIMIT
Actions
Unit - Move THE_UNIT_VARIABLE instantly to (Point(X_LIMIT, (Y of (Position of THE_UNIT_VARIABLE)))) (Blend)
Your cases is simple because of the rectangular region that you can trigger by x only. KC's solution for unused ground collide is more robust. There are around 9 collide to uses as far as i can remember
Well... Just tested the collision flags this morning using the already existing "Dynamic Pathing Blocker 1x1" units (and 2x2). They use the "Unused (Land 07)" collision flag, so I just added the same flag to my unit/hero and checked that no other unit I needed was using this flag. It did work but for all units, so the enemies coming from the sides can't find a path anymore. Did I do something wrong?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Is there any way to make a no-pathing that will not affect a specific player?
I have a river crossing the map horizontally, enemy units are spawned from each side and make their way through the flooding water. The human player must cross the river (vertically) but I don't want him to be able to reach the spots on the side, where the enemy units are spawned. Is there something like a no-pathing tool, or doodads like "path blockers" that can work to prevent a player from reaching an area while units from another player can walk freely through them? I bet I will have to combine triggers and/or data to make something like this, so if you have any idea on how to make a "player-specific path blocker", I'd be glad to hear it...
You could easily create a small region to fit down the side of the path you want it to, and set a trigger to say if (Unit enters Region) and set the conditions to Unit owned by Player X. Then make the actions something basic, like Set a small square not too far away from the region u just set to move that unit instantly to, so he cannot pass the first region.
@Pshyched: GoThat's what I thought. It actually works... kind of...
I'm using WASD movement in this map and it seems like, when you move diagonally, the trigger is not "strong" enough to push you away from the region. And it also does some weird moves, because the order from the trigger comes in conflict with any movement you do (either by clicking or using WASD movement). So basically, the trigger method works but it looks ugly. Sometimes it will even stop pushing your unit away if you insist too much, which is why I wasn't too confident about this method.
I'm thinking of creating a trigger that will force the player in the river to stay within the (X,Y) map coordinates (as if it was the map border), where X is set to the limit I don't want him to cross. I don't know if it's doable but I'll try. Any other idea (invisible "walling unit" following the player on an axis, or something like that)?
@ZealNaga: Go
if you want to block a specific unit of a player, which is not used by any other player, then just create a new pathingblocker unit which only uses one unused collisionflag together with this specific unit. This way the pathingblocker prevents this unit only from moving through it and if you want to change it later in the game you can easily destroy those blockers via trigger.
@TheKC: GoThanks for the suggestion. I need to block a unit type which is some kind of hero. There are 2 human players, and they both have a hero of the same type, so I guess your method will work as long as they are flagged to collide with the blocking unit.
Anyway, I just found some trigger-based method to do what I wanted, I'll show it here so that anyone can know how it's done. I fear it could be very laggy if played through BattleNet, though (because of the speed at which it is periodically checked)... I tried increasing the delay, "every 0.2 seconds" was not fast enough.
Force coordinates (left side)
Events
Timer - Every 0.05 seconds of Game Time
Conditions
(X of (Position of THE_UNIT_VARIABLE)) <= X_LIMIT
Actions
Unit - Move THE_UNIT_VARIABLE instantly to (Point(X_LIMIT, (Y of (Position of THE_UNIT_VARIABLE)))) (Blend)
On a sidenote; a lot of these problems are removed if you use a data-based ASDW control over trigger-based control.
@ZealNaga: Go
Your cases is simple because of the rectangular region that you can trigger by x only. KC's solution for unused ground collide is more robust. There are around 9 collide to uses as far as i can remember
Well... Just tested the collision flags this morning using the already existing "Dynamic Pathing Blocker 1x1" units (and 2x2). They use the "Unused (Land 07)" collision flag, so I just added the same flag to my unit/hero and checked that no other unit I needed was using this flag. It did work but for all units, so the enemies coming from the sides can't find a path anymore. Did I do something wrong?