Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
anthonyfromtheuk

Use Camera to show position in game

Recommended Posts

I have a NPC talking with the player about enemy positions and i would like the view to go to where he is talking about, and then for it to return to normal player control after

Player exec "camera.sqs";
;comment "15:18:56";  _camera camPrepareTarget [111849.77,43101.62,-13741.98];  _camera camPreparePos [16540.68,16141.82,4.47];  _camera camPrepareFOV 0.700;  _camera camCommitPrepared 0;

That is what I have tried but it just starts the camera script it doesn't go to the camera position what am i doing wrong here? Also is there a way to turn the camera off without the player doing anything once they have been shown the position?

Share this post


Link to post
Share on other sites

1. Use SQF instead of SQS

2. Where and how is the camera created?

3. Where are these lines?

Share this post


Link to post
Share on other sites

1. SQF does not work. 2. Ive no idea maybe thats the problem :D (though i thought it was created by Player exec "camera.sqs") 3. Those lines are in my script to for my NPCs briefing. Which is basically a whole load of this

NPC kbAddTopic ["conv", "Conversations\LookAround.bikb", "", ""];
NPC kbTell [Player, "conv", "sent1"];
openMap true;
((uiNamespace getVariable "RscDiary") displayCtrl 51) ctrlMapAnimAdd [0,0.05,getMarkerPos "CenterPos"];   ctrlMapAnimCommit ((uiNamespace getVariable "RscDiary") displayCtrl 51);

Edited by Anthonyfromtheuk

Share this post


Link to post
Share on other sites

SQF does work. SQS too, but it is deprecated. Don't ever mix them, thats the worst idea. (What you have been seemingly doing.) And learn SQF and go and use it. Forget SQS even existed.

exec command just executes (reads) what in a file is. YOU need to create your camera.

create a file called "camera.sqf"

_camera = "camera" camCreate [getPos player select 0, getPos player select 1,2];
_camera setDir (getDir player);
_camera cameraEffect ["INTERNAL","BACK"];
_camera camSetFocus [50, 0];

showCinemaBorder false; 
cameraEffectEnableHUD true;

_camera camCommit 0.1;

//camera is created above player. Now you can move it. Naturally you can create it where you want. Camcreate, and cameffect are the important commands
_camera camPrepareTarget [111849.77,43101.62,-13741.98]; 
_camera camPreparePos [16540.68,16141.82,4.47];  
_camera camPrepareFOV 0.700;  
_camera camCommitPrepared 0; 

Now exec this script by []execVM "camera.sqf";

I usually just _camera setPos instead of preparePos if my commit is 0.

Edited by zapat

Share this post


Link to post
Share on other sites

Ok thank you for your answer makes it all much clearer, much appreciated Zapat.

--- player cameraEffect ["terminate","back"]

camDestroy _camera ---- that gets rid of the camera but it stops my conversations running, script running the conversations and moving the map view around still working when cameras killed but no more talking. Why would that be?

Edited by Anthonyfromtheuk

Share this post


Link to post
Share on other sites
Sign in to follow this  

×