| 09-05-2007, 04:54 PM | #1 |
I have a few questions about the Z Axis and using it in WC3. 1. How do I move a unit on the Z axis without using SetUnitFlyHeight()? 2. How do I calculate the terrain height of where a unit is... 3. Does a method to solve #2 work with cliffs... 4. If not, then how could I? Any help would be appreciated with solving these dilemmas and rep will be distributed to those who help! |
| 09-05-2007, 05:03 PM | #2 |
1. There's not other way :( 2. GetLocationZ(GetUnitLoc(u)) 3. As far as I know, yes. |
| 09-05-2007, 05:04 PM | #3 |
ive heard differently about #1, but i have no clue, i heard some people talking about it in one of the PHysics engine threads out there. |
| 09-05-2007, 05:05 PM | #4 |
1. No there's no other way at least i don't know any other, well you could use invis platforms not sure how that would work 2. GetLocationZ() should work correctly with terrain height (be careful with terrain deformations, due they can cause desync when used this function while deformation) 3. what you mean with this? If you mean the automatical raising of flying units getting near cliffs, don't use flying units and you're fine 4. ... ---Edit--- Not fast enough again xD |
| 09-05-2007, 05:09 PM | #5 |
no, thats it, i dont want them to raise on cliffs OR normal terrain, i need to get terrain Z height so i can factor that out during calculation on my system |
| 09-05-2007, 10:09 PM | #6 |
if you are going to have a missle or something like that there is a missle system somewhere... you might wanna see how they handle cliffs ect |
| 09-05-2007, 11:55 PM | #7 |
To calculate the Flying Height so u ignore cliff heights, look at the figure below. It is also the true form of cliffs (the red line) the cliff tat is visible to you in game, is just a model tat covers the actual terrain. explaination of figure: Yellow arrow : Flying height gray lines : absolute terrain height. Remember that the gray line with height 0 can be higher if tat line is not the lowest cliff level. green arrow: Indicates when the sphere move from 1 point to another, and the flying height must change in order to maintain same height. in order to maintain Height you must do something like this to get the correct flying height of new location: JASS:local real AbsHeight = GetUnitFlyHeight(u)+GetLocationZ(GetUnitLoc(u)) local real NewFlyHeight = AbsHeight-GetLocationZ(Location(GetUnitX(u)+Sx, GetUnitY(u)+Sy)) Sx and Sy are the components of S in x and y axis. also this is just a simple concept |
| 09-06-2007, 02:40 AM | #8 |
my big question is how can i avoid the devil... SetUnitFlyHeight? |
| 09-06-2007, 02:56 AM | #9 |
Hey dude, check out the FPS mod forums, there is a program that builds a Terrain Height map in there. Might help you out. |
| 09-06-2007, 02:32 PM | #10 | |
Quote:
My big answer is you cant avoid it, its the only and ONLY way in wc3 You may have heard about SetUnitZ(u), but tat is not a native in wc3, its a function people make to simply do wat i told u above. So SetFlyHeight() is still involved |
| 09-06-2007, 03:05 PM | #11 |
I dunno I remember the time in which it was impossible to add spells to an spellbook. Could think of other examples but have no time. |
| 09-06-2007, 05:20 PM | #12 |
What exactly is "the devil" about SetUnitFlyHeight? |
| 09-06-2007, 08:08 PM | #13 | |
Quote:
I was wondering the same thing. |
| 09-06-2007, 08:17 PM | #14 |
Several 'impossibles' have been done (eg: replay detection), but they worked using work arounds, and I can't think of anything even remotely approaching something that could be a work around for not using SetUnitFlyHeight...thought I see no reason not to. |
| 09-07-2007, 11:57 AM | #15 |
I personnally dont like using SetUnitFlyHeight because the unit has to be treated like a flying unit which fly over cliffs, not through them, but for my system, i have to have to objects fly through (or impact for that matter) on the cliff and using SetUnitFlyHeight makes it harder because I had to add in extra calculations to make sure that it looks correct. Id rather just have a SetUnitZ rather than fly height because fly height takes into account terrain hight. |
