HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

unit z value

07-14-2003, 03:18 AM#1
gurubvin
is there a way to get the z value for a unit? there's an x of point function, and a y of point function, but no z. if some1 knows of someway, either trig, or jass, id greatly appreciate some help. thanks
07-14-2003, 03:21 AM#2
Talila
i dont think the Z is an actual value in the game, its Unit fly height if its a flying type unit, the X, Y positions is just so the game knows where the units is on the map from a top down veiw, 2d, no Z.

Just a thought.

~Talila
07-14-2003, 03:37 AM#3
gurubvin
that's wat i was thinking too, but if you look at the lock unit part to unit, in animation, you'll see that that you can make a head look up at a higher unit. which means that wc3 must recognize z, but there's no function for it.

it seems like if you're using a point variable, wc3 will find the value with x,y,z. but if you're using coordinates to set a point it only uses x and y. still there must be a jass method or something around this.
07-14-2003, 01:36 PM#4
COOLer
there is Z value but its hard to get you must lock camra to a unit then get the camras z thats the high of the feet from the level 1 terrian.
07-14-2003, 01:52 PM#5
gurubvin
Thanks cooler. I would have preffered to do it a different way, but if i can't find nething else, that's a very feasible option. thank you.
07-14-2003, 04:53 PM#6
Ari
Unless you've actually gotten that to work in a game, I'm fairly sure that doesn't work. At least, it didn't work as of RoC - it's possible they've changed the code since then but without proof I'd be skeptical. I believe there was a program released that allows height data to be read in from a w3e file, and I've done some similar work, but I don't think there's a direct, trigger-based way to do what you want. OTOH, though I don't have tft yet, I understand you *can* get the cliff level via triggers.
07-14-2003, 08:24 PM#7
COOLer
this dose not work on hills or valles thogh only level terrain and ramps
07-15-2003, 12:00 AM#8
gurubvin
I tried it. It doesn't seem to work correctly in TFT either.

wat about jass? would it be possible to jass it? i haven't used it, so i don't know the full capabilities of text triggering, but would it allow access to other unit properties?

one guy posted that he grabbed distance from one unit to the next by using the pythagorean theorem. he said he used movement - height for the z value. i know this isn't available via gui trigs, but would u be able to access it via jass script?
07-15-2003, 01:03 AM#9
COOLer
terrain hight dose work But it gives you values pre clif hight as 1- 16 you you have to mulpluy by 100 to get Movement high for that clif level
07-15-2003, 02:39 AM#10
Ari
This isn't exactly the solution for everyone, since it's rather involved, but look at this post for some insight on how I got this to work:

http://www.wc3campaigns.com/forums/s...&threadid=9792

TheEpigoni has created a stand-alone program that does much the same thing, I believe. I'm not sure if he ever released it, though. It might profit you to go into the irc channel and find him there, or PM him, and try asking him about it.

Edit: ps - you'd multiply by 128, not 100.
07-15-2003, 11:57 AM#11
gurubvin
cooler: i thought you we're talking about the lock camera to target unit. i've tried the terrain height method. the main problem i found is that it will not work on ramps. aside from it not working on non-flat terrain.

Ari: I'm actually doing something similar to wat ur. the turn based strat thing. there's a guy that posted on ur boards, piro pion, i think, that described a method he used. i tried to contact him but his answer was slightly vague. have u gotten in touch with him at all?

Also for wct, have u added in the idea of an obstruction? i had the my attack system working out pretty well, till i terrained the map. then i realized that my trigs didn't take into account height, or doodads in the way of a melee attack.
07-15-2003, 04:36 PM#12
Ari
I'm pretty sure Piro's method won't work for your needs, since flying height is always the same regardless of terrain height. If I incorporate height, it will either use my system of reading in the w3e file to determine the height of a tile, or determine heights to the nearest cliff levelusing the new tft function. I'll be resuming work within a matter of days, so I'll start thinking about it some mroe then.

In terms of obstruction, I am incorporating it, but it's not for the fainthearted. Without knowing exactly how you are donig movement, it would be hard for me to know if my way could work for you. The gist of my method involves making a unit's starting square have a value equal to it's movement, and then restricting movement to those squares that have "range" values of greater than zero. Since squares with enemies (or obstacles) on them have values of zero, they're off-limits. Not sure if that made sense.
07-15-2003, 04:59 PM#13
dataangel
Why can't you do:

(Cliff level)*100 + flying height

That should give you the exact z value, unless of course you've implemented non-cliff terrain deformations.
07-15-2003, 05:05 PM#14
Ari
I imagine he has implemented them :)
07-15-2003, 05:13 PM#15
COOLer
I just posted a message on battle net for Brett_Wood adressing our problem so who knows the may put( get z axis) on TFT next patch it should not be hard since the whole games in 3d and that the values are all stored in the map as Ari found out. Ps gj with that.

his reply
===========================================
3. Re: New idea for Brett_Wood in next TFT patch. | 7/15/2003 2:14:29 PM EDT


This has been brought up before. We did not and will not add script support for querying z-height of units or terrain because z-height is not a synchronous game state (for those who are skeptical on this point, trust me, it's not). Using the z-height for any triggers that affect the game state (which is basically all of them) would desync the game (i.e. drop everyone out).
==========================================

if you ask i under stand that unit z are not synchronous but terreain should be beacuse you load the map with the z values of terrain bulit IN to tiles ect.