Requirements:
- Basic knowledge camera scripting
- Original copy of PC CDROM game Operation Flashpoint or Flashpoint Resistance.
What this script is
This script allows you to attach a camera to a vehicle. It can be used to attach a camera to any object or any position relative to that object in the game.
E.g. you can show the driver position, cargo position, roof cam, wheelcam…
In a "normal" camera script there are two essential commands:
Camsetpos : Sets the x,y,z position of the camera in the world
Camsettarget : Points the camera at the object
In logic-cam these two positions are replaced by the positions of two gamelogics (automatically created in the script) then logic-cam sets the x,y,z positions of both gamelogics relative to the vehicle via a constant loop and a setpos command.
I suggest you try the
Demo mission(6min), it contains about 50 different examples how to use logic-cam. It shows you a roofcam, bumpercam, wheelcam, drivercam, cargocam, gunnercam and many many others… You don't need addons, simply load the mission in the editor, and then click on 'preview' to see it in action.
Let me know what you think.
here is the script
;Logiccam1.0
;author <Blanco>
;created 25/02/2004 5:07:54
;________________________
;::::::::::::::::::::::::
startglcam = true
_camid = _this select 0
_tgt = _this select 1
_gl1prop = _this select 2
_tgt2 = _this select 3
_gl2prop = _this select 4
_setvof = _this select 5
_gl1 = "logic" camcreate getpos _tgt
_gl2 = "logic" camcreate getpos _tgt2
#loop
?!(startglcam) : goto "endcam"
_tgtdir = getDir _tgt + (_gl1prop select 0)
_tgtx = getPos _tgt select 0
_tgty = getPos _tgt select 1
_tgtz = getPos _tgt select 2
_tgtxdir = _tgtx + (_gl1prop select 1)* (sin _tgtdir)
_tgtydir = _tgty + (_gl1prop select 1)* (cos _tgtdir)
_tgtdir2 = getDir _tgt2 + (_gl2prop select 0)
_tgtx2 = getPos _tgt2 select 0
_tgty2 = getPos _tgt2 select 1
_tgtz2 = getPos _tgt2 select 2
_tgtxdir2 = _tgtx2 + (_gl2prop select 1)* (sin _tgtdir2)
_tgtydir2 = _tgty2 + (_gl2prop select 1)* (cos _tgtdir2)
_gl1 setDir _tgtdir
_gl2 setDir _tgtdir2
_gl1 setPos [_tgtxdir,_tgtydir,_tgtz + (_gl1prop select 2)]
_gl2 setPos [_tgtxdir2,_tgtydir2,_tgtz2 + (_gl2prop select 2)]
_camid camsetpos getpos _gl1
_camid camsettarget _gl2
_camid camsetfov _Setvof
_camid camcommit 0
goto "loop"
#endcam
@!(startglcam)
deletevehicle _gl1;deletevehicle _gl2
exit
PS : Check the
README !
PS2 : If this belongs in the Editing/Scripting: Sound & Cutscenes board, please move it.