• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

Who can help fix 3d camera?

Status
Not open for further replies.
Level 33
Joined
Jan 1, 2013
Messages
521
http://www.hiveworkshop.com/forums/pastebin.php?id=58n78u

This camera is really good. It doesn't rest against a landscape and quite comfortable in game. However there is a little problem. It works incorrectly after unit goes down from the cliff or in the pits. If he gets on top - camera works perfectly. Can someone fix this nasty bug? But please without Jass. Using custom scripts or standart triggers if it possible.
 
Level 10
Joined
May 21, 2006
Messages
323
Go to your Trigger List and click at the top of the list on the Map Symbol where you also find the title of your map, then copy this code into the trigger sheet on the right side (use at least nextgenpack 5d):

function SetCameraZ takes player whichPlayer, real z returns nothing
if ( GetLocalPlayer() == whichPlayer ) then
set z = GetCameraField(CAMERA_FIELD_ZOFFSET)+z-GetCameraTargetPositionZ()
call SetCameraField(CAMERA_FIELD_ZOFFSET,z,- 0.01)
call SetCameraField(CAMERA_FIELD_ZOFFSET,z,0.01)
endif
endfunction

After that you should be able to custom script trigger the function

Custom script: call SetCameraZ(udg_TempPlayer, udg_TempReal)

(TempPlayer and TempReal are variables, dont forget to write "udg_" before refering to them)

TempPlayer refers to the player whose camera gets manipulated and TempReal is the height the camera should exactly go to.
 
Level 33
Joined
Jan 1, 2013
Messages
521
I understead thi first part and made it. But dont uderstead what do here: "After that you should be able to custom script trigger the function

Custom script: call SetCameraZ(udg_TempPlayer, udg_TempReal)

(TempPlayer and TempReal are variables, dont forget to write "udg_" before refering to them)

TempPlayer refers to the player whose camera gets manipulated and TempReal is the height the camera should exactly go to"(
Because of my bad English( Can you please send screen how does it look?
 
Level 10
Joined
May 21, 2006
Messages
323
When you set height of your camera then use this Custom Script function.

  • Custom script: call SetCameraZ(udg_TempPlayer, udg_TempReal)
(TempPlayer = variable for the player)

For example: Set TempPlayer = Player 1

TempReal = Height of the Camera

For example: 300 or maybe you have a function to get the Z of the unit you are attaching the camera to.
 
Status
Not open for further replies.
Top