Imagine a lot of npc going to the same place, they block a path and you hero just cant go through that crowdNot sure if I understood this properly.
"they" who?
Describe your problem with more info please.
No, Bribe begged me for leave custom value unchanged, so he will be credited in incredible map. If you didn't get it, don't worry, it's a joke that only a few people could understand (not really).Not sure if you wanted something like this. It's a fairly simple system that allows you to push "NPCs" out of the way.
With the Paladin selected, right click a Knight to push it out of your way. You must be within a certain range of the Knight to do this.
There's a bunch of options you have to configure in the "Setup NPC Move System" trigger. If you want to use this exact system then make sure to import everything properly. You have to import the 1 ability, 1 buff, and triggers. Also, this uses Bribe's Unit Indexer, so that may cause conflicts with your map if you were using Custom Value for something else.
Feel like you helped me a lot, yes, its something different from what I asked (checking for Paladin is moving and then pushing away all npcs around), but maybe I can change it in my own. But even at a current state this system solves much problems. I'll test it when I get back to my pc.Not sure if you wanted something like this. It's a fairly simple system that allows you to push "NPCs" out of the way. This system is designed around the idea that the NPCs will eventually return to their original positions after being "pushed" away.
How to use the system:
With the Paladin selected, right click a Knight to push it out of your way. Your Paladin must be within a certain range of the Knight to do this.
How to import:
You have to import the Phasing ability, Phasing buff, and the triggers. Also, this uses Bribe's Unit Indexer, so that may cause problems if you were using Custom Value for something else.
Also, make sure to configure the "Setup NPC Move System" trigger. The main thing that you have to worry about is adding units to the correct Unit Groups.
For NPCs: Add them to NM_NpcUG
For Units that can Push NPCs: Add them to NM_PlayerUG
---------
I realize that this System isn't exactly what you wanted but I think that you can at least get some good ideas from it.
Here's a simplified trigger that might work better for you. You can mess with the conditions to suit your needs:
Push Simple Example
Events
Unit - A unit Is issued an order targeting an object
Conditions
(Issued order) Equal to (Order(smart))
(Unit-type of (Target unit of issued order)) Equal to NPC Unit
(Unit-type of (Ordered unit)) Equal to Player Unit
Actions
Set TempUnit = (Target unit of issued order)
-------- - --------
Set TempPoint1 = (Position of (Ordered unit))
Set TempPoint2 = (Position of TempUnit)
Set Distance = (Distance between TempPoint1 and TempPoint2)
-------- - --------
Custom script: call RemoveLocation(udg_TempPoint1)
Custom script: call RemoveLocation(udg_TempPoint2)
-------- - --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Distance Less than or equal to 200.00
Then - Actions
Set TempPoint1 = (Position of (Ordered unit))
Set TempPoint2 = (Position of TempUnit)
Set Angle = (Angle from TempPoint1 to TempPoint2)
-------- - --------
Custom script: call RemoveLocation(udg_TempPoint1)
Custom script: call RemoveLocation(udg_TempPoint2)
-------- - --------
Set TempPoint1 = ((Position of TempUnit) offset by 200.00 towards Angle degrees)
Unit - Order TempUnit to Move To TempPoint1
-------- - --------
Custom script: call RemoveLocation(udg_TempPoint1)
Else - Actions
EDIT: Added v.2. I added a trigger to automatically remove Dying units from the Npc/Player Unit Groups. If your NPCs don't die and the Players are mostly controlled by Revivable Heroes then you probably don't need to use this new version. Otherwise, if the NPCs can die, this new version will prevent some Leaks.
iT'S BAD. v2 and v1 cannot be opened due "unit memory is invalid"Not sure if you wanted something like this. It's a fairly simple system that allows you to push "NPCs" out of the way. This system is designed around the idea that the NPCs will eventually return to their original positions after being "pushed" away.
How to use the system:
With the Paladin selected, right click a Knight to push it out of your way. Your Paladin must be within a certain range of the Knight to do this.
How to import:
You have to import the Phasing ability, Phasing buff, and the triggers. Also, this uses Bribe's Unit Indexer, so that may cause problems if you were using Custom Value for something else.
Also, make sure to configure the "Setup NPC Move System" trigger. The main thing that you have to worry about is adding units to the correct Unit Groups.
For NPCs: Add them to NM_NpcUG
For Units that can Push NPCs: Add them to NM_PlayerUG
---------
I realize that this System isn't exactly what you wanted but I think that you can at least get some good ideas from it.
Here's a simplified trigger that might work better for you. You can mess with the conditions to suit your needs:
Push Simple Example
Events
Unit - A unit Is issued an order targeting an object
Conditions
(Issued order) Equal to (Order(smart))
(Unit-type of (Target unit of issued order)) Equal to NPC Unit
(Unit-type of (Ordered unit)) Equal to Player Unit
Actions
Set TempUnit = (Target unit of issued order)
-------- - --------
Set TempPoint1 = (Position of (Ordered unit))
Set TempPoint2 = (Position of TempUnit)
Set Distance = (Distance between TempPoint1 and TempPoint2)
-------- - --------
Custom script: call RemoveLocation(udg_TempPoint1)
Custom script: call RemoveLocation(udg_TempPoint2)
-------- - --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Distance Less than or equal to 200.00
Then - Actions
Set TempPoint1 = (Position of (Ordered unit))
Set TempPoint2 = (Position of TempUnit)
Set Angle = (Angle from TempPoint1 to TempPoint2)
-------- - --------
Custom script: call RemoveLocation(udg_TempPoint1)
Custom script: call RemoveLocation(udg_TempPoint2)
-------- - --------
Set TempPoint1 = ((Position of TempUnit) offset by 200.00 towards Angle degrees)
Unit - Order TempUnit to Move To TempPoint1
-------- - --------
Custom script: call RemoveLocation(udg_TempPoint1)
Else - Actions
EDIT: Added v.2. I added a trigger to automatically remove Dying units from the Npc/Player Unit Groups. If your NPCs don't die and the Players are mostly controlled by Revivable Heroes then you probably don't need to use this new version. Otherwise, if the NPCs can die, this new version will prevent some Leaks.
Ahah I feel regretful, I still use 1.26 I because I'm afraid something wont work right if I go to 1.31.Are you on the latest patch? Anyway, you can just use that trigger I posted.
Really thx you.Yes, you should update. But be warned, you may experience some problems after updating. Maybe create backups of your maps just in case.
And IF you run into problems like low fps or something then I think this thread will help. The person in this thread updated from an old patch to 1.31 and ended up with issues but they figured out how to fix it. Their solution is at the very bottom of page 2.
Help import JASS skill
Also, if you do update, use the new version of the system that I attached below.