• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Height Comparisons

Status
Not open for further replies.
Level 10
Joined
Sep 21, 2007
Messages
517
Alright guys, i have a technical question here, this has always baffled me...
Basically lets say a missile has a height, then i got the LocationZ of the missiles x and y coords + collision size (added to each x and y coord) to identify collision. Now here is hte part that doesnt work for me, basically, when i compare the missiles current height and the Locations height (yes i used GetLocationZ), it never works, the missile just flys over the location even though its height is larger? wtf?!? lool been such a long time and this constantly happens, help plx ;) and of course il +rep ^^
 
Maybe because X & Y are defined through a GetUnit function, while Z is defined through GetLocation one? How did you make the comparison?
  • Trigger
  • Events
    • Time - Every 0.03 seconds of game-time
  • Conditions
  • Actions
    • Set Point1 = (Position of (Dummy))
    • Custom script: set x = GetLocationX(udg_Point1)
    • Custom script: set y = GetLocationY(udg_Point1)
    • Custom script: set z = GetLocationZ(udg_Point1)
    • If (All conditions are true) then do (Actions) Else do (Actions)
      • If - Conditions
        • (Flying Height of (Dummy)) Less than z
      • Then - Actions
        • <Actions here>
      • Else - Actions
    • Custom script: call RemoveLocation (udg_Point1)
 
Level 10
Joined
Sep 21, 2007
Messages
517
GetLocationZ(Location(GetUnitX(u), GetUnitY(u))) >_<
u = unit for this.

btw does your trigger work fine, the z comparison i mean? cus i did it same way except of course its a bit diff cus i had to get unit x and y int and so forth (btw try using points only when needed, use getunitx/getunity)

Edit~~ maybe its because i set the points offset by a bit and got that location's Z, cus i do it like offset by collision size, but instead of using offset i do x + collision size, y + collision size

offtopic: i always see you helping out people, gj, everytime i come to help i see you solved the problem ;)
 
Level 10
Joined
Sep 21, 2007
Messages
517
yea i never said i wanted to include the units flying height, are you implying that i should compare the units flying height by the units flying height + the locations height?

btw guys +rep for both of you guys for trying, to help, the problem is problem with me >_<
 
Last edited:
Status
Not open for further replies.
Top