Does anyone know how to set a z value to ignore terrain? I'm trying
Variable - Set Destination = (Point((X of Horizontal destination), (Y of Horizontal destination), (9.0 - (Ground height at Horizontal destination))))
where the default height of the map is 8. so this should create a point that stays at the same point vertically even if its location is changed laterally so that it is over terrain with a different height. It wiggles, dammit! it will not stay at the same height no matter what I do, it's the weirdest thing.
Anybody see what I'm doing wrong/have a workaround? the idea of having z values be linked to terrain height is seriously stupid, I gotta say. I understand it's a tiling model rather than true 3d, but still. The math above should work around that, and it doesn't.
If I'm understanding you correctly, all you need to do is remove (Ground height at Horizontal destination) entirely from your Z calculation. If not, then try using this:
(Height Of Point(position) - Height At Point(position))
I haven't tested it, but going by the descriptions, Height Of Point includes the height of the terrain, Height At Point does not, which means Height Of Point minus Height At Point should give you the height of the terrain at the specified point, which you can then use to calculate the position it should be at to keep it at a level point at all times.
(height of point) returns a real value that is the distance from the ground to the point.
(height at point) returns the ground level, which is what you set when you set the 'base height' in the new map dialog.
So the height of point doesnt take into effect the height at point, it just takes into effect how far from the ground the point is.
By measuring the ground at point 1, and the ground height at point 2, and subtracting the two you SHOULD get the difference in height. If point 1 is the current pos of a projectile and point 2 is the next point in the trajectory, then by setting the height of the projectile to (x - ((height at 1) - (height of 2))) when it moves from point 1 to point 2 should produce a level trajectory of height 'x' , with no variation in height due to terrain. But it doesn't.
If point 1 is the current pos of a projectile and point 2 is the next point in the trajectory, then by setting the height of the projectile to ((height at 1) - (height of 2)) when it moves from point 1 to point 2 should produce a level trajectory, with no variation in height. But it doesn't.
Aha! I see what you're trying to do. Assuming the height the projectile is at is the height you want to keep it at, try this:
Height From Ground At Pos. 2 = (Height At 1 + Height Of 1) - (Height At 2)
That should keep it at a level height between the two points.
Yeah, basically I got a working FPS engine with everything, but the damn trace is based on the sine and cosine of the camera angle rather than tangents like I've seen in a lot of other such maps. It works dandy on level ground, but the projectiles dip and rise with the terrain if it's uneven. So I figure okay, i'll just subtract the difference in the ground heights and then voila, it will be a trace-LINE again rather than a trace-a-curvy-path. But nope.
I'm starting to wonder if it is a problem somewhere else in the trace trigger that's throwing off the measurements, but I can't for the life of me figure out what it is. I wanted to put the finished map out as a FPS/TPS engine for other people to use, but if neither of us can figure it out I guess I'll put up the unfinished map. Is just rather unprofessional putting out a broken/unfinished product.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Does anyone know how to set a z value to ignore terrain? I'm trying
Variable - Set Destination = (Point((X of Horizontal destination), (Y of Horizontal destination), (9.0 - (Ground height at Horizontal destination))))
where the default height of the map is 8. so this should create a point that stays at the same point vertically even if its location is changed laterally so that it is over terrain with a different height. It wiggles, dammit! it will not stay at the same height no matter what I do, it's the weirdest thing.
Anybody see what I'm doing wrong/have a workaround? the idea of having z values be linked to terrain height is seriously stupid, I gotta say. I understand it's a tiling model rather than true 3d, but still. The math above should work around that, and it doesn't.
If I'm understanding you correctly, all you need to do is remove (Ground height at Horizontal destination) entirely from your Z calculation. If not, then try using this:
(Height Of Point(position) - Height At Point(position))
I haven't tested it, but going by the descriptions, Height Of Point includes the height of the terrain, Height At Point does not, which means Height Of Point minus Height At Point should give you the height of the terrain at the specified point, which you can then use to calculate the position it should be at to keep it at a level point at all times.
Problem is that
(height of point) returns a real value that is the distance from the ground to the point.
(height at point) returns the ground level, which is what you set when you set the 'base height' in the new map dialog.
So the height of point doesnt take into effect the height at point, it just takes into effect how far from the ground the point is.
By measuring the ground at point 1, and the ground height at point 2, and subtracting the two you SHOULD get the difference in height. If point 1 is the current pos of a projectile and point 2 is the next point in the trajectory, then by setting the height of the projectile to (x - ((height at 1) - (height of 2))) when it moves from point 1 to point 2 should produce a level trajectory of height 'x' , with no variation in height due to terrain. But it doesn't.
Aha! I see what you're trying to do. Assuming the height the projectile is at is the height you want to keep it at, try this:
Height From Ground At Pos. 2 = (Height At 1 + Height Of 1) - (Height At 2)
That should keep it at a level height between the two points.
It's still wiggling. Less so, but wiggling nontheless. I give up for tonight. Toooo frustrating.
@BacklitAvenger: Go
Alright, I'll play around with it on my end a bit later tonight, see if I can get you a more definitive answer.
Yeah, basically I got a working FPS engine with everything, but the damn trace is based on the sine and cosine of the camera angle rather than tangents like I've seen in a lot of other such maps. It works dandy on level ground, but the projectiles dip and rise with the terrain if it's uneven. So I figure okay, i'll just subtract the difference in the ground heights and then voila, it will be a trace-LINE again rather than a trace-a-curvy-path. But nope.
I'm starting to wonder if it is a problem somewhere else in the trace trigger that's throwing off the measurements, but I can't for the life of me figure out what it is. I wanted to put the finished map out as a FPS/TPS engine for other people to use, but if neither of us can figure it out I guess I'll put up the unfinished map. Is just rather unprofessional putting out a broken/unfinished product.