• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

[Trigger] Following Camera in height differences

Status
Not open for further replies.
Level 2
Joined
Aug 29, 2013
Messages
13
Hi Guys!
I need a trig allows camera follow the height differences of a unit. The problem born when my unit go on a higth walkable doodle like a tower, for the game is in the same level and the camera don't up.
Thanks a lot! :)
 
Level 2
Joined
Aug 29, 2013
Messages
13
Thanks very much
but i don't have jass knoledge.
I have paste jass script but when i test, game don't le me start the map.
Could you show me a example of "camera heigth " as variable?
Please :)
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,220
use custom scripts. One custom script per line and then put the action Wiet gave you just bellow it.

This is just about as GUI friendly as I can go. Just add an event and change the variable.
  • Untitled Trigger 002
    • Events
    • Conditions
    • Actions
      • Custom script: local unit u
      • Custom script: local location l
      • Custom script: local real z
      • Custom script: local real fly
      • Set your_unit = (Triggering unit)
      • Custom script: set u = udg_your_unit
      • Custom script: set l = GetUnitLoc(u)
      • Custom script: set z= GetLocationZ(l)
      • Custom script: set fly = GetUnitFlyHeight(u)
      • Custom script: call SetCameraFieldForPlayer(Player(0), CAMERA_FIELD_ZOFFSET, z + fly, 1 )
 
Level 2
Joined
Aug 29, 2013
Messages
13
For the first think thanks for the availability. ^_^
My unit is a Mur'loc, and i need to be amphibious, I don't want he walk on a tree...
 
If you want to be able to set the camera height to the exact height (or relative height) of the terrain, you will, apart from GetLocationZ(), also need a system that Bob666 made some time ago. Basically, warcraft uses some kind of weird interpolations to make the camera move smoothly across uneven terrain. What his system does is generate a camera map, which allows you to get the relative camera offset using a single function (if i remember correctly, it is simply called GetCameraZOffset). I don't have a link, but i know you can find it inside his FlightSim map.
 
Status
Not open for further replies.
Top