Jump to content

Set Camera distance & rotation??


noctara

Recommended Posts

Hi all,

 

As the topic title says, i am looking for a way to set the camera distance and the camera rotation in a script.

I would like to watch the playercharacter playing an animation from a certain view.

I would really appreciate if someone has an idea how i could set it up. So far I only found a few functions which are somehow connected to camera settings.

 

CameraAttachFX.

and

SetCameraTarget.

 

However, I don't really know how to use them, nor do I know whether those functions would help me at all with my little problem. :confused:

 

As a sidenote: I am still not very confident with the creation kit, so I hope this question doesn't sound stupid :whistling:

 

cheers and many thanks in advance

Link to comment
Share on other sites

Doesn't sound stupid at all. Please post if you find a good way to reliably do it :D

 

I've spent a good amount of time trying to figure out ways to set anything about the camera outside of 1st or 3rd person switch and other than the changesittingangle() thing used in the opening sequence.

 

I'm not currently pursuing it, but there is a way to make the player in control of a different actor. Imagine doing this, with an actor with an alpha of 0 (invisible), and AI controlling only that actor. As usual, you set PlayerAIDriven to true, disable player controls for a short interval, and they can sit back and watch the scene/animation. The actor that had the camera attached would respond to commands that force it to point in a particular direction. Be it translateto(translateto also has a portion helping you control the direction the object is facing), or another such technique.

 

Look at the Companion Cart mod. The author puts the dragonborn in the drivers seat of the cart, and puts you in charge of the horse. I have no idea how he does it, but if you made the horse transparent(and probably didn't use a horse since they suck at walking...), and controlled him with AI, how different from a fully controlled camera would that be?

 

It sounds like this isn't a huge priority for your particular project. I think, however, a relaible way to control the camera on a cutscene involving the player, but detached from the player, would be amazing for truely epic and flashy parts of well done quests. Even for a mod light on quests, wouldn't it be awesome to be able to control the players first glimpse at your new creations? a 3-5 second "cutscene" where you just had an invisible floating actor being dragged around with the camera attached would be pretty memorable. If it is reasonably simple, a mostly all in one custom package for example, it could even see widespread use as a way for modders to make easy epic trailers/showcases for their mods in one go.

 

References:

(probably requires that you game.SetPlayerAIDriven(true) see next entry. Disable player controls while the player is AI driven by the way.)

(I suspect this is how you switch controls to another actor, haven't tried though)

Looking forward to seeing what you come up with!

Link to comment
Share on other sites

Update:

 

So I tried to set up a simple framework for testing purposes. For me it seems the .setplayercontrols() function does not work the way I set it up :confused:

Here a short description of what I did:

 

1. made a new actor called TestMod02CameraMan

2. created a new Quest

3. set the aliases of the quest as: 1) Activator 2) Marker (for spawning the cameraman) 3) the player 4) the cameraman

4. added a script to activator to set the stage of the quest to 10 (where it spawns the cameraman and starts mainfunction of the questscript)

 

Everythings works well up to the actual function in the questscript. While running through all commands, it does not set the playercontrols to the cameraman.

 

I ll add the Questscript, so someone more experienced than me could help debugging it :biggrin:

(keep in mind i am still new to modding, so I might made some simple mistakes)

 

Scriptname TestMod02CameraSettingsScript extends Quest

 

import debug

import game

import utility

import Actor

 

ReferenceAlias Property TestMod02PlayerActor Auto

ReferenceAlias Property TestMod02CameraMan Auto

 

Function CameraRunning()

Game.ForceThirdPerson()

TestMod02CameraMan.GetActorRef().EnableAI(false)

Trace("CameraMan AI should be disabled")

 

If Game.GetPlayer() == TestMod02PlayerActor.GetActorRef()

Trace("Player = PlayerActor")

game.DisablePlayerControls()

Trace("PlayerControls disabled")

EndIf

 

game.SetPlayerAIDriven(true)

If Game.GetPlayer() == TestMod02PlayerActor.GetActorRef()

Trace("Player now AI driven")

endif

 

TestMod02PlayerActor.GetActorRef().SetPlayerControls(false)

 

If TestMod02PlayerActor.GetActorRef().GetPlayerControls() == false

Trace("Player not in control of PlayerActor")

Else

Trace("Player still in control of PlayerActor")

EndIf

 

TestMod02CameraMan.ForceRefTo(Game.GetPlayer())

;Game.SetPlayerAIDriven(false)

TestMod02CameraMan.GetActorRef().SetPlayerControls(true)

If TestMod02CameraMan.GetActorRef().GetPlayerControls() == true

Trace("Player controls CameraMan")

If Game.GetPlayer() == TestMod02CameraMan.GetActorRef()

Trace("Player = CameraMan")

game.SetCameraTarget(TestMod02PlayerActor.GetActorRef())

Trace("Camera should Face PlayerActor")

game.EnablePlayerControls()

Game.ForceFirstPerson()

EndIf

EndIf

endFunction

 

In the meantime I am going to fiddle around with keywords a bit, as i ve found something pointing to keywords as part of the solution.

btw I can add the logg if someone thinks it would help.

 

Again thanks for any input and cheers :thumbsup:

Link to comment
Share on other sites

Interesting, did any log stuff suggest the player control was ever transferred? Since I first saw that setplayercontrols function, I've wondered, do you have to set it to false on the previous controlled actor? If so, what do you do with the player controls in the meantime? Does it just auto switch for you? the page isn't much help on that. If you get stuck:

 

There are probably quite a few mods that mess with it, but one in particular SRM Companion Cart actually puts the player actor up on the cart has him just chill there, and puts the player in charge of the horse pulling the cart. This is the most direct example I can think of of an apparently working implementation of this. I hope you can dig something up :D If not maybe I'll take a look at it. I have an old version(a whole two weeks old...) and the new version of it, I don't know if there's any difference in the code in question.

Link to comment
Share on other sites

Well, the logg actually suggests everything is running correctly. Specifically it brings up the traces "Player controls camera man" & "player = cameraman". That is why am stuck :wallbash:

 

What happens ingame is, that the camera will detach from the player, caused by the "setPlayerAIdriven" function. However tha cam will stay just in front of the players face instead of in the face, so to say... u can see the arms and hands if u turn the camera (dont know how to explain it any better :biggrin: ). If player controls are enabled, u can still move the player around. Third person doesn't look any different.

 

----- See how I didnt bring up the word "cameraMan" yet ----- :whistling:

 

The .setplayerControls(false) part actually doesn't make any difference... it would look the same without.

 

I actually had a look at the srm companions mod... however i just scanned the scripts and quests for a few minutes. I couldn't find any relevant infos about camera settings or playercontrols.

 

I guess I will have a closer look at the mod again... and do some serious data mining on that topic :tongue:

Link to comment
Share on other sites

  • 1 year later...

Hey guys,

 

I realize this topic is about a year old now, but I stumbled across it as I was trying to tackle the problem myself. I have been doing a lot of experimenting with camera control and cutscenes and have gotten some good results.

 

I posted a new topic with some solutions to the problem: http://forums.nexusmods.com/index.php?/topic/951896-improved-cutscenes-with-cinematic-camera-fades-and-more/?hl=%2Bcamera+%2Bcutscene

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...