- Joined
- Jul 12, 2013
- Messages
- 128
Hi, Is there way to fix a camera height on a certain level ? So the camera won't go lower or higher as the terrain goes. Or is it possible to fix it for some regions ?
Probably the better solution, yes.Thanks, so I won't make so steep hills.
I wanted the trigger wich will set camera height for X and the height will be X wherever you're looking at high hill or deep hole in the ground. So in factthe camera won't be following terrain. But your trigger wich you posted here might be useful later on. I already give up that idea. I redesigned my map so the camera won't move down.
A periodic triggers will only get you to a certain point. Especially since camera data in multiplayer only get updated every 0.1 seconds, the camera will start "shaking" and "bouncing" in multiplayer.I'm not sure exactly what you mean then. Do you want the camera to stay the same height no matter what?
If you are willing to have a periodic trigger running constantly it can be achieved.
Only works for locked cameras, unfortunately and even then it's not 100% perfect, as the camera height will still get interpolated.Alrighty.
Though if you have the camera locked to a unit you can actually pretty easily get the wanted effect by getting the Z location of the camera locked unit and adjust the camera height accordingly.
This is extremely hard to make, as the camera height by wc3 default will be interpolated and smoothed based on the height map.
You need to find out the correct algorithm of the wc3 default camera height interpolation, create a mathematical grid based on the entire height map and then apply the required offset to counter the interpolation.
So basicly, unless you are very experienced with coding in JASS, it's impossible.
function SetCameraZ takes real z returns nothing
// Thanks to Toadcop for this function.
set z = GetCameraField(CAMERA_FIELD_ZOFFSET)+z-GetCameraTargetPositionZ()
call SetCameraField(CAMERA_FIELD_ZOFFSET,z,- 0.01)
call SetCameraField(CAMERA_FIELD_ZOFFSET,z,0.01)
endfunction
Damn! I didn't know this baby existed! Why is it graveyarded if it works?^This. You may want to look into:
http://www.hiveworkshop.com/forums/graveyard-418/getcamoffset-131434/
(check the flight sim too, it is pretty nifty)
Damn! I didn't know this baby existed! Why is it graveyarded if it works?
Uuh. That's a very handy code
It's kinda sad that it has been graveyarded yeah. But if nazgul is inactive can't a mod just write something up and approve it?