• 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.

[JASS] Two questions...

Status
Not open for further replies.
Level 8
Joined
Mar 3, 2009
Messages
327
1. What does GetCameraEyePositionZ() return? It doesnt have any paremeters like players or points, it's just like that.

2. The camera height in my cam/movement system is being influenced by cliffs and elevation and I don't want it to. What can i do?

thanks for any help
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
GoGoTauren said:
1. What does GetCameraEyePositionZ() return? It doesnt have any paremeters like players or points, it's just like that.

It returns the "z" coordinate of the local player's camera source. If you want to get a specific player's camera "z" then you would have to use local code within an if-statement:

JASS:
if GetLocalPlayer()==whichPlayer then
    set camZ=GetCameraEyePositionZ()
endif

GoGoTauren said:
2. The camera height in my cam/movement system is being influenced by cliffs and elevation and I don't want it to. What can i do?

I think there is some sort of smoothing factor that is applied (and can be manipulated) but I'm not sure where it is. I'll look through the editor and see what i can find.

I'm not sure, this may have something to do with it:

  • Melee Initialization
    • Events
    • Conditions
    • Actions
      • Camera - Change camera smoothing factor to 0.00
 
Level 8
Joined
Mar 3, 2009
Messages
327
1) thanks burb, thought so
2) thanks guys, should this do the trick?
JASS:
set udg_camheight = (100 + (GetLocationZ(temppoint[GetConvertedPlayerId(GetEnumPlayer())]) - GetCameraEyePositionZ()))

it comes up with a script error so could someone correct it? I don't see any problems xD
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Ah, you're right. I'm pretty sure there is a different option that allows you to manipulate the camera smoothing when it moves over terrain. This means that if the camera's target is in a narrow valley the surrounding terrain will not affect the height that the camera views it's target. From there it would just be a matter of adjusting the camera based on changes in the terrain.

I'll see what I can find.

GoGoTauren said:
it comes up with a script error so could someone correct it? I don't see any problems xD

What error? Since you use the udg_ prefix on your camheight variable, I'm going to assume you're making your variables in GUI (or perhaps the udg_ is the problem) in which case you need to add the prefix udg_ to temppoint.
 
JASS:
set udg_camheight=100+(GetCameraEyePositionZ()-GetLocationZ(temppoint[GetEnumPlayer()+1]))

seems right to me.

Edit: burb beat me to it, and he's right. If temppoint is a global then you need to use udg_ there too.

And what exactly is the formula you're trying to use? The one I gave you is 100+(camHeight-Elevation)
 
Status
Not open for further replies.
Top