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

Measure Distance Question...

Status
Not open for further replies.
Level 2
Joined
May 26, 2011
Messages
14
Hi, noob question again and tnx for help.

  • (Integer((Distance between (Position of Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))]) and (Position of (Triggering unit))))) Less than or equal to 1000
How to measure distance in AoE, any1 knows??
tnx:goblin_yeah:

EDIT: I tested an aura with 1000 AoE and its bigger then my screen xD
But distance from the trigger only applies when the Hero_Mystic is close (not realy close, but close to position of triggering unit
 
Level 2
Joined
May 26, 2011
Messages
14
No no... Hmm, lets try this way.
Is distance 1000 the same as AoE 1000
When my aura with 1000 AoE is on, it affects huge area but the distance 1000 is lot smaller... How do I know how much distance to set up in trigger to be the same as 1000 AoE. You understand?
Sorry I'm beginer and dont know how to explain very good :/
 
Level 2
Joined
May 26, 2011
Messages
14
You mean if my aura is 1000, the distance should be 2000?
Tank you for your time!

Here's the full trigger :
  • Mystic Souls Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A structure) Not equal to True
    • Actions
      • Unit Group - Pick every unit in (Units of type Mystic) and do (Actions)
        • Loop - Actions
          • Set Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))] = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer((Distance between (Position of Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))]) and (Position of (Triggering unit))))) Less than or equal to 1000
              • Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))] Less than 10
            • Then - Actions
              • Set Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))] = (Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))] + 1)
              • Floating Text - Create floating text that reads (String(Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))])) above Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))] Equal to 1
            • Then - Actions
              • Animation - Change Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))]'s vertex coloring to (100.00%, 90.00%, 90.00%) with 0.00% transparency
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))] Equal to 2
            • Then - Actions
              • Animation - Change Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))]'s vertex coloring to (100.00%, 80.00%, 80.00%) with 0.00% transparency
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))] Equal to 3
            • Then - Actions
              • Animation - Change Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))]'s vertex coloring to (100.00%, 70.00%, 70.00%) with 0.00% transparency
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))] Equal to 4
            • Then - Actions
              • Animation - Change Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))]'s vertex coloring to (100.00%, 60.00%, 60.00%) with 0.00% transparency
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))] Equal to 5
            • Then - Actions
              • Animation - Change Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))]'s vertex coloring to (100.00%, 50.00%, 50.00%) with 0.00% transparency
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))] Equal to 6
            • Then - Actions
              • Animation - Change Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))]'s vertex coloring to (100.00%, 40.00%, 40.00%) with 0.00% transparency
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))] Equal to 7
            • Then - Actions
              • Animation - Change Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))]'s vertex coloring to (100.00%, 30.00%, 30.00%) with 0.00% transparency
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))] Equal to 8
            • Then - Actions
              • Animation - Change Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))]'s vertex coloring to (100.00%, 20.00%, 20.00%) with 0.00% transparency
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))] Equal to 9
            • Then - Actions
              • Animation - Change Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))]'s vertex coloring to (100.00%, 10.00%, 10.00%) with 0.00% transparency
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero_Mystic_Souls[(Player number of (Owner of (Picked unit)))] Equal to 10
            • Then - Actions
              • Animation - Change Hero_Mystic_Unit[(Player number of (Owner of (Picked unit)))]'s vertex coloring to (100.00%, 0.00%, 0.00%) with 0.00% transparency
            • Else - Actions
 
Last edited by a moderator:
Level 28
Joined
Jan 26, 2007
Messages
4,789
Woaaah, can't you see there's an extremely easy math formula you can use?

Set tempInteger = Hero_Mystic_Souls[...]
If tempInteger is Greater than or Equal to 1, then:
Color (100, (100 - 10 * tempInteger), (100 - 10 * tempInteger)

That little thing here solves all your if-then-else conditions.

And no, the distance shouldn't be 2000.
Again, this is very simple math: if you check the distance from the MIDDLE to the sides, then you are checking the RADIUS.
The RADIUS equals the diameter / 2.
The AoE (in the object editor) also checks the RADIUS.

So the distance should be the same as the AoE.
If the AoE is 1000, the distance should be 1000 as well.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
If the AoE is 1000, and the center of it is the Caster, then the distance towards the Target/Picked unit is Less than or Equal to 500, cannot be more, since the Caster is located in the middle of it

But if the Caster is from the left side (edge) and the Target is on the right side (edge), the distance should be 1000 and below

This is however, a simple math and logics, I believe you lack of that :(
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
If the AoE is 1000, and the center of it is the Caster, then the distance towards the Target/Picked unit is Less than or Equal to 500, cannot be more, since the Caster is located in the middle of it
You do know that an AoE of 1000 means that the radius is 1000 (and thus the diameter 2000), right? :p
Because an AoE of 1000 would require a distance of 1000.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
What I meant was an AoE starts from the center of Caster, therefore its radius would be 500 and diameter would be 1000.

I have attached a ................... drawing to get a better understanding

attachment.php


As you can see by the whole drawing, the AoE is 1000 but the distance from the Caster to the end is 500 (radius)

We're talking about the same thing, only Caster's position is different in our own thoughts
 

Attachments

  • FUCKING UGLY PICTORZ.jpg
    FUCKING UGLY PICTORZ.jpg
    44.3 KB · Views: 153
Level 28
Joined
Jan 26, 2007
Messages
4,789
What I meant was an AoE starts from the center of Caster, therefore its radius would be 500 and diameter would be 1000.

I have attached a ................... drawing to get a better understanding

attachment.php


As you can see by the whole drawing, the AoE is 1000 but the distance from the Caster to the end is 500 (radius)

We're talking about the same thing, only Caster's position is different in our own thoughts
But... that's not how Blizzard works. (Ah, good old Blizzard logic!)
If you input "1000" in the "Stats - AoE" field, then the diameter is 2000 and the radius 1000.

Also, when you said the AoE is 1000 from the center of the caster, I thought you meant "from the center of the caster to the side of the circle" (which, again, means that the distance from the center to the side is 1000, so the radius is 1000) :p
 
Status
Not open for further replies.
Top