Sooda
Diversity enchants
- Reaction score
- 318
I have done "system" what allows with two simple custom script to change player camera view and make it follow unit what you want. All camera settings are customizable. This is concept by Blizzard Entertainment what they used in
Azeroth Grand Prix map. The famous racing game with third person camera view.
Now it' s very simple to manipulate with player camera. Supports 12 players.
There isn' t README in map itself because of bugs with JNGP and TESH made it unable to save README within map. Thats why I can' t fix that spelling error also (consept should be concept). You have to use this as reference here:
Azeroth Grand Prix Camera System version 1.00
by Sooda (www.thehelper.net)
Credits for concept goes to Blizzard Entertainment. This system is based off of
Azeroth Grand Prix map.
1.0 World Editor Requirements
1.1 How to setup system
1.2 How to use custom functions
1.2.1 function STPC_Blizzard_SetCameraCustomValues
1.2.2 function STPC_Blizzard_ApplyCustomCameraToUnit
1.0 World Editor Requirements
This system needs vJASS parser called JassHelper. You can get it from Jass NewGen Pack:
http://www.wc3campaigns.net/showthread.php?t=90999
or just google/ search from net.
1.1 How to setup system
Create new trigger and name it "STPC Blizzard Custom Camera View" (Without ""
and be careful trigger name is case sensitive. So don' t write
"StPc BlIzZaRd CuStOm CaMeRa ViEw" or "STPC BLIZZARD CUSTOM CAMERA VIEW".).
Convert that newly made trigger to custom text (Edit > Convert To Custom Text).
After that delete everything what you see there and copy paste
"STPC Blizzard Custom Camera View" trigger content into newly made trigger.
Save map twice or how many times you have to do it (So it gets saved correctly)
and start using system.
1.2 There are available two custom functions one is for applaying custom
camera to unit and another is to change settings of custom camera view.
1.2.1 STPC_Blizzard_SetCameraCustomValues
Lets start from second custom function what allows you to set custom camera view:
STPC_Blizzard_SetCameraCustomValues is name of our functions. All things
what are between () after function name are called arguments. I will explane
what each argument will modify:
whichPlayer - is player whom settings you want to modify. It takes player
variable. If you made variable called "PlayerOne" (without "") then you have
to add prefix "udg_" (without ""). It will look now like this:
"udg_PlayerOne"
and you can use it like this in custom script:
Notice how we replaced whichUnit with our player variable called
"udg_PlayerOne" ?
cameraTargetDistance - is distance from camera source to camera target (object).
Camera source is point where player camera is at time. Camera target is your unit
what will be followed. It takes real variable. If you made variable called
"PlayerOneDistance" then you have to add prefix "udg_" (without ""). It will look
now like this:
"udg_PlayerOneDistance"
and you can use it like this in custom script:
cameraFieldOfView - The width that the camera can see. Changing this value
'zooms' the camera in and out (Credits to Darg from www.thehelper.net for that
sentence.).It takes real variable. If you made variable called
"PlayerFieldOfView" then you have to add prefix "udg_" (without ""). It will look
now like this:
"udg_PlayerFieldOfView"
and you can use it like this in custom script:
cameraRotationVelocity - determines speed how fast will camera turn where
camera target (object/ unit) is facing at that time moment. It takes real
variable. If you made variable called "PlayerRotationVelocity" then you have to
add prefix "udg_" (without ""). Keep in mind that it uses percentages where 1.00
means 100 % and 0.01 means 1 %. That percent is camera target current turning
speed. By default it is 30 % slower than unit current turning speed. What means
it' s 1.30. It will look now like this:
"udg_PlayerRotationVelocity"
and you can use it like this in custom script:
cameraZOffSet - determines how high from ground will be camera all the time.
Keep in mind that it considers unit height from ground (current flying height of
unit) ground height. It keeps player view always behind or above of camera target
(object). It takes real variable. If you made variable called
"PlayerZOffSet" then you have to add prefix "udg_" (without ""). It will look
now like this:
"udg_PlayerZOffSet"
and you can use it like this in custom script:
cameraAoA - The angle that the camera is pointing towards the target (Credits
again to Darg). It works with degrees and 360.00 degrees would be behind of
unit while 0.00 would be front of unit. Default is 340.00 degrees what gives
good third person view feeling. It takes real variable. If you made variable
called "PlayerAoA" then you have to add prefix "udg_" (without "").
It will look now like this:
"udg_PlayerAoA"
and you can use it like this in custom script:
cameraFarZ - Total distance that the camera can see. Anything past is shown
as sky, or a horizon line (Credits to Darg once again). Though I' m not very
sure about it. Default is 5500.00. It takes real variable. If you made variable
called "PlayerFarZ" then you have to add prefix "udg_" (without "").
It will look now like this:
"udg_PlayerFarZ"
and you can use it like this in custom script:
applySettings - determines are new settings used. You can set it false to
change settings for player camera view but not applying them instantly. It
takes boolean variable. If you made variable called "PlayerApplySettings" then
you have to add prefix "udg_" (without "").
It will look now like this:
"udg_PlayerApplySettings"
and you can use it like this in custom script:
Now you are ready to start editing custom camera view settings with this
custom script. Keep in mind that all variables made from Variable Editor will
require "udg_" prefix before their actual name when using in custom scripts.
Though when you are using vJASS made variables they might (or mostly) don' t
use "udg_" prefix. Then make sure variable name what you want to use in
custom script is exactly written like it was declared.
For example if variable name is "sys_cameraTarg" (without "") then use it like
that and don' t add "udg_" prefix because it dosn' t need it.
1.2.2 STPC_Blizzard_ApplyCustomCameraToUnit
This function is much simpler than previous one.
STPC_Blizzard_ApplyCustomCameraToUnit is name of our functions. All things
what are between () after function name are called arguments. I will explane
what each argument will modify:
whichUnit - is unit what will be constantly followed by player camera view.
It takes unit variable. If you made variable called "PlayerWhichUnit" then
you have to add prefix "udg_" (without "").
It will look now like this:
"udg_PlayerWhichUnit"
and you can use it like this in custom script:
whichPlayer -
whichPlayer - is player whom camera view will start to follow unit.
It takes player variable. If you made variable called "PlayerOne" (without "")
then you have to add prefix "udg_" (without ""). It will look now like this:
"udg_PlayerOne"
and you can use it like this in custom script:
applyCamera - turns on and off unit following by player current camera. If it is
false player current camera will be reset over one second to default Warcraft
camera view. It takes boolean variable. If you made variable
called "PlayerApplyCamera" (without "") then you have to add prefix "udg_"
(without ""). It will look now like this:
"udg_PlayerApplyCamera"
and you can use it like this in custom script:
Now you are ready to start applying custom camera views to players with this
custom script. Keep in mind that all variables made from Variable Editor will
require "udg_" prefix before their actual name when using in custom scripts.
Though when you are using vJASS made variables they might (or mostly) don' t
use "udg_" prefix. Then make sure variable name what you want to use in
custom script is exactly written like it was declared.
For example if variable name is "sys_cameraTarg" (without "") then use it like
that and don' t add "udg_" prefix because it dosn' t need it.
end of README
Actual JASS from map itself:
This should not desync and if I find time and can solve issue with JNGP and TESH so I could add README into map it will be done. I suggest you all to check out test map what shows system in action. It is attached under my post (See attached files). Any comments ?
Azeroth Grand Prix map. The famous racing game with third person camera view.
Now it' s very simple to manipulate with player camera. Supports 12 players.
There isn' t README in map itself because of bugs with JNGP and TESH made it unable to save README within map. Thats why I can' t fix that spelling error also (consept should be concept). You have to use this as reference here:
Azeroth Grand Prix Camera System version 1.00
by Sooda (www.thehelper.net)
Credits for concept goes to Blizzard Entertainment. This system is based off of
Azeroth Grand Prix map.
1.0 World Editor Requirements
1.1 How to setup system
1.2 How to use custom functions
1.2.1 function STPC_Blizzard_SetCameraCustomValues
1.2.2 function STPC_Blizzard_ApplyCustomCameraToUnit
1.0 World Editor Requirements
This system needs vJASS parser called JassHelper. You can get it from Jass NewGen Pack:
http://www.wc3campaigns.net/showthread.php?t=90999
or just google/ search from net.
1.1 How to setup system
Create new trigger and name it "STPC Blizzard Custom Camera View" (Without ""
and be careful trigger name is case sensitive. So don' t write
"StPc BlIzZaRd CuStOm CaMeRa ViEw" or "STPC BLIZZARD CUSTOM CAMERA VIEW".).
Convert that newly made trigger to custom text (Edit > Convert To Custom Text).
After that delete everything what you see there and copy paste
"STPC Blizzard Custom Camera View" trigger content into newly made trigger.
Save map twice or how many times you have to do it (So it gets saved correctly)
and start using system.
1.2 There are available two custom functions one is for applaying custom
camera to unit and another is to change settings of custom camera view.
1.2.1 STPC_Blizzard_SetCameraCustomValues
Lets start from second custom function what allows you to set custom camera view:
Code:
Custom script: call STPC_Blizzard_SetCameraCustomValues(whichPlayer,cameraTargetDistance,cameraFieldOfView,cameraRotationVelocity,cameraZOffSet,cameraAoA,cameraFarZ,applySettings)
STPC_Blizzard_SetCameraCustomValues is name of our functions. All things
what are between () after function name are called arguments. I will explane
what each argument will modify:
whichPlayer - is player whom settings you want to modify. It takes player
variable. If you made variable called "PlayerOne" (without "") then you have
to add prefix "udg_" (without ""). It will look now like this:
"udg_PlayerOne"
and you can use it like this in custom script:
Code:
Custom script: call STPC_Blizzard_SetCameraCustomValues(udg_PlayerOne,cameraTargetDistance,cameraFieldOfView,cameraRotationVelocity,cameraZOffSet,cameraAoA,cameraFarZ,applySettings)
Notice how we replaced whichUnit with our player variable called
"udg_PlayerOne" ?
cameraTargetDistance - is distance from camera source to camera target (object).
Camera source is point where player camera is at time. Camera target is your unit
what will be followed. It takes real variable. If you made variable called
"PlayerOneDistance" then you have to add prefix "udg_" (without ""). It will look
now like this:
"udg_PlayerOneDistance"
and you can use it like this in custom script:
Code:
Custom script: call STPC_Blizzard_SetCameraCustomValues(udg_PlayerOne,udg_PlayerOneDistance,cameraFieldOfView,cameraRotationVelocity,cameraZOffSet,cameraAoA,cameraFarZ,applySettings)
cameraFieldOfView - The width that the camera can see. Changing this value
'zooms' the camera in and out (Credits to Darg from www.thehelper.net for that
sentence.).It takes real variable. If you made variable called
"PlayerFieldOfView" then you have to add prefix "udg_" (without ""). It will look
now like this:
"udg_PlayerFieldOfView"
and you can use it like this in custom script:
Code:
Custom script: call STPC_Blizzard_SetCameraCustomValues(udg_PlayerOne,udg_PlayerOneDistance,udg_PlayerFieldOfView,cameraRotationVelocity,cameraZOffSet,cameraAoA,cameraFarZ,applySettings)
cameraRotationVelocity - determines speed how fast will camera turn where
camera target (object/ unit) is facing at that time moment. It takes real
variable. If you made variable called "PlayerRotationVelocity" then you have to
add prefix "udg_" (without ""). Keep in mind that it uses percentages where 1.00
means 100 % and 0.01 means 1 %. That percent is camera target current turning
speed. By default it is 30 % slower than unit current turning speed. What means
it' s 1.30. It will look now like this:
"udg_PlayerRotationVelocity"
and you can use it like this in custom script:
Code:
Custom script: call STPC_Blizzard_SetCameraCustomValues(udg_PlayerOne,udg_PlayerOneDistance,udg_PlayerFieldOfView,udg_PlayerRotationVelocity,cameraZOffSet,cameraAoA,cameraFarZ,applySettings)
cameraZOffSet - determines how high from ground will be camera all the time.
Keep in mind that it considers unit height from ground (current flying height of
unit) ground height. It keeps player view always behind or above of camera target
(object). It takes real variable. If you made variable called
"PlayerZOffSet" then you have to add prefix "udg_" (without ""). It will look
now like this:
"udg_PlayerZOffSet"
and you can use it like this in custom script:
Code:
Custom script: call STPC_Blizzard_SetCameraCustomValues(udg_PlayerOne,udg_PlayerOneDistance,udg_PlayerFieldOfView,udg_PlayerRotationVelocity,udg_PlayerZOffSet,cameraAoA,cameraFarZ,applySettings)
cameraAoA - The angle that the camera is pointing towards the target (Credits
again to Darg). It works with degrees and 360.00 degrees would be behind of
unit while 0.00 would be front of unit. Default is 340.00 degrees what gives
good third person view feeling. It takes real variable. If you made variable
called "PlayerAoA" then you have to add prefix "udg_" (without "").
It will look now like this:
"udg_PlayerAoA"
and you can use it like this in custom script:
Code:
Custom script: call STPC_Blizzard_SetCameraCustomValues(udg_PlayerOne,udg_PlayerOneDistance,udg_PlayerFieldOfView,udg_PlayerRotationVelocity,udg_PlayerZOffSet,udg_PlayerAoA,cameraFarZ,applySettings)
cameraFarZ - Total distance that the camera can see. Anything past is shown
as sky, or a horizon line (Credits to Darg once again). Though I' m not very
sure about it. Default is 5500.00. It takes real variable. If you made variable
called "PlayerFarZ" then you have to add prefix "udg_" (without "").
It will look now like this:
"udg_PlayerFarZ"
and you can use it like this in custom script:
Code:
Custom script: call STPC_Blizzard_SetCameraCustomValues(udg_PlayerOne,udg_PlayerOneDistance,udg_PlayerFieldOfView,udg_PlayerRotationVelocity,udg_PlayerZOffSet,udg_PlayerAoA,udg_PlayerFarZ,applySettings)
applySettings - determines are new settings used. You can set it false to
change settings for player camera view but not applying them instantly. It
takes boolean variable. If you made variable called "PlayerApplySettings" then
you have to add prefix "udg_" (without "").
It will look now like this:
"udg_PlayerApplySettings"
and you can use it like this in custom script:
Code:
Custom script: call STPC_Blizzard_SetCameraCustomValues(udg_PlayerOne,udg_PlayerOneDistance,udg_PlayerFieldOfView,udg_PlayerRotationVelocity,udg_PlayerZOffSet,udg_PlayerAoA,udg_PlayerFarZ,udg_PlayerApplySettings)
Now you are ready to start editing custom camera view settings with this
custom script. Keep in mind that all variables made from Variable Editor will
require "udg_" prefix before their actual name when using in custom scripts.
Though when you are using vJASS made variables they might (or mostly) don' t
use "udg_" prefix. Then make sure variable name what you want to use in
custom script is exactly written like it was declared.
For example if variable name is "sys_cameraTarg" (without "") then use it like
that and don' t add "udg_" prefix because it dosn' t need it.
1.2.2 STPC_Blizzard_ApplyCustomCameraToUnit
This function is much simpler than previous one.
Code:
Custom script: call STPC_Blizzard_ApplyCustomCameraToUnit(whichUnit,whichPlayer,applyCamera)
STPC_Blizzard_ApplyCustomCameraToUnit is name of our functions. All things
what are between () after function name are called arguments. I will explane
what each argument will modify:
whichUnit - is unit what will be constantly followed by player camera view.
It takes unit variable. If you made variable called "PlayerWhichUnit" then
you have to add prefix "udg_" (without "").
It will look now like this:
"udg_PlayerWhichUnit"
and you can use it like this in custom script:
Code:
Custom script: call STPC_Blizzard_ApplyCustomCameraToUnit(udg_PlayerWhichUnit,whichPlayer,applyCamera)
whichPlayer -
whichPlayer - is player whom camera view will start to follow unit.
It takes player variable. If you made variable called "PlayerOne" (without "")
then you have to add prefix "udg_" (without ""). It will look now like this:
"udg_PlayerOne"
and you can use it like this in custom script:
Code:
Custom script: call STPC_Blizzard_ApplyCustomCameraToUnit(udg_PlayerWhichUnit,udg_PlayerOne,applyCamera)
applyCamera - turns on and off unit following by player current camera. If it is
false player current camera will be reset over one second to default Warcraft
camera view. It takes boolean variable. If you made variable
called "PlayerApplyCamera" (without "") then you have to add prefix "udg_"
(without ""). It will look now like this:
"udg_PlayerApplyCamera"
and you can use it like this in custom script:
Code:
Custom script: call STPC_Blizzard_ApplyCustomCameraToUnit(udg_PlayerWhichUnit,udg_PlayerOne,udg_PlayerApplyCamera)
Now you are ready to start applying custom camera views to players with this
custom script. Keep in mind that all variables made from Variable Editor will
require "udg_" prefix before their actual name when using in custom scripts.
Though when you are using vJASS made variables they might (or mostly) don' t
use "udg_" prefix. Then make sure variable name what you want to use in
custom script is exactly written like it was declared.
For example if variable name is "sys_cameraTarg" (without "") then use it like
that and don' t add "udg_" prefix because it dosn' t need it.
end of README
Actual JASS from map itself:
JASS:
globals
boolean array STPC_Blizzard_ActivateCamera
boolean array STPC_Blizzard_UseCustomValues
// Default
real STPC_Blizzard_CAMERA_FIELD_TARGET_DISTANCE = 700.
real STPC_Blizzard_CAMERA_FIELD_FIELD_OF_VIEW = 100.
real STPC_Blizzard_CAMERA_FIELD_ROTATION_VELOCITY = 1.3 // 1. = 100 %, .01 = 1 %
real STPC_Blizzard_CAMERA_FIELD_ZOFFSET = 100.
real STPC_Blizzard_CAMERA_FIELD_ANGLE_OF_ATTACK = 340.
real STPC_Blizzard_CAMERA_FIELD_ANGLE_OF_ATTACK_ALTERNATIVE = 300.
real STPC_Blizzard_CAMERA_FIELD_FARZ = 5500.
// Local player
real array STPC_Blizzard_CameraFieldTargetDistance
real array STPC_Blizzard_CameraFieldFieldOfView
real array STPC_Blizzard_CameraFieldRotationVelocity
real array STPC_Blizzard_CameraFieldZOffSet
real array STPC_Blizzard_CameraFieldAngleOfAttack
real array STPC_Blizzard_CameraFieldAngleOfAttackAlternative
real array STPC_Blizzard_CameraFieldFarZ
unit array STPC_Blizzard_CameraTarget
integer STPC_Blizzard_InstanceCounter = 0
real STPC_Blizzard_CameraTimerTimeout = .05 // 1. = 1 second
timer STPC_Blizzard_CameraTimer = CreateTimer()
trigger STPC_Blizzard_PanCameraTrig = CreateTrigger()
endglobals
function STPC_Blizzard_SetCameraCustomValues takes player whichPlayer, real cameraTargetDistance, real cameraFieldOfView, real cameraRotationVelocity, real cameraZOffSet, real cameraAoA, real cameraFarZ, boolean applySettings returns nothing
local integer playerIndex = GetPlayerId(whichPlayer)
set STPC_Blizzard_CameraFieldTargetDistance[playerIndex] = cameraTargetDistance
set STPC_Blizzard_CameraFieldFieldOfView[playerIndex] = cameraFieldOfView
set STPC_Blizzard_CameraFieldRotationVelocity[playerIndex] = cameraRotationVelocity
set STPC_Blizzard_CameraFieldZOffSet[playerIndex] = cameraZOffSet
set STPC_Blizzard_CameraFieldAngleOfAttack[playerIndex] = cameraAoA
set STPC_Blizzard_CameraFieldAngleOfAttackAlternative[playerIndex] = STPC_Blizzard_CAMERA_FIELD_ANGLE_OF_ATTACK_ALTERNATIVE
set STPC_Blizzard_CameraFieldFarZ[playerIndex] = cameraFarZ
set STPC_Blizzard_UseCustomValues[playerIndex] = applySettings
endfunction
library STPCBlizzardApplyCustomCameraToUnit
function STPC_Blizzard_ApplyCustomCameraToUnit takes unit whichUnit, player whichPlayer, boolean turnCameraOn returns nothing
local integer playerIndex = GetPlayerId(whichPlayer)
set STPC_Blizzard_ActivateCamera[playerIndex] = turnCameraOn
if (turnCameraOn) then
set STPC_Blizzard_CameraTarget[playerIndex] = whichUnit
if (STPC_Blizzard_InstanceCounter == 0) then
set STPC_Blizzard_InstanceCounter = STPC_Blizzard_InstanceCounter + 1
call TimerStart(STPC_Blizzard_CameraTimer,STPC_Blizzard_CameraTimerTimeout,true,null)
else
set STPC_Blizzard_InstanceCounter = STPC_Blizzard_InstanceCounter + 1
endif
else
set STPC_Blizzard_InstanceCounter = STPC_Blizzard_InstanceCounter - 1
if (GetLocalPlayer() == Player(playerIndex)) then
call ResetToGameCamera(1.)
endif
if (STPC_Blizzard_InstanceCounter <= 0) then
set STPC_Blizzard_InstanceCounter = 0
call PauseTimer(STPC_Blizzard_CameraTimer)
endif
endif
endfunction
endlibrary
library STPCBlizzardCustomCamera requires STPCBlizzardApplyCustomCameraToUnit
function STPC_Blizzard_ResetCameraTarget takes nothing returns boolean
local integer playerIndex = 0
local unit cameraTarget
local location cameraSourceLoc
local real cameraSourceZ
local real cameraFieldTargetDistance
local real cameraFieldFieldOfView
local real cameraFieldRotationVelocity
local real cameraFieldRotation
local real cameraFieldZOffSet
local real cameraFieldAngleOfAttack
local real cameraFieldAngleOfAttackAlternative
local real cameraFieldFarZ
local real cameraTimerTimeout = STPC_Blizzard_CameraTimerTimeout * 2.
local real cameraRotationTime
loop
exitwhen playerIndex > 11
if (STPC_Blizzard_ActivateCamera[playerIndex]) and (STPC_Blizzard_CameraTarget[playerIndex] != null) then
set cameraTarget = STPC_Blizzard_CameraTarget[playerIndex]
if (GetLocalPlayer() == Player(playerIndex)) then
set cameraSourceLoc = GetCameraEyePositionLoc()
endif
set cameraSourceZ = GetLocationZ(cameraSourceLoc)
call RemoveLocation(cameraSourceLoc)
set cameraSourceLoc = null
if (STPC_Blizzard_UseCustomValues[playerIndex]) then
set cameraFieldTargetDistance = STPC_Blizzard_CameraFieldTargetDistance[playerIndex]
set cameraFieldFieldOfView = STPC_Blizzard_CameraFieldFieldOfView[playerIndex]
set cameraFieldRotation = GetUnitFacing(STPC_Blizzard_CameraTarget[playerIndex])
set cameraFieldRotationVelocity = ( GetUnitTurnSpeed(STPC_Blizzard_CameraTarget[playerIndex]) * STPC_Blizzard_CameraFieldRotationVelocity[playerIndex])
set cameraFieldZOffSet = (STPC_Blizzard_CameraFieldZOffSet[playerIndex] + GetUnitFlyHeight(STPC_Blizzard_CameraTarget[playerIndex]) + cameraSourceZ)
set cameraFieldAngleOfAttack = STPC_Blizzard_CameraFieldAngleOfAttack[playerIndex]
set cameraFieldAngleOfAttackAlternative = STPC_Blizzard_CameraFieldAngleOfAttackAlternative[playerIndex]
set cameraFieldFarZ = STPC_Blizzard_CameraFieldFarZ[playerIndex]
else
set cameraFieldTargetDistance = STPC_Blizzard_CAMERA_FIELD_TARGET_DISTANCE
set cameraFieldFieldOfView = STPC_Blizzard_CAMERA_FIELD_FIELD_OF_VIEW
set cameraFieldRotation = GetUnitFacing(STPC_Blizzard_CameraTarget[playerIndex])
set cameraFieldRotationVelocity = (GetUnitTurnSpeed(STPC_Blizzard_CameraTarget[playerIndex]) * STPC_Blizzard_CAMERA_FIELD_ROTATION_VELOCITY)
set cameraFieldZOffSet = (STPC_Blizzard_CAMERA_FIELD_ZOFFSET + GetUnitFlyHeight(STPC_Blizzard_CameraTarget[playerIndex]) + cameraSourceZ)
set cameraFieldAngleOfAttack = STPC_Blizzard_CAMERA_FIELD_ANGLE_OF_ATTACK
set cameraFieldAngleOfAttackAlternative = STPC_Blizzard_CAMERA_FIELD_ANGLE_OF_ATTACK_ALTERNATIVE
set cameraFieldFarZ = STPC_Blizzard_CAMERA_FIELD_FARZ
endif
if (GetLocalPlayer() == Player(playerIndex)) then
call SetCameraTargetController(cameraTarget, 0., 0., true)
if ( GetCameraField(CAMERA_FIELD_TARGET_DISTANCE) != cameraFieldTargetDistance ) then
call SetCameraField( CAMERA_FIELD_TARGET_DISTANCE, cameraFieldTargetDistance, cameraTimerTimeout )
endif
if ( GetCameraField(CAMERA_FIELD_FIELD_OF_VIEW) != cameraFieldFieldOfView ) then
call SetCameraField( CAMERA_FIELD_FIELD_OF_VIEW, cameraFieldFieldOfView, cameraTimerTimeout )
endif
if ( GetCameraField(CAMERA_FIELD_ROTATION) != cameraFieldRotation ) then
call SetCameraField( CAMERA_FIELD_ROTATION, cameraFieldRotation, cameraFieldRotationVelocity )
endif
if ( GetCameraField(CAMERA_FIELD_ZOFFSET) != cameraFieldZOffSet ) then
call SetCameraField( CAMERA_FIELD_ZOFFSET, cameraFieldZOffSet, cameraTimerTimeout )
endif
if ( GetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK) != cameraFieldAngleOfAttack ) then
call SetCameraField( CAMERA_FIELD_ANGLE_OF_ATTACK, cameraFieldAngleOfAttack, cameraTimerTimeout )
endif
if ( GetCameraField(CAMERA_FIELD_FARZ) != cameraFieldFarZ ) then
call SetCameraField( CAMERA_FIELD_FARZ, cameraFieldFarZ, cameraTimerTimeout )
endif
endif
endif
set playerIndex = playerIndex + 1
endloop
return false
endfunction
endlibrary
//===========================================================================
function InitTrig_STPC_Blizzard_Custom_Camera_View takes nothing returns nothing
local integer arrayIndex = 0
loop
exitwhen arrayIndex > 11
// Local player
set STPC_Blizzard_CameraFieldTargetDistance[arrayIndex] = STPC_Blizzard_CAMERA_FIELD_TARGET_DISTANCE
set STPC_Blizzard_CameraFieldFieldOfView[arrayIndex] = STPC_Blizzard_CAMERA_FIELD_FIELD_OF_VIEW
set STPC_Blizzard_CameraFieldRotationVelocity[arrayIndex] = STPC_Blizzard_CAMERA_FIELD_ROTATION_VELOCITY
set STPC_Blizzard_CameraFieldZOffSet[arrayIndex] = STPC_Blizzard_CAMERA_FIELD_ZOFFSET
set STPC_Blizzard_CameraFieldAngleOfAttack[arrayIndex] = STPC_Blizzard_CAMERA_FIELD_ANGLE_OF_ATTACK
set STPC_Blizzard_CameraFieldAngleOfAttackAlternative[arrayIndex] = STPC_Blizzard_CAMERA_FIELD_ANGLE_OF_ATTACK_ALTERNATIVE
set STPC_Blizzard_CameraFieldFarZ[arrayIndex] = STPC_Blizzard_CAMERA_FIELD_FARZ
set STPC_Blizzard_ActivateCamera[arrayIndex] = false
set STPC_Blizzard_UseCustomValues[arrayIndex] = false
set STPC_Blizzard_CameraTarget[arrayIndex] = null
set arrayIndex = arrayIndex + 1
endloop
call TriggerRegisterTimerExpireEvent( STPC_Blizzard_PanCameraTrig, STPC_Blizzard_CameraTimer )
call TriggerAddCondition( STPC_Blizzard_PanCameraTrig, Condition (function STPC_Blizzard_ResetCameraTarget))
endfunction
This should not desync and if I find time and can solve issue with JNGP and TESH so I could add README into map it will be done. I suggest you all to check out test map what shows system in action. It is attached under my post (See attached files). Any comments ?