• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Checking how many heroe's in specific area

Status
Not open for further replies.
Level 5
Joined
Aug 6, 2009
Messages
136
I'm trying to make a region where your heroes can enter, but there is a limit on how many of em' may enter.

Let me demonstrate my trigger;

  • Name
    • Events
      • Unit - A unit enters Region [Put in name here] <gen>
    • Conditions
      • ((Entering unit) is A Hero) Equal to True
      • (Level of (Entering unit)) Less than 2
    • Actions
      • Unit - Move (Triggering unit) instantly to ( [Put in region name here] <gen>)
This is my incomplete trigger, it doesn't work.

EDIT: WHY? Let me explain what i want it to do: It counts regular units and heroes. What i want too is to make it work on only: Heroes.

Does anyone know another way of doing it?
Or another way on improving this?

~Ayrayen
 
Last edited by a moderator:
Level 33
Joined
Mar 27, 2008
Messages
8,035
There are 3 units for you to test with
Unit A is Archmage Level 1
Unit B is Footman normal unit
Unit C is Paladin Level 2

Only Archmage will not be killed (or do something else, your needs) and will be teleported to Point B after you crossed the Region A

A test map is attached
 

Attachments

  • Simple Teleport System.w3x
    13.5 KB · Views: 37
Level 5
Joined
Aug 6, 2009
Messages
136
So...

(Entering unit) will not cause leaks?

But still you mention that (triggering unit) is better.
 
Level 5
Joined
Aug 6, 2009
Messages
136
Is this right?

  • Fixed?
    • Events
      • Unit - A unit enters Entrance <gen>
    • Conditions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Entering unit) is A Hero) Equal to True
          • (Level of (Entering unit)) Less than 2
        • Then - Actions
          • Set TeleportPoint = (Center of Region [Insert name] ) <gen>)
          • Unit - Move (Entering unit) instantly to TeleportPoint
          • Custom script: call RemoveLocation (udg_TeleportPoint)
        • Else - Actions
          • Unit - Kill (Entering unit)
          • Game - Display to (All players) the text: The following condi...
There are no leaks this time right?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Use (Triggering unit) instead of (Entering unit), just do it (it's the matter of efficiency)

You can set the location in any trigger that uses "Map Initialization" as Event
Because, that is not count as variable, but more like constant (the location won't change, right ? You're gonna use the teleport point until the game ends, right ?)
You already downloaded my test map, right ?
Check my setup constant variable, you're gonna need to set it up once per game (because it doesn't gets changed from time to time
There's no wrong by using your current trigger, but following this advice might get you more efficiency in trigger

EDIT:
This is what I'm talking about:
  • Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TeleportPoint = (Center of Teleport Point <gen>)
      • Floating Text - Create floating text that reads Enter through here ... at (Center of Entrance <gen>) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Just use this point as many time as you want, it won't leak because you're using the same exact location over the period of the game
 
Level 5
Joined
Aug 6, 2009
Messages
136
Use (Triggering unit) instead of (Entering unit), just do it (it's the matter of efficiency)

You can set the location in any trigger that uses "Map Initialization" as Event
Because, that is not count as variable, but more like constant (the location won't change, right ? You're gonna use the teleport point until the game ends, right ?)
You already downloaded my test map, right ?
Check my setup constant variable, you're gonna need to set it up once per game (because it doesn't gets changed from time to time
There's no wrong by using your current trigger, but following this advice might get you more efficiency in trigger

EDIT:
This is what I'm talking about:
  • Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TeleportPoint = (Center of Teleport Point <gen>)
      • Floating Text - Create floating text that reads Enter through here ... at (Center of Entrance <gen>) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Just use this point as many time as you want, it won't leak because you're using the same exact location over the period of the game

Ok that makes sence.

I hope it is not to much trouble...But;

I'm making it count units in a specific region. But it still counts Summoned units. Like if you summon it inside this specific region it will count as a unit. I simply want it to not count as a unit.

How do i fix that?

Thanks!
 
Status
Not open for further replies.
Top