Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
I assume you know JASS. The function GetLocationZ takes a location and returns how high the terrain is at that point. Setting the camera height to <height>-GetLocationZ(<point in terrain>) sets it to an absolute value.
You can have an if then else function, which detects whether the height of the GetLocationZ is less than the normal height you have through that Jass function for the GUI "Camera - Set Player 1 (Red) Far Z to <value>". If it returns a lower value indeed, then set the height to the default height of yours.
That would all be good for normal terrain, but mine has got high narrow "corridors" on which you cannot use Location - Target of current camera view... Thanks for trying anyways...
I know that... But I am thinking is there any efficient way to find lowest point in current camera window... I was "meditating" over this a long time and have found no solution. There is alternative though with using transparent tiles.
Ah - I see what you mean. It is possible using lots of complex maths, but I don't know what the maths is and I bet you'd have no end of problems trying. If you know someone who is awesome at maths, ask them, otherwise, use your workaround, whatever it is.
I don't think you should try a more efficient way, when you can track this via GetCameraTargetPositionZ function.
You can load this function in the map initialization (or at a point, where this real returns a stable value, which depicts the Z of the ground with no cliffs or ground deformations.
Then, you can run a periodic event, which will track every 0.03 the Z of the ground. Since (I guess) you are using a locked camera on unit, you can find at the point you want the (NormalZ - LowZ), so that, once the Z value of the camera target becomes less than or equal than that (NormalZ - LowZ), the camera's Z will not be applied. In the end, you will have something like
JASS:
if GetCameraTargetPositionZ > (NormalZ - LowZ) then
set LocZ_Camera = (GetLocationZ(<point>))
else
set LocZ_Camera = (NormalZ)
endif
The LowZ is the Z of the ground you don't want the camera to fall.
How come? There is also something more you can try, since this pic i can see is based off cliffs and not ground deformations of "Lower" tool, the GetTerrainCliffLevel function. You might want to create a location offset by the target location of the camera (so that it detects the level of the ground before the actual camera target tracks it - and your camera won't fall in the end) and check it, combined with the system you used already (?)
Set CameraDistance = Target Z of current camera view
Camera - Set Distance to (<number of height what you want> - CameraDistance)
I may be wrong with the trigger names, coz i cant look at the editor atm but if you can figure out what i mean it will work.
i use it too.
Btw if you want you can make it in 2 triggers, so one will set the CameraDistance variable and one will set the ingame camera's distance
You can also make a new variable for the height so you can modify it later.
will correct my post if i can get to the pc where war3 is installed.
Yeah, I know it won't be "random". In the English language words can mean different things. I looked at it, yeah, but it won't work if GetLocationZ doesn't.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.