Here we go, It's based on the perimeter script...
_cameraid = _this select 0
_target = _this select 1
_height = _this select 2
_minheight = _this select 3
_radius = _this select 4
_steps = _this select 5
_speed = _this select 6
cuttext ["","Black out",0.00000001]
_stepsarray = []
_deg=0
_splitdeg=360/(_steps-1)
_newheight = _Height - _minheight
_inc = _newheight / _steps
endspin = false
_log = "logic" camcreate [getpos _target select 0,getpos _target select 1,(getpos _target select 2) + _height]
_pos=getpos _log
_px=_pos select 0
_py=_pos select 1
#createpositions
_steps =_steps -1
?(_steps < 0): goto "startcam"
_deg=_deg+_splitdeg
_posx= _px+(_radius*(sin(_deg)))
_posy= _py+(_radius*(cos(_deg)))
_height = _height - _inc
_stepsarray = _stepsarray + [[_posx,_posy,_height]]
goto "createpositions"
~(0.1 * _steps)
#startcam
_i = 0
cuttext ["","Black in",3]
_cameraid camsetpos (_stepsarray select _i)
_cameraid camsettarget _target
_cameraid camcommit 0
@camcommitted _cameraid
#Cycle
_cameraid camsetpos (_stepsarray select _i)
_cameraid camsettarget _target
_cameraid camcommit _speed
@camcommitted _cameraid
_i = _i + 1
?_i < (_this select 5) : goto "cycle"
endspin = true
;player globalchat format ["%1",_stepsarray]
deletevehicle _log
exit
You have to run the script in your camerascript by following parameters :
1) Camera ID , most people use _camera
2) Object to film
3) Height of the camera will start spinning
4) Height of the camera will stop spinning
5) Radius of the spiral in meters (use 1m for asort of flat spin)
6) Steps, the more the smoother
7) Speed of the spin.
First create your camera :
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal","back"]
...and run the script :
example :
[_camera,man1,50,1.6,4,50,1] exec "spin.sqs"
@endspin
This will make the camera start spinning 50m above the unit,the camera spins downward (in 50 steps) in a spiralmovement (4m radius). He will stop spinning when the camera is 1.6m above the ground.
Speed is 1, which is slow.
You need also @endspin to stop the script.
Bugs :
- When speed is high (like 0.1) , sometimes the camera make weird jumps. I don't think it's a problem with the script, cause I've seen it before in a normal camscript.
Now I'm working on a testdemo.