• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How can I block teleports from enemies???

Status
Not open for further replies.
Level 3
Joined
Jun 18, 2014
Messages
30
Hi!
I'm new here so be tolerant with my bad english (xD) because I speak spanish :)P).
----
Well, I'm creating a map with battle of heroes format, etc, etc... and all teams has closed bases, I mean the bases has closed doors so all units and heroes can went to the external zone (outside the base) with teleports and vice-versa, It's ok, but my problem is: the x teleport outside the x base is free to use for all players and I need block it from enemies because all players (enemies, neutrals, allies) can enter to the x base so I want block the teleports from enemies but keep free-pass to allies.

I don't know how can I make it and if it's possible so if someone know the solution, tell me please.
Thanks! :D
 
Level 15
Joined
Aug 7, 2013
Messages
1,337
Several possible solutions to this problem.

Let me first me clear on what I think you are asking and my assumptions.

1. There are two bases.

2. Each base belongs to a different team

3. Players from one team should not be able to go into the base of an enemy team.

Since you are talking about teleporting, I am assuming you are using Waygates to move between the arena and the bases.

If you want to keep way gates, there are a few things you can do.

a. Detect when a player on Team X tries to use the warp gate for Team Y's base, and stop them. (this one is probably the hardest to do).

b. Create a region that covers all of Team Y's base. When a player on Team X enters that region, move them back to the arena at Team Y's warp gate.


If you don't mind using other methods of movement between bases, you can make a trigger which moves a player's units from one region (the teleporter) to another (the base). Players who don't belong to that tele porter's team won't get moved.
 
Level 12
Joined
Nov 3, 2013
Messages
989
You use waygate or trigger?

Trigger: Add condition that owner of unit is in team 1 or 2

Waygate: I think you can't decide who can use it (not sure). You could have a trigger "unit is issued order target point" Player is in wrong team AND (order == move OR order == smart) then make the unit stop.

Also check if the unit target the waygate instead and make it stop.

You could also isolate the waygate and prevent enemy team units from being able to move close enough to use it.

Edit: Sethmachine already answered, probably better too. :3
 
Level 12
Joined
Nov 3, 2013
Messages
989
Something like this:

  • Untitled Trigger 005
    • Events
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(attack))
          • (Issued order) Equal to (Order(move))
          • (Issued order) Equal to (Order(smart))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of issued order) Equal to Waygate
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
          • Skip remaining actions
        • Else - Actions
          • set tempPoint = (Target point of issued order)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (safeZoneRegion contains tempPoint) Equal to True
            • Then - Actions
              • Unit - Order (Triggering unit) to Stop
            • Else - Actions
          • Custom script: call RemoveLocation(udg_tempPoint)
U gonna have to check team also which this didn't include and also probably add some more conditions because this will only work when units are issued orders.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Well maybe you could disable the waygates if there are enemies nearby, this would also mean that the enemy could prevent you from fleeing back to base.
 
Status
Not open for further replies.
Top