Home   Help Search Login Register  

Author Topic: Moving during a camera  (Read 871 times)

0 Members and 1 Guest are viewing this topic.

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Moving during a camera
« on: 05 Jun 2006, 03:53:05 »
I remember a very long time ago I some how stumbled upon how to make a camera and while the cutscene was moving be able to move your player at the same time. However now it seems I have forgotten how this is done.

So basicly I am asking how to enable the players movements while the player is being looked at through a camera.

Thanks for your help.
I like your approach, lets see your departure.
Download the New Flashlight Script!

Offline RichUK

  • OFPEC Patron
  • ****
  • Have fun!
Re: Moving during a camera
« Reply #1 on: 05 Jun 2006, 06:18:45 »
Well, I am pretty busy with some other stuff at the moment, so have no time to load OFP do any testing before posting this.

I think that this should little script that I have "knocked up" for you (entirely from memory) should work (within its design limitations):

Code: [Select]
;  camplayer.sqs
;  Script to call external camera view of player while player still has control of his movement.
;  call the script with:
;       [] exec "camplayer.sqs"
;  say from a trigger, for example when the player reaches a certain location.
;
;  nocam is a a global variable, initialized by setting it to false in your init.sqs, e.g.
;       nocam = false
;
;  When you want the player to be returned to a normal view,
;  use another trigger to set nocam to true, e.g.
;       nocam = true
;

; Set the camera to an external view of the player
player switchCamera  "EXTERNAL"

; .........................................
#camloop

?nocam : goto "myend"

~0.5

goto "camloop"
; .........................................


#myend

; Set nocam back to false again
nocam = false

~0.5

player switchCamera "INTERNAL"

~0.5

exit

Basically, this should have the effect of turning on an external camera behind the player (like what happens if the player presses one of the keypad number keys... possibly 0, I can't remember?), then when your second trigger fires, the loop is ended and the player is back to a normal view again.  Because the global variable nocam is set back to false again, before the script finishes, the same thing will happen again if the player (or whatever) activates the first trigger again.

It may not be what you are looking for (?) and it may be possible to do other tricks too, so sorry if there are any problems with (remembering that I have not tested it!).

PS: I do swith the camera EXTERNAL or INTERNAL (e.g. acting on a plane for example, although it could be a soldier, etc.) during a scripted cutscene for some of the scripts I have done, but I destroy the cutscence camera first, then re-create it again, after the relevant section of external/internal plane view.  I have not actually tried to do what you are proposing.


« Last Edit: 05 Jun 2006, 06:24:13 by RichUK »

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re: Moving during a camera
« Reply #2 on: 07 Jun 2006, 04:55:36 »
No but thanks for the help. I remember some how a long time ago I created a fixed camera and I remember moving my guy around even though the camera was a good deal away. I remember I could not look with the mouse or shoot but my guy could walk around.

Also it was not with a key-logging dummy camera created.
I like your approach, lets see your departure.
Download the New Flashlight Script!