• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

3rd Person Camera Help needed

Status
Not open for further replies.
Level 10
Joined
May 21, 2006
Messages
323
I have implemented a 3rd person Cam view into my map, a problem I had to deal with was that
the Z offset of the cam didnt moved with the unit, when the cammed unit moved to a higher or lower stage.

I tried to solve the problem through trigger it with Z of Cammed unit

Every 0.20 sek

If Z of Cammed Unit Greater than or equal to 0
and Less than 200

Set Z offset of Cam to Z of Point of Unit

The Problem is there that the Z of the cam is not the same Z as the Cammedunit

So i had to make more triggers

If Z of Cammed Unit Greater than or equal to 200
and Less than 300

Set Z offset of Cam to Z of Point of Unit - 100

...

If Z of Cammed Unit Greater than or equal to 1000
and Less than 1200

Set Z offset of Cam to Z of Point of Unit - 600



So my question is, if anyone knows an algorithm to calculate the perfect cam Height.

would be helpful
 
not all of it, you need a jass function to get the Z height which does not exist in gui rest can be done with gui variables:

all u need is 3 real variables, 2 for location (X and Y) and 1 for the z height and 1 location variable;

[trigger=trigger]
Untitled Trigger 020000000000000000
Events
Conditions
Actions
Set TempX = (X of (Center of (Playable map area)))
Set TempY = (X of (Center of (Playable map area)))
Set points = ((Center of (Playable map area)) offset by (TempX, TempY))
Custom script: set udg_r = GetLocationZ(points)
[/trigger]

you can use either the xy coordinates or unit location whatever works
 
Status
Not open for further replies.
Back
Top