Jump to content

Start the spinning idle camera?


ThoraldGM

Recommended Posts

Anyone know how to start the slow spinning idle camera on demand? (Skyrim threads call it the "vanity cam".)

 

I'm working on a tourism mod that moves player to random locations and want the idle camera to spin on arrival. Of course player can stop spinning by walking, plus there will be a MCM option to disable the effect.

Link to comment
Share on other sites

This is the closest tidbit I've found to something useful:

 

"I have to set "bForceAutoVanityMode=" to 1 and use the command "refreshini" at the console, to activate the vanity-cam immediately -> the opposite isn't working this way - after you set "bForceAutoVanityMode=" to 0, saveing the file and order the console by "refreshini" to reload the ini-settings, the vanity-cam isn't stopping - you have to reload the savegame, but why?"

 

Source: https://bethesda.net/community/topic/21545/auto-camera-vanitycamera-tweaks-for-ini-and-console

 

I've Googled several angles without success (play camera, force idle, shorten time until idle then revert, etc) but there's a limit to what I can find away from home & CK. Maybe a search of the game scripts with Agent Ransack will turn up something useful. Hopefully the "start idling & spinning camera" code isn't hidden beyond the native wall.

Link to comment
Share on other sites

Maybe you also need to disable the camera to stop it.

 

bDisableAutoVanityMode=1

 

or you could try controlling the camera with a script, instead of editing the ini file:

 

Utility.SetINIBool("bForceAutoVanityMode:Camera", true)

Utility.SetINIBool("bForceAutoVanityMode:Camera", false)

Link to comment
Share on other sites

Just following up to say this is working, mostly. My code checks what camera view player is using (thanks registrator2000), then temporarily forces third person if not already there, then changes back to player's preference after the teleport and spincam. In testing, spin worked perfectly if player was in first person view prior to my code. If player was in third person, the spin works but never stops. I can even move in game while spinning, but can't access Pip-Boy and have to exit game.

 

I think the situation will remedy when I have time to work on it again. But thanks for the help.... "it just works" ^_^

 

Here is a screenshot of the code. On my phone so I don't have text to paste.

 

DN9VwvzX4AE8lB2.jpg

 

 

DN9W35nW4AYegJj.jpg

Link to comment
Share on other sites

Hitchhiker mod video: First Look at WIP (spinning camera at 2:15)

From lots of trial and error, I learned that the spinning camera prefers to start/run in third person, then end in first person. I've tried to retain player preferences and give players lots of options in the code.

 

Script on Pastebin raw data box seems to be only place that retains my neat formatting. Comments are probably making my margins too wide.

 

Script:

 

 

 

Game.GetPlayer().SetGhost()															; IMPORTANT: Player immune to all damage!

If HH_DevTracking.GetValue() as Int == 1											; If player wants dev messages
	If Game.GetPlayer().IsGhost()													; If player is a ghost,
		Debug.Notification("Hitchhiker: Player is a ghost!")						; display message
	EndIf
EndIf

If HH_OptionTeleportSound.GetValue() as Int == 1									; If player wants teleport sound,
	Int iInstanceID = OBJHijackerTeleportOut2DA.Play(Game.GetPlayer())				; play teleport sound at player
EndIf

DestinationMarker = Game.GetPlayer().PlaceAtMe(pXMarker)							; Dynamically spawn xmarker at player
DestinationMarker.MoveTo(StaticRef, 250, 250, 500)									; Move marker to static ref with XYZ offsets
DestinationMarker.MoveToNearestNavmeshLocation()									; Then move marker to nearest navmesh
Game.GetPlayer().MoveTo(DestinationMarker)											; Move player to destination marker

If HH_OptionSpinCamera.GetValue() as Int == 1										; If player wants spincam after teleport
	Bool FirstView = Game.GetPlayer().GetAnimationVariableBool("IsFirstPerson")		; Is player in first person view?
	
	If FirstView																	; If yes,
		PreSpinCameraView = 1														; flag as first person (int declared earlier)
	Else
		PreSpinCameraView = 3														; else flag as third person
	EndIf
	
	Game.ForceThirdPerson()															; IMPORTANT: Must start/run spin in third person!
	
	Utility.SetINIBool("bForceAutoVanityMode:Camera", true)							; Spin the idle camera around player
EndIf

SpinSeconds = HH_OptionSpinDuration.GetValue() as Int								; Default is 20 seconds but player can change
Utility.Wait(SpinSeconds)															; Wait specified number of seconds
Game.GetPlayer().SetGhost(false)													; IMPORTANT: Undo player's temporary invulnerability

If HH_DevTracking.GetValue() as Int == 1											; If player wants dev messages
	If Game.GetPlayer().IsGhost() == false											; If player is no longer a ghost,
		Debug.Notification("Hitchhiker: Player is not a ghost.")					; display message
	EndIf
EndIf

If HH_OptionSpinCamera.GetValue() as Int == 1										; If player is spinning,
	Utility.SetINIBool("bForceAutoVanityMode:Camera", false)						; stop spinning
	
	Game.ForceFirstPerson()															; IMPORTANT: Call this or spin will last forever!
	
	If PreSpinCameraView == 3														; If player preferred third person view,
		Game.ForceThirdPerson()														; can resume third now that spin handling is done
	EndIf
	
	Game.GetPlayer().ResetHealthAndLimbs()											; Undo any damage taken during spin (obsolete by ghost?)
	
EndIf																				; Done with optional spincam effect
 

 

 

 

Link to comment
Share on other sites

Glad to see you got it working.

 

You could try experimenting with settings such as this:

 

Utility.SetIniFloat("fVanityModeMinDist:Camera", 100.0)
Utility.SetIniFloat("fVanityModeMaxDist:Camera", 200.0)

To adjust the min and max vanity camera distance from the player. The defaults values are 0 and 150, which I find are a bit too close. Cheers.

Link to comment
Share on other sites

It's like you read my mind. Thanks!

 

On a slightly related note, do you know what determines when a load screen will show during MoveTo? I thought switching from MoveTo to Game.FastTravel(marker) would give me the option of showing loading screen content while waiting for the teleport to finish, but FastTravel() didn't seem to do anything different at all.

 

Just a thought. I look forward to testing out the distance edits.

Link to comment
Share on other sites

Thanks steve40. The distance edits work. I'm going to set mod defaults and allow player to change the min/max distances as a menu option.

 

Also, Game.FastTravel(marker) started showing load screens, although sporadically. I think it might have something to do with whether that area has been visited or not.

 

New video: (Narrated, link starts at 8:35 timestamp) https://youtu.be/egAP8NfJ6oo?t=8m35s

Link to comment
Share on other sites

  • 2 weeks later...

For some reason, the distance options don't work from my mod menu. Only when they are directly typed into the ini file. Which is weird, because they worked at first. I'm going to leave it as-is with a note in mod description. The spin on teleport and spin on demand options work fine with the menu.

 

https://youtu.be/2oXbgoB4SZ8

Link to comment
Share on other sites

  • Recently Browsing   0 members

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