OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma3 - Editing/Scripting General => Topic started by: Rytuklis on 27 Aug 2014, 19:10:33
-
Good evening,
I'm making a scene where I want the civilian to approach a checkpoint with a vehicle and disembark it. Then I want to teleport the civilian infront of the CSAT Soldier so they have a conversation, however I can't make the civilian facing the CSAT Soldier. I tried several methods, one is setting the azimuth of the marker I use to teleport the civilian to face the CSAT Soldier and then use civilian1 setdir getdir "tpciv" (marker name is tpciv). Does not work, he's facing away. Then I try to add another civlian in the distance and name him "dirforciv" and set the azimuth that would face the soldier. Then again I try to do civilian1 setdir getdir "dirforciv" and still can't get it to work. Can you tell me what's the problem? This is my entire code here:
; ****************************************************************
; Script file for Armed Assault
; Created by: TODO: Author Name
; ****************************************************************
showcinemaBorder false
_camera = "camera" camCreate [9292.85,20328.67,134.92];
_camera cameraEffect ["internal","back"]
;comment "19:26:23";
_camera camPrepareTarget [82711.22,-46332.73,13038.85];
_camera camPreparePos [9292.85,20328.67,134.92];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 4
titleCut ["Abderos, Altis. Present..","PLAIN DOWN"]
@camCommitted _camera
;comment "19:28:01";
_camera camPrepareTarget [82711.22,-46332.73,13038.91];
_camera camPreparePos [9285.59,20335.21,40.75];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 8
titleCut ["Abderos, Altis. Present..","PLAIN DOWN"]
@camcommitted _camera
cdrive = true
_camera = "camera" camCreate [9466.24,20100.10,0.58];
_camera cameraEffect ["internal","back"]
;comment "19:30:36";
_camera camPrepareTarget [-88646.07,742.99,113.76];
_camera camPreparePos [9466.24,20100.10,0.58];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0
@camcommitted _camera
;comment "19:32:00";
_camera camPrepareTarget civguer1
_camera camsettarget civguer1
_camera camPreparePos [9464.11,20097.19,0.90];
_camera camPrepareFOV 0.306;
_camera camCommitPrepared 12
@camcommitted _camera
civguer1 action ["eject", vehicle gcar1]
titleCut ["","BLACK OUT",3]
~3
civguer1 disableAI "MOVE"
civguer1 setdir getdir "dirforciv"
civguer1 setpos getmarkerpos "tpciv"
grd2 dotarget civguer1
titleCut ["","BLACK FADED",4]
~4
_camera = "camera" camCreate [9458.96,20098.70,1.59];
_camera cameraEffect ["internal","back"]
titleCut ["","BLACK IN",3]
;comment "19:45:56";
_camera camPrepareTarget [-25328.32,-69637.05,-27039.82];
_camera camPreparePos [9458.96,20098.70,1.59];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0
grd1 switchMove "Acts_ComingInSpeakingWalkingOut_5"
titlecut ["Show me your papers.","PLAIN DOWN"]
@camcommitted _camera
;comment "19:47:12";
_camera camPrepareTarget [-53012.51,96890.88,-14005.83];
_camera camPreparePos [9459.88,20093.61,1.76];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 8
@camcommitted _camera
-
EDIT: Nope... Still occurs..
-
sqs?... sqs!?... SQS!!!!
:D
Anyway, have you tried lookAt (http://www.ofpec.com/COMREF/index.php?action=details&id=646&game=All)? At least in my quick test it made unit turn to look another. Would look a bit more natural than setdir.
EDIT:
Also, you can't get the marker's dir with getDir, you need markerDir (http://www.ofpec.com/COMREF/index.php?action=details&id=647&game=All).
-
unit1 setDir [unit1, unit2] call BIS_fnc_dirTo
Did you try tge DirTo function ?
https://community.bistudio.com/wiki/BIS_fnc_dirTo
Also make sure the anination itself doesnt turn the unit in tge first keyframes , if it does offset it :)
-
LookAt worked for me, thanks!