• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

How to have a region (triggers) block a unit from entering

Status
Not open for further replies.
Level 11
Joined
Nov 1, 2008
Messages
828
I know but i can't because i wanted to hide the path blocker but its still basicly there.
so what kind of trigger should i use? i was thinking that the unit could teleport back abit but any suggestions?

edit: the only other option i could use is make 30 regions and those 30 regions will spawn/remove the path blockers. but like i said any suggestions?
 
  • Tr
  • Events
    • Unit - A unit enters Region 0000 <gen>
  • Conditions
  • Actions
    • Set Points[1] = (Position of (Triggering unit))
    • Set Points[2] = (Center of Region 0000 <gen>)
    • Set Points[3] = (Points[1] offset by 50.00 towards (Angle from Points[2] to Points[1]))
    • Custom script: call SetUnitX (GetTriggerUnit(), GetLocationX (udg_Points[3]))
    • Custom script: call SetUnitY (GetTriggerUnit(), GetLocationY (udg_Points[3]))
    • Custom script: call RemoveLocation (udg_Points[1])
    • Custom script: call RemoveLocation (udg_Points[2])
    • Custom script: call RemoveLocation (udg_Points[3])
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
If no units are meant to enter the rect, you should probably seal it off with a destructable blocker until they can (like a rock wall or a wall of units). This would be more visually friendly and not annoying people that they get teleported.

If it is only specific units, then you can always just move them to a offset region away from the area with some teleportation graphics.

You could also add some form of force field to the rect that the more the unit pushes in, the more it gets forced back so you still have full control but just are unable to walk further. This would use the SetUnitX/Y natives to not interupt orders.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
If you want to use SetUniX/Y function, I suggest you should "stun" (0 damage of course :D) the affected unit first before moving them
This is because the player (baaad player) can easily beat the system by performing the famous technique, Spam Click :)
Although, if you set its offset to a high value, you can outsmart the players

EDIT:
Sorry, this is for pushing the units in "dragged" (knockback) manner
What Pharaoh_ did was instant
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Yes it would need a timer.

However the timer only need run if there are units in the region that should not be.
You can do that by adding the units that enter the region to a group and activating the timer. Every couple of itterations you check if they are still in the non permitted zone and if not you then remove them from the group. If the group is empty you can just turn the timer off.

Ofcourse an array could be used instead of a group and could be faster.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
can't you place the pathing blockers for a player using getlocalplayer == player without it desyncing because Ive seen it done on Angelarena allstars and know it is possible to do this in someway.

It should cause a desync if the unit is ordered past them. The order is still valid but for the one player where the pathing blockers exist it will just get stuck against them but for everyone else the unit will walk past without problems.
 
Status
Not open for further replies.
Top