Camera control - has anyone experimented with this?

Post » Fri Nov 16, 2012 9:18 pm

For several reasons, I'm finding that I want to be able to control the user's camera for things like short cutscenes. Unfortunately the CK (and the wiki) are obtuse when it comes to this.

1) Is there any documentation on how to utilize the CameraPath functionality as seen in the Creation Kit?
2) All of the current camera paths seem bound to killcam animations. Is there a way to define a new event by which a camera path would be utilized?
3) Has anyone used SetCameraTarget? How does it behave? Does it fix the camera in place, or does it allow you to move but keep the view locked on the object in question?

Thanks for any insight.
User avatar
Laura Elizabeth
 
Posts: 3454
Joined: Wed Oct 11, 2006 7:34 pm

Post » Fri Nov 16, 2012 9:58 pm

3) Has anyone used SetCameraTarget? How does it behave? Does it fix the camera in place, or does it allow you to move but keep the view locked on the object in question?
Thanks for any insight.

I have wanted to change the camera perspective in my mod, but didn't come up with the functionality I needed. I have used the SetCameraTarget - basically, it just makes the caerma focus on and follow the target. I used a horse in my testing, and it looked the same as watching the player in third-person, but instead it was following the horse.
User avatar
kyle pinchen
 
Posts: 3475
Joined: Thu May 17, 2007 9:01 pm

Post » Sat Nov 17, 2012 10:04 am

Then can you focus on an invisible actor that you control this actor's xyz positions and thus control the camera (some what)?


I have wanted to change the camera perspective in my mod, but didn't come up with the functionality I needed. I have used the SetCameraTarget - basically, it just makes the caerma focus on and follow the target. I used a horse in my testing, and it looked the same as watching the player in third-person, but instead it was following the horse.
User avatar
Marie Maillos
 
Posts: 3403
Joined: Wed Mar 21, 2007 4:39 pm

Post » Fri Nov 16, 2012 10:54 pm

Is it possible to make the player "inhabit" another actor? I seem to recall reading something about it.

If so, you could potentially use a pair of invisible butterflies. Stick the player's POV on one of them and the make the camer look at the other one. Set up a couple of spline translations and you should be able to make the camera do whatever you need.

Assuming we can do the POV switch of course.

(Maybe an AI controlled PC clone, and turn the real PC invisible and scale him/her down to nothing. Then translate the PC and the player can watch the clone doing the PC part in the cutscene...)
User avatar
TOYA toys
 
Posts: 3455
Joined: Sat Jan 13, 2007 4:22 am

Post » Sat Nov 17, 2012 10:03 am

i will be needing to do this very soon.

essentially what i plan on doing is using the player's body as a flying camera (hide first person geometry, and disable whatever controls/huds as possible). then translate the player's body to where i need it to go. making the player visible to the... player would involve dropping a clone of the player's base and shoehorning it into an alias to perform whatever AI duties in the scene. will most likely need to use SKSE to copy the player's currently worn items onto the clone
User avatar
Carlos Rojas
 
Posts: 3391
Joined: Thu Aug 16, 2007 11:19 am

Post » Sat Nov 17, 2012 2:22 am

Is it possible to make the player "inhabit" another actor? I seem to recall reading something about it.

If so, you could potentially use a pair of invisible butterflies. Stick the player's POV on one of them and the make the camer look at the other one. Set up a couple of spline translations and you should be able to make the camera do whatever you need.

Assuming we can do the POV switch of course.

(Maybe an AI controlled PC clone, and turn the real PC invisible and scale him/her down to nothing. Then translate the PC and the player can watch the clone doing the PC part in the cutscene...)

I've looked in to inhabiting another Ref, and from what I can tell that doesn't seem possible. However, assuming you don't mind moving the PC, you could use this method (invisible focus object) to pull it off.

Perhaps a generic "steadicam" camera control function library should be written?

Edit: Perhaps something like:

Camera.StartCameraFromRefToRef(ObjectReference StartRef, ObjectReference EndRef, float MoveTime, float StartAngleX = Game.GetPlayer.GetAngleX(), float StartAngleY = Game.GetPlayer.GetAngleY(), float StartAngleZ = Game.GetPlayer.GetAngleZ(), float EndAngleX, float EndAngleY, float EndAngleZ)


Camera.StartCameraFromRefToPosition(ObjectReference StartRef, float EndPosX, float EndPosY, float EndPosZ, float MoveTime, float StartAngleX = Game.GetPlayer.GetAngleX(), float StartAngleY = Game.GetPlayer.GetAngleY(), float StartAngleZ = Game.GetPlayer.GetAngleZ(), float EndAngleX, float EndAngleY, float EndAngleZ)

These would allow you to specify a starting reference (for instance, the PlayerRef itself, or some other ObjectReference, like an invisible marker), allow you to specify how long the camera shot should last and the end Reference or Position (depending on the function), which together would determine the shot speed. It also allows you to specify a start and end angle, and part of the function's job would be to rotate the camera from the start to the end angle as it moves along its path. Since we have to use the player in first-person mode to act as a camera, part of these function's jobs will be to store and recall the player's position after the camera shot is done, so that when the shot is over we can move him back where he started, none the wiser.
User avatar
victoria johnstone
 
Posts: 3424
Joined: Sat Oct 14, 2006 9:56 am

Post » Sat Nov 17, 2012 3:50 am

so after fiddling around, i successfully created a "possess and control another NPC" effect

basically set the npc to receive player input and set the player to ai driven. and set camera target on the npc (will control the NPC the exact same way as third person mode). this lets you control the npc in 3rd person while the player's body idles in the background. you will probably also want to throw in copious amounts of DisbalePlayerControls (hud and activation related especially), as well as set chargenmode to disable any chance of saving or waiting

the npc cannot attack or jump properly yet, nor can it activate anything because the camera still belongs to the player. (draws sword but immediately sheathes it, and if you jump it jumps in place while hovering for a few seconds)


but in any case, you can use this to create an invisible actor and "drive" them around as a fully dynamic boom crane (or even a player-controllable script-activated collision-compliant TFC equivalent...sort of), while sending idle animations to animate your player's husk.

note that if you fly the npc too far away from the player some strange things might happen



this script would also come in handy to possess enemies into suicide bombers and drive their bodies into their allies and kill them (I CALL DIBS ON THIS LOL)
User avatar
Dale Johnson
 
Posts: 3352
Joined: Fri Aug 10, 2007 5:24 am

Post » Fri Nov 16, 2012 8:05 pm

ActorBase Property Steadicam  AutoActor CameraEvent OnActivate(ObjectReference akActionRef) ; or use whatever event   Camera = (Game.GetPlayer().PlaceAtMe(Steadicam) as Actor)   ; use these three lines if you want player-controllable camera   Camera.SetPlayerControls(True)   Camera.EnableAI(False)   Camera.EnableAI(True)   ; this is the actual steadicam function   Game.ForceThirdPerson()   Game.SetCameraTarget(Camera)   Game.SetPlayerAIDriven(True)   Game.DisablePlayerControls(False, False, True, False, False, True, True, True) ; or use whatever set of booleans that you need, i just used these cause i was messing around with the possession effect)   Game.SetHUDCartMode(True)   Game.SetInChargen(True, True, False)     ; call your Player animation events and camera Translate functions on your steadicam here  - math and trigonometry not included, youre on your ownEndEvent

the Steadicam NPC should be a barebones actor using InvisibleRace or something similar

you will have to figure out on your own how to end the camera use and kill the steadicam, i left that out of the script because it really depends on what you want to do.


you can probably make custom killcams with this.
User avatar
Ellie English
 
Posts: 3457
Joined: Tue Jul 11, 2006 4:47 pm

Post » Sat Nov 17, 2012 1:25 am

SetPlayerControls - that was what I was thinking of.

Excellent work
User avatar
koumba
 
Posts: 3394
Joined: Thu Mar 22, 2007 8:39 pm

Post » Sat Nov 17, 2012 4:28 am

the only problem with the flying steadicam is that enemies will still try to attack it. might have to add the base actor to every faction, set invulnerable, set ghost and use mannequinStay package so it never talks or reacts to anything
User avatar
james reed
 
Posts: 3371
Joined: Tue Sep 18, 2007 12:18 am

Post » Sat Nov 17, 2012 8:07 am

you can also use this to create controllable summons. not sure if i can get them to melee attack, but certainly can script magic attacks

edit: holy crap, the controllable werewolf and troll summon works, with full melee attacks.... dragon, not so much

edit2: the dragon priest is $%^& awesome!

edit3: ok, i got the dragon to breathe fire on command. not sure how to get it to fly
User avatar
X(S.a.R.a.H)X
 
Posts: 3413
Joined: Tue Feb 20, 2007 2:38 pm

Post » Sat Nov 17, 2012 2:05 am

Now that you've got possession working, I will try to copy this method and then try to write some sort of usable steadicam API / function library this weekend.

In general, how do we want to drive multiple camera paths? Do we want to link them, and have the function try to get the next link in the chain or something?
User avatar
OTTO
 
Posts: 3367
Joined: Thu May 17, 2007 6:22 pm

Post » Sat Nov 17, 2012 11:14 am

Using this knowledge, would there be a way to remove horse directional movement based on mouse view?

I want to be able to spin the camera around while riding a horse, without it changing the horse's direction. Like how it was in Oblivion and Red Dead Redemption.
User avatar
lydia nekongo
 
Posts: 3403
Joined: Wed Jul 19, 2006 1:04 pm

Post » Sat Nov 17, 2012 1:53 am

In general, how do we want to drive multiple camera paths? Do we want to link them, and have the function try to get the next link in the chain or something?

If we're talking cutscenes and the like, we can probably make do with one spline path.
User avatar
matt oneil
 
Posts: 3383
Joined: Tue Oct 09, 2007 12:54 am

Post » Fri Nov 16, 2012 10:33 pm

Using this knowledge, would there be a way to remove horse directional movement based on mouse view?

I want to be able to spin the camera around while riding a horse, without it changing the horse's direction. Like how it was in Oblivion and Red Dead Redemption.

I'm with you there, I want that badly as well. I've been looking into it for some time, but no success so far. I mainly focused on messing around with Game/INI Settings that look to be related and Behaviour variables, but no luck yet. I didn't come further than disabling horses from turning but even then the camera was locked behind the horse.
User avatar
Jessie Butterfield
 
Posts: 3453
Joined: Wed Jun 21, 2006 5:59 pm

Post » Sat Nov 17, 2012 3:29 am

I'm with you there, I want that badly as well. I've been looking into it for some time, but no success so far. I mainly focused on messing around with Game/INI Settings that look to be related and Behaviour variables, but no luck yet. I didn't come further than disabling horses from turning but even then the camera was locked behind the horse.

What INI settings needed to disable mouse steering Maeg?
User avatar
marina
 
Posts: 3401
Joined: Tue Mar 13, 2007 10:02 pm

Post » Sat Nov 17, 2012 12:00 am

I haven't found any mate.

I think the key lies in animations/behaviour files though, not in INI/Game Settings. When sprinting the turn is very slow. If we find out what controls that, we can reduce it to 0 and make a copy of the original turning and only activate it through Papyrus when the keyboard buttons are used.

I haven't actually looked at the turning animation file itself yet. If the rotation is inside the animation it should be possible to pull off the above.
User avatar
Craig Martin
 
Posts: 3395
Joined: Wed Jun 06, 2007 4:25 pm

Post » Sat Nov 17, 2012 1:54 am

When sprinting the turn is very slow.

Interesting find, I never be aware of that, lol.

Awhile back, I found out that the turns in the behavior were 90* turns, the canned turns, 180*, etc... They require the horse to stop moving at that moment in order to turn. The turns while moving are probably something else because I didn't find the corresponding animation for turning whilst moving. Will look into it deeper

On the bright side thou, I think its possible to make horse walk backward, that would eliminate some of the awkward controls (hopefully)
User avatar
MarilĂș
 
Posts: 3449
Joined: Sat Oct 07, 2006 7:17 am

Post » Sat Nov 17, 2012 11:07 am

On Possession:

In my mod (Amazing Follower Tweaks) I added the ability for Vampires to posses follower bodies a few months back usng the commands above. My experience with this method:

While you are controlling the follower, the followers weapon drawn state is still controlled by the player. So for melee support, you have to use SendAnimationEvent(WeaponDraw) to the PC to get the follower to draw their weapon... but they can attack. As mentioned, the "Activate" pointer is still controlled by the PC. So your remotely controlled user can not activate anything. However they can ATTACK things. Unfortunately, followers are normally invisible to all other NPCs in the game world... so you need yet more event handlers and code to force combat using scripts if and when possessed followers attack people. Also, the follower is NOT the PC... Which means the PC doesn't get blamed for follower kills (no bounties)... yet more scripting needed. Also, most game triggers are explicitly designed for the PC. So normal story progressing game events dont fire while walking around as a possessed NPC. Finally, the game loads MAP DATA based on the location of the PLAYER... so if you take off running with a controlled NPC, the map degrades until you eventually fall off. How far you get depends on users LOD settings... For this reason, I just had possession end if the follower got far enough away from the PC to sheath their weapon (if they didn't do it manually).

So... to do possession properly, you need to clone the PC, then have the real PC become invisible and essentially tether them to the NPC so that the possessed NPC properly loads map data and can activate things. However, I didn't do all that because at the end of the day... everyone in the world would still talk to your possessed NPC like they were the dragon born. Finally, you dont get the possessed NPCs stats (unless you script all that).

On Camera Control:

That said, I think this discussion was originall about controlling the camera... for potential interactive cut scenes? Check out the tutorial on Scenes:

http://www.creationkit.com/Bethesda_Tutorial_Scenes


And then take a look at the quest RelationshipMarriageWedding. It is an example of a scene that controls the camera and involves the PC. Granted, it simply does 3rd person control of the PC (You can also force first person if you want), but as mentioned, you could also set the PC race to invisible race (using papyrus) and make a PC clone if you wanted to see the PC in a scene from a more unusual angle. Though first person perspective would probably be enough for most cut scenes. (A glimpse of the evil bad guy talking to his assistant... or whatever). This is far easier than trying to possess a different body.

Scenes can be injected into scripts, and then started and stopped using the Start and Stop method. Thus technically, you could activate a scene in almost any way imaginable (trigger, spell, dialogue, when you bump into someone... etc...). The most powerful thing about scenes is their ability to override any and all AI packages affecting the aliases in the scene.
User avatar
Brooks Hardison
 
Posts: 3410
Joined: Fri Sep 07, 2007 3:14 am

Post » Sat Nov 17, 2012 8:28 am

I have wanted to change the camera perspective in my mod, but didn't come up with the functionality I needed. I have used the SetCameraTarget - basically, it just makes the caerma focus on and follow the target. I used a horse in my testing, and it looked the same as watching the player in third-person, but instead it was following the horse.

Could this be implemented as some kind of bullet cam on an arrow or fireball?
User avatar
Julia Schwalbe
 
Posts: 3557
Joined: Wed Apr 11, 2007 3:02 pm

Post » Sat Nov 17, 2012 12:15 am

On Possession:

In my mod (Amazing Follower Tweaks) I added the ability for Vampires to posses follower bodies a few months back usng the commands above. My experience with this method:

While you are controlling the follower, the followers weapon drawn state is still controlled by the player. So for melee support, you have to use SendAnimationEvent(WeaponDraw) to the PC to get the follower to draw their weapon... but they can attack. As mentioned, the "Activate" pointer is still controlled by the PC. So your remotely controlled user can not activate anything. However they can ATTACK things. Unfortunately, followers are normally invisible to all other NPCs in the game world... so you need yet more event handlers and code to force combat using scripts if and when possessed followers attack people. Also, the follower is NOT the PC... Which means the PC doesn't get blamed for follower kills (no bounties)... yet more scripting needed. Also, most game triggers are explicitly designed for the PC. So normal story progressing game events dont fire while walking around as a possessed NPC. Finally, the game loads MAP DATA based on the location of the PLAYER... so if you take off running with a controlled NPC, the map degrades until you eventually fall off. How far you get depends on users LOD settings... For this reason, I just had possession end if the follower got far enough away from the PC to sheath their weapon (if they didn't do it manually).

So... to do possession properly, you need to clone the PC, then have the real PC become invisible and essentially tether them to the NPC so that the possessed NPC properly loads map data and can activate things. However, I didn't do all that because at the end of the day... everyone in the world would still talk to your possessed NPC like they were the dragon born. Finally, you dont get the possessed NPCs stats (unless you script all that).

On Camera Control:

That said, I think this discussion was originall about controlling the camera... for potential interactive cut scenes? Check out the tutorial on Scenes:

http://www.creationkit.com/Bethesda_Tutorial_Scenes


And then take a look at the quest RelationshipMarriageWedding. It is an example of a scene that controls the camera and involves the PC. Granted, it simply does 3rd person control of the PC (You can also force first person if you want), but as mentioned, you could also set the PC race to invisible race (using papyrus) and make a PC clone if you wanted to see the PC in a scene from a more unusual angle. Though first person perspective would probably be enough for most cut scenes. (A glimpse of the evil bad guy talking to his assistant... or whatever). This is far easier than trying to possess a different body.

Scenes can be injected into scripts, and then started and stopped using the Start and Stop method. Thus technically, you could activate a scene in almost any way imaginable (trigger, spell, dialogue, when you bump into someone... etc...). The most powerful thing about scenes is their ability to override any and all AI packages affecting the aliases in the scene.

chaging baseactor value on the player is asking for a ton of trouble (set invisiblerace on clone etc). it will work fine for vanilla settings but causes problems when custom race mods and other cosmetic mods are factored in

i solved the possession follower issue by making the PC's body become an ethereal follower, so while you are controlling the possessed character the PC's body follows you around and will load maps correctly, hit triggers etc.

i also attached a cloak spell to the possessed NPC's alias that casts a condition controlled AOE damage spell that inflicts just enough damage to valid surrounding actors to initiate combat (and allow the PC to control their melee attacks)


the same script above can be applied to the controllable or scriptable independent steadicam. it should not clone the player base, but drop in and possess a new baseactor created specifically as a camera
User avatar
Danel
 
Posts: 3417
Joined: Tue Feb 27, 2007 8:35 pm

Post » Sat Nov 17, 2012 10:52 am

Thankfully those issues shouldn't affect me, since my aim for this is to create a transparent, invisible camera to control cinematic events.

I wish I had more time. I really want to start writing functions for this.
User avatar
Nany Smith
 
Posts: 3419
Joined: Sat Mar 17, 2007 5:36 pm

Post » Fri Nov 16, 2012 8:24 pm

> chaging baseactor value on the player is asking for a ton of trouble

You store off the current race in a quest script variable, set the race to invisible and then set it back to whatever it was before when you are finished... Not sure what the problem is. If someone else's mod is sensitive to race change events, then it already has problems since this is exactly how werewolves work in the vanilla game. (see PlayerWerewolfChangeScript.psc). Granted, this approach requires a lot of scripting.... For example the werewolf script unequips weapons and spells and disables the ability to activate them, etc.... A Spell Effect or invisible armor might make more sense as they can be attached to the quest alias using the gui, minimizing the amount of scripting needed.

Anyway, don't know how important it is to make the PC invisible for Chesko's vision. First person perspective may very well be sufficient.
User avatar
Damien Mulvenna
 
Posts: 3498
Joined: Wed Jun 27, 2007 3:33 pm

Post » Sat Nov 17, 2012 10:49 am

i have the invisible race thing on a different spell, and am just speaking from experience. it works fine on NPC's but not all race mods/cosmetic mods when used for the PC (missing eyebrows, missing hair, unequipped weapons, etc). also, by changing a cloned PC's base actor to invisible race, i believe both the clone and original will adopt the same race since they are the same base actor (although you may have the benefit of "cached latency", i wouldn't even risk it).

the other issue with invisible PC as a camera is that enemies may still want to attack you, or NPCs may still want to head-track you. of course all of this can be damage controlled with even more scripts, or you can simply avoid the whole thing by using a separate camera actor instead of the player.
User avatar
Dan Wright
 
Posts: 3308
Joined: Mon Jul 16, 2007 8:40 am


Return to V - Skyrim