HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Camera Script

09-02-2009, 11:58 AM#1
Mendel
Hi,
i managed to make a 3rd camera view wich goes up and down when the unit is going up or down with it,
i am using this jass script to disable the auto z movement, and just place it at the height i wish, as you can see:
Collapse JASS:
function SetCameraZ takes real z returns nothing
    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

Trigger:
Custom script: call SetCameraZ (udg_CameraHeight)

now the problem i can't set different players different Z heights, how can i change it so it will work with different z for different players, let's say the Variable Z will be with 6 arrays, named CameraZ[1~6].
09-02-2009, 12:20 PM#2
Anachron
Collapse JASS:
if GetLocalPlayer() == YourPlayer then
    call SetCameraZ(height)
endif
09-02-2009, 12:34 PM#3
Mendel
huh? i don't know jass ^^ i copied this script from someone else
09-02-2009, 12:45 PM#4
Anachron
New code:

Collapse JASS:
function SetCameraZ takes real z, player p returns nothing
    if GetLocalPlayer() == p 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

Trigger:
Custom script: call SetCameraZ (udg_CameraHeight, Player(0))
09-02-2009, 01:38 PM#5
Mendel
Thx! it works :D