Example: mirv_calcs: move camera around weapon origin - advancedfx/advancedfx GitHub Wiki

// save in movie making config folder as wpl.cfg, then exec wpl to enable.

mirv_calcs handle add localPlayer localPlayer
mirv_calcs handle add observerTarget observerTarget localPlayer

mirv_calcs handle add activeWeapon activeWeapon observerTarget 1

mirv_calcs vecAng add handleAttachment led activeWeapon led
mirv_calcs vecAng add handleAttachment muzzleFlash activeWeapon muzzle_flash
mirv_calcs vecAng add handleAttachment weaponHandR observerTarget weapon_hand_R

mirv_calcs vecAng add or weaponOr2 muzzleFlash weaponHandR
mirv_calcs vecAng add or weaponOr led weaponOr2

mirv_calcs vecAng add globalToLocal weaponLocal weaponOr activeWeapon

mirv_calcs vecAng add switchInterp weaponLocalSmooth weaponLocal activeWeapon observerTarget 0.5 0.5

mirv_calcs cam add current current
mirv_calcs vecAng add cam current current
mirv_calcs fov add cam current current


mirv_calcs handle add value invalid -1
mirv_calcs cam add smooth currentSmooth current invalid

mirv_calcs cam edit currentSmooth halfTime 1.0 // sets all half life time for vec (position), and (rotation), fov (field of view) to same value in seconds.

// Uncomment to set independently:
// mirv_calcs cam edit smooth halfTimeVec 1.0
// mirv_calcs cam edit smooth halfTimeAng 1.0 // Tip: Use 0 value to disable smoothing, or use e.g. 0.1 value for lower delay and less smoothing.
// mirv_calcs cam edit smooth halfTimeFov 1.0

mirv_calcs vecAng add cam currentSmooth currentSmooth
mirv_calcs fov add cam currentSmooth currentSmooth


mirv_calcs vecAng add offset weaponLocalOfs weaponLocalSmooth currentSmooth 1

mirv_calcs vecAng add localToGlobal weaponFinal weaponLocalOfs activeWeapon

mirv_cam source calcVecAng weaponFinal

mirv_cam order default
mirv_cam order move input 0
mirv_cam order move camSource 1

mirv_input cfg offsetMode
mirv_input cfg offsetMode ownLast
mirv_input cfg ksens 0.25
mirv_input cfg msens 0.05
mirv_input camera
mirv_input position 50 0 0
mirv_input angles 0 -179.9 0
mirv_input fov 90

spec_mode 5

echo +----------------------------------------------------------+
echo | Camera weapon_local_config_end enabled.
echo +----------------------------------------------------------+
echo | Camera is controlled by observer target.
echo | To quit this whole mode enter: weapon_local_config_end
echo +----------------------------------------------------------+

alias weapon_local_config_end "mirv_cam source calcVecAngClear; mirv_cam order default; mirv_input cfg offsetMode current; mirv_input end"

See also