• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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