• 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.

Range check

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

I got a small problem - its seems so simple but I cant get it.

There is a unit on the map. If the unit is selected by a player, something should happend, but only if the range between "selected Unit" and the "Player-controlled-Unit" under 500.

But I don't get the trigger that check the range.

Maybe some can help ~ thanks =)
 
Level 11
Joined
May 11, 2008
Messages
830
You mean when Player - Does Selection or something like that?

Condition would be a Boolean
Distanced between Clicked Unit and (name of unit) is 500 equals to true.

Actions
bla bla bla

EDIT: This is what your looking for?

The Condition is a Real Comparison.

  • Selection
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Distance between (Position of (Triggering unit)) and (Position of (Triggering unit))) Less than or equal to 500.00
    • Actions
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

jeah i though so too BUT the problem is I dont now the check between WHAT units...

  • Events:
    • Player - Player 1 (Red) selects a Unit
is the event - with this event - the selected Unit is the (TriggeringUnit). But how i call the unit, controlled by the Player wich select the unit?
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

Ok I tell the truth - I dont know what you talking about so look at this:

Step 1) You as "Player1" controll "Dummy1"
Step 2) "Dummy2" is neutral passive
Step 3) "Dummy2" should be the selected Unit
Step 4) You as "Player1" select "Dummy2"
Step 5) The Condition: The range between "Dummy1" and "Dummy2" under 500 then to actions:

Ok for me, this is the easiest way to explain what I meen - hope you can get something with this
 
Level 11
Joined
May 11, 2008
Messages
830
I think I got it now, what you need to do is create a new condition, one of these conditions is called And as in it requires both conditions for it to work, so the first Condition will be a Real condition for the distances between triggering unit and the other unit, then a player comparision for triggering unit equals (player 1)
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

Ok I tried to understand what you meen - but it wont work :wconfused:

But I did some other way - I got only some couple of heros - I set a variable to each hero - and them I check range between them and the TriggerUnit

I tried this and it works =)

Anyway I give you +rep for your help

Thanks
Dr. Boom
 
Status
Not open for further replies.
Top