View unit's height

the Immortal

I know, I know...
Reaction score
51
I'm making an ability that can be casted only in water. To do so I need to check the 'height' of the unit and if it's below 0 to allow it to cast the spell. The question is how to check it?
I tried Crow Form - stuff, but the flying height isn't affected from the terrain deformations.

PS. Yes, I know I can do it via terrain check, but this won't work for my map
So, how to check it?
 
G

Goauld

Guest
Add and remove the crow form and use real comparison unit flying height. If this doesn't work then I can only think using regions if you don't want to use a certain tile for water parts.
 
P

Pawnable

Guest
Code:
Condition - Real Comparison

Something like that.... maybe a string.. not too sure about height.
 
L

LedZepplin

Guest
You could place a Terrain-Type everywhere there is water instead. Then check to see if the Unit is on the Terrain-Type and Add / Remove the Ability when necessary. Of course this is not exactly a perfect plan but it may suffice.
 

the Immortal

I know, I know...
Reaction score
51
You could place a Terrain-Type everywhere there is water instead. Then check to see if the Unit is on the Terrain-Type and Add / Remove the Ability when necessary. Of course this is not exactly a perfect plan but it may suffice.
->
Yes, I know I can do it via terrain check, but this won't work for my map
I use all terrains that look good for the water somewhere else in the map, so I will use this only if there is no other way.

Add and remove the crow form and use real comparison unit flying height. If this doesn't work then I can only think using regions if you don't want to use a certain tile for water parts.

->
I tried Crow Form - stuff, but the flying height isn't affected from the terrain deformations.
The flying height stays 0 but I can lift up and down the unit.

So any other ideas pls? :rolleyes:
 

Luth

Lex Luthor!
Reaction score
41
I think I remember something ... what was it? The caster system?

Yeah, maybe it was the Caster System (by vexorian I think) that had tools for detecting if you were in water or not. (You can get it at wc3campaigns.com)

I could be completely wrong, but its worth checking out anyway.
 
L

lmk1988

Guest
how about... some high lvl trigger stuffs. first create a dummy that can build building and create a building that can only be buildable in water. then in the trigger when u use this ability, create a dummy, order it to build near to your hero. Be sure to amke your building using scout tower as it will be easier because of its size when you build. Then if you the dummy is building, means your hero is in water! weee~ if it is not, then too bad... so you will need 1 dummy unit 1 dummy building 1 dummy skill 1 dummy trigger 1 dummy program.
 

xxxtrickyxxx

(o Y o)
Reaction score
64
is Z Height what your looking for? It detects the height of the unit from flat 0. And also can go negative.

Code:
Custom script:   set udg_LocZ=GetLocationZ(udg_Casting_Position)

LocZ being a real variable and Casting Position being a point variable where caster is.

Then use if then else for LocZ less than 0 or whatever. Thats all there is to it.
 

Chocobo

White-Flower
Reaction score
409
The answer is extremly hard, you should use Caster System if you are tired of rects and regions.


Here the steps to do with rects/regions.

1 - Create rects that is only in waters.
2 - For each rect you created, and them in a region we will call Region (Region variable).
3 - Create your trigger that is only castable on water. I will show you how to do that.

Code:
Cast Water
Events
Unit - Generic unit begins casting of an ability
----- Yes, begins and not casting, else it will cooldown later. -----

Conditions
(Ability being cast) Equal to Water Cast

Actions
Set Temp_Point = (Position of (Triggering unit))
If (All Conditions are true), Then (Then Actions), Else (Else Actions)
      If (All Conditions are true)
             (Temp_Point is in Region) Equal to False
             ----- Returns False, not in the region -----
      Then (Then Actions)
             Unit - Order (Triggering unit) to Stop
      Else (Else Actions)

Code:
Cast Water
Events
Unit - Generic unit starts the effect of an ability

Conditions
(Ability being cast) Equal to Water Cast

Actions
----- Do whatever -----
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top