OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Maclav on 17 Apr 2004, 21:27:09

Title: Return to mission after cutscene
Post by: Maclav on 17 Apr 2004, 21:27:09
How to return to the mission after a cutscene??

i exec this script:


player removeaction 0

_cam = "camera" camcreate [(getpos player select 0)+1,(getpos player select 1)+1,2]
_cam camCommand "inertia off"
_cam cameraEffect ["internal","back"]
_cam camcommit 0

showcinemaborder true
disableuserinput true

_cam camsettarget player
_cam camsetrelpos [5,3,2]
_cam camsetfov 1
_cam camcommit 7

~9

player playmove "EffectStandTalk"
titletext ["To jak z tymi broniami?","plain down",2]
player dowatch man

_cam camsettarget man
_cam camcommit 2

~4

man playmove "EffectStandTalk"
titletext ["Wybierz sobie jedną z tych. \n Cena wliczona w wynagrodzenie","plain down",2]
man dowatch player

~5

player switchmove ""
man switchmove "stand"
disableuserinput false
showcinemaborder false

destroycamera _camera

exit


everything works allright, but after the dialogs I cannot control my unit.
I tried to insert the camera from original scripts.sqs:

_ppos = getPos _this
_px=_ppos select 0
_pz=_ppos select 1
_camera = "camera" camCreate [_px+1, _pz+1, 2 ]
_camera camCommand "manual on"
_camera camCommand "inertia off"
_camera cameraEffect ["internal","back"]
; wait until destroy is forced or camera auto-destroyed
@cheat0 || _camera!=_camera
aP cameraEffect ["terminate","back"]
camDestroy _camera


But OFP shows me the sea and tells that it doeasnt know what is a _this

Plz help!!
Title: Re:Return to mission after cutscene
Post by: Planck on 17 Apr 2004, 21:42:52
There is no destroycamera command, the correct command is:

camDestroy


Planck
Title: Re:Return to mission after cutscene
Post by: Raptorsaurus on 18 Apr 2004, 03:27:19
End the camera script with these lines:

cameraEffect ["terminate","back"]
camDestroy _camera

The _this is only recognized if the script is called like so:

this exec "script.sqs"

or

unit exec :script.sqs"

if it is called using an array of elements:

[unit1, unit2] exec "script.sqs"

then you would need

_a = _this select 0
_b = _this select 1

at the start of the script.
Title: Re:Return to mission after cutscene
Post by: Maclav on 18 Apr 2004, 21:18:18
thx a lot i`ll try.....
Title: Re:Return to mission after cutscene
Post by: Maclav on 18 Apr 2004, 21:21:59
ok... everything`s alright. Thanx again!