# [Trigger]Getting a Unit's Location

#### Monky-Master

Level 5
Hello.

Currently, I'm trying to get a unit's Z location, but can't find a trigger for it.

What's supposed to happen is a unit will fire a projectile(The projectile is a unit)and once the projectile meets another unit, it checks it Z height, and if the Z height is equal to the projectile's, then it kills the unit.

The problem is that I can't find a trigger to detect Z height. If you can help, I'd appreciate it.

• Camera
• Events
• Time - Every 0.10 seconds of game time
• Conditions
• Actions
• Player Group - Pick every player in Player_Is_Here and do (Actions)
• Loop - Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• Zoomed[(Player number of (Picked player))] Equal to False
• Then - Actions
• Set Unit_Pan_Location[(Player number of (Picked player))] = (Position of Unit_Camera_Lock[(Player number of (Picked player))])
• Camera - Pan camera for Player_Camera_Bond[(Player number of (Picked player))] to Unit_Pan_Location[(Player number of (Picked player))] over 1.00 seconds
• Camera - Set (Picked player)'s camera Rotation to (Facing of Unit_Camera_Lock[(Player number of (Picked player))]) over 1.00 seconds
• Camera - Set Player_Camera_Bond[(Player number of (Picked player))]'s camera Distance to target to 500.00 over 0.40 seconds
• Camera - Set Player_Camera_Bond[(Player number of (Picked player))]'s camera Angle of attack to 330.00 over 0.40 seconds
• Camera - Set Player_Camera_Bond[(Player number of (Picked player))]'s camera Field of view to 200.00 over 0.40 seconds
• Camera - Set Player_Camera_Bond[(Player number of (Picked player))]'s camera Height Offset to 200.00 over 0.40 seconds
• Custom script: call RemoveLocation(udg_Unit_Pan_Location[GetConvertedPlayerId(GetEnumPlayer())])
• Else - Actions
• Camera - Lock camera target for (Picked player) to Unit_Camera_Lock[(Player number of (Picked player))], offset by (0.00, 0.00) using The unit's rotation
• Camera - Set (Picked player)'s camera Rotation to (Facing of Unit_Camera_Lock[(Player number of (Picked player))]) over 0.10 seconds
• Camera - Set Player_Camera_Bond[(Player number of (Picked player))]'s camera Distance to target to 0.00 over 0.40 seconds
• Camera - Set Player_Camera_Bond[(Player number of (Picked player))]'s camera Angle of attack to Snipe_Angle[(Player number of (Picked player))] over 0.40 seconds
• Camera - Set Player_Camera_Bond[(Player number of (Picked player))]'s camera Field of view to 0.00 over 0.40 seconds
• Camera - Set Player_Camera_Bond[(Player number of (Picked player))]'s camera Height Offset to 175.00 over 0.40 seconds
Also, I'd be grateful if someone could tell me what the Player Location leak in this is.
Location variable has not been removed: player))]
Location variable has not been removed: player))]
Location variable has not been removed: player))]

Is what it says in the leak checker

#### Hedgehog-king

Level 3

Events
Time - Every 0.25 seconds of game time

Conditions

Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units within 50.00 of (Position of PlayerHero[1]) matching ((Unit-type of (Matching unit)) Equal to Dummy Bullet Unit))) Greater than or equal to 1
Then - Actions
Special Effect - Create a special effect at (Position of PlayerHero[1]) using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
Unit - Kill PlayerHero[1]
Unit - Kill (Random unit from (Units within 60.00 of (Position of PlayerHero[1]) matching ((Unit-type of (Matching unit)) Equal to Dummy Bullet Unit)))
Else - Actions
Do nothing

#### Monky-Master

Level 5
I'm sorry, but I don't see how this solves my Z problem.
• Events
• Time - Every 0.25 seconds of game time
• Conditions
• Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• (Number of units in (Units within 50.00 of (Position of PlayerHero[1]) matching ((Unit-type of (Matching unit)) Equal to Dummy Bullet Unit))) Greater than or equal to 1
• Then - Actions
• Special Effect - Create a special effect at (Position of PlayerHero[1]) using Objects\Spawnmodels\Critters\Albatross\CritterBloo dAlbatross.mdl
• Unit - Kill PlayerHero[1]
• Unit - Kill (Random unit from (Units within 60.00 of (Position of PlayerHero[1]) matching ((Unit-type of (Matching unit)) Equal to Dummy Bullet Unit)))
• Else - Actions
• Do nothing

#### [email protected]

Level 10
to get locationZ you must use jass script.

JASS:
``GetLocationZ(somelocation)``
ex:
JASS:
``set udg_real = GetLocationZ(udg_ProjectilePoint)``