| 07-07-2009, 01:02 PM | #1 |
How do you keep a projectile in a straight line, rather than it dropping under cliffs. |
| 07-07-2009, 01:03 PM | #2 |
Checking its position everytime, setting the height to Terrain Height + Unit Fleight Height. |
| 07-07-2009, 09:03 PM | #3 |
I have the same problem, but I don't understand what you mean... |
| 07-07-2009, 10:02 PM | #4 |
I meant, use a periodic timer and use this bj: GetLocationZ(). Its really awful to use BJs but there is no native doing that. Also check GetUnitFleightHeight() or how it was called, and convert them together, so the unit will everytime fly above the terrain with height x. |
| 07-07-2009, 10:39 PM | #5 |
Umm, GetLocationZ() is a native, not a bj... What you need to do in order for a unit to maintain constant height z is to periodically set the unit's flying height to (z-GetLocationZ(GetUnitPosition(u))). Of course, that's just the general idea, in practice GetUnitPosition() would leak a location this way so we need to take steps to prevent that. Note that the unit should not be a flying unit since the flying height of flying units gets smoothed over rapid terrain height changes, use the hover movement type instead; you may need to use the Crow Form trick to be able to change the flying height of a hovering unit. |
| 07-08-2009, 07:12 AM | #6 | |
Quote:
... about the native: How can it be a native, if it requires a location instead of 2 reals, while there is no other native doing it? (All need realX and realY). Additionally, the JassHelper colours it red, marking it as BJ. |
| 07-08-2009, 08:04 AM | #7 | |
Quote:
[/EndOfDiscussion] |
| 07-08-2009, 09:34 AM | #8 | |
Be aware there are some issues maintaining a constant height near cliffs. You need to change the unit's Z sampling settings in the object editor. I forget exactly what the options are, but I think you want one sample point with a range of 0. Quote:
GetLocationZ is a native. http://jass.sourceforge.net/doc/api/...rce.shtml#1001 Looking things up helps us not look stupid! *Crowd gasps* |
| 07-08-2009, 09:59 AM | #9 | ||||
Quote:
Quote:
Quote:
Quote:
|
| 07-08-2009, 02:34 PM | #10 |
Sry I'm only familiar to GUI. |
| 07-08-2009, 09:11 PM | #11 | |
Quote:
|
