Jump to content

I need help to change Camera to third person for haircut script


cooldamien

Recommended Posts

I need help to change Camera to third person for haircut script. Right know the mirror works but you have place your self in third person before activation to even see your self. Any help with this issue would be much appreciated thank you.

 

Damien

Scriptname Dam_HairCutMirror extends ObjectReference Const

Keyword Property AnimFaceArchetypePlayer Auto Const



Event OnActivate(ObjectReference akActionRef)
    Actor PlayerREF = Game.GetPlayer()
    If akActionRef == PlayerREF
	Game.FadeOutGame(false, true, 0.0, 2.0)
        Self.Activate(Game.GetPlayer(), true)
Game.SetCameraTarget(game.getPlayer())
       Game.FadeOutGame(true, true, 2.0, 1.0)
        Game.ShowRaceMenu(uimode = 1)
   PlayerREF.ChangeAnimFaceArchetype(AnimFaceArchetypePlayer)    

    EndIf
EndEvent

Link to comment
Share on other sites

I think I found the solution. Use a Xmarker and face it the opposite direction and use this game.getplayer().MoveTo(Dam_Haircut). This seems to work.

 

Scriptname Dam_HairCutMirror extends ObjectReference Const
ImageSpaceModifier Property FadeToBlack auto Const
ImageSpaceModifier Property HoldBlack auto Const
ImageSpaceModifier Property FadeFromBlack auto Const
ObjectReference Property Dam_Haircut Auto Const
Keyword Property AnimFaceArchetypePlayer Auto Const
Event OnActivate(ObjectReference akActionRef)
Actor PlayerREF = Game.GetPlayer()
If akActionRef == PlayerREF
Game.FadeOutGame(false, true, 0.0, 2.0)
Self.Activate(Game.GetPlayer(), true)
Game.ForceThirdPerson()
game.getplayer().MoveTo(Dam_Haircut)
Game.SetCameraTarget(game.getplayer())
;game.Getplayer().SetAngle(0.0, 0.0, 180.0)
Game.FadeOutGame(true, true, 2.0, 1.0)
Game.ShowRaceMenu(uimode = 1)
PlayerREF.ChangeAnimFaceArchetype(AnimFaceArchetypePlayer)
EndIf
EndEvent
Link to comment
Share on other sites

Hello, Damien. First I want to mark that the construction you use in terms of declaring Player ref once as a property is a bit better then mine Game.GetPlayer() multiple times.

Second, here is the code I used in my mod. It is little bit overcomplicated but the idea was to allow you choose whom do you want to edit: player or companion.

Other than that it contains "camera part" that you are looking for.

Scriptname WH_PlayerFaceEditSCRIPT extends ObjectReference

import utility


ObjectReference property BackLight  auto
Keyword property AnimFaceArchetypePlayer Auto Const
Sound property DRScMirrorOpen auto
Sound property DRScMirrorClose auto
quest property WHmirrorFaceGenQuest auto

Inputenablelayer property MirrorInput auto hidden
Message property WH_MIRROR_MENU_message01 auto
Message property WH_PlayerFaceEdit_FAIL_message01 auto
Message property WH_PlayerFaceEdit_FAIL_message02 auto
Message property WH_PlayerFaceEdit_FAIL_message03 auto
Message property WH_PlayerFaceEdit_FAIL_message04 auto
Idle property ElevatorBodyCamera auto
Idle property ElevatorFaceCamera auto
;Imagespacemodifier property CameraGenImod auto






Event OnActivate(ObjectReference akActionRef)
	if akActionRef == Game.GetPlayer()
		if Game.GetPlayer().IsInCombat()
			WH_PlayerFaceEdit_FAIL_message02.Show()
		else
			;WHmirrorFaceGenQuest.SetStage(5)
			wait(0.3)
			If Game.GetPlayer().IsInPowerArmor()
				WH_PlayerFaceEdit_FAIL_message01.Show() 
			else
				DRScMirrorOpen.Play(self)
				Self.RegisterForMenuOpenCloseEvent("LooksMenu")
				Self.RegisterForLooksMenuEvent()


				FaceBuildMENU()
			endIf

		endif
	endif
EndEvent


Event OnLooksMenuEvent(int aiFlavor)
	If (aiFlavor == 10)
		Game.GetPlayer().PlayIdle(ElevatorBodyCamera)
	ElseIf (aiFlavor == 11)
		Game.GetPlayer().PlayIdle(ElevatorFaceCamera)
	EndIf
EndEvent

Event OnMenuOpenCloseEvent(string asMenuName, bool abOpening)
	If asMenuName == "LooksMenu" && abOpening == False
			
			DRScMirrorClose.Play(self)
			
			Game.SetCameraTarget(Game.GetPlayer())			;;;;;;;;;;;;;;;;;;;;
			Game.GetPlayer().SetHasCharGenSkeleton(False)
			Game.GetPlayer().ChangeAnimFaceArchetype(AnimFaceArchetypePlayer)

			Game.ForceThirdPerson()
			Game.ForceFirstPerson()
			MirrorInput.EnablePlayerControls()
			MirrorInput  = None
			wait(0.3)
			BackLight.Disable()

			ImageSpaceModifier.RemoveCrossFade(1.0)
	

			Self.UnRegisterForMenuOpenCloseEvent("LooksMenu")
			Self.UnRegisterForLooksMenuEvent()

			if WHmirrorFaceGenQuest.IsRunning() && WHmirrorFaceGenQuest.GetStage() > 5
				WHmirrorFaceGenQuest.SetStage(50)
			endif
	EndIf
EndEvent


Function FaceBuildMENU(int iButton = 0)
	WH_MIRROR_MENU_message01.Show()

	If iButton == 0			;Player

				MirrorInput  = inputenablelayer.Create()
				MirrorInput .DisablePlayerControls(True, True, True, FALSE, True, True, True, True, True, True, True)				;my
				Game.GetPlayer().ChangeAnimFaceArchetype(None)
				Game.GetPlayer().SetHasCharGenSkeleton(True)
				
				WHmirrorFaceGenQuest.SetStage(5)
				wait(0.3)

				WHmirrorFaceGenQuest.SetStage(20)
				wait(0.3)
				BackLight.Enable()

	elseif iButton == 1			;Comp
			
				MirrorInput  = inputenablelayer.Create()
				MirrorInput .DisablePlayerControls(True, True, True, FALSE, True, True, True, True, True, True, True)				;my
				;Game.GetPlayer().ChangeAnimFaceArchetype(None)
				;Game.GetPlayer().SetHasCharGenSkeleton(True)
				
				WHmirrorFaceGenQuest.SetStage(5)
				wait(0.3)

				WHmirrorFaceGenQuest.SetStage(30)
				wait(0.3)
				BackLight.Enable()

	elseif iButton == 2			;EXIT
		;nothing
	endif
	

ENDFUNCTION
Link to comment
Share on other sites

I see you have a quest in this code quest property WHmirrorFaceGenQuest auto.

 

I am guessing you need it to get the script working.

 

How do I set the quest up, what scripting is in the quest?

 

 

But this is what I took from your code.

Scriptname Dam_HairCutMirror extends ObjectReference 

ObjectReference Property Dam_Haircut Auto Const
Keyword Property AnimFaceArchetypePlayer Auto Const
Sound property DRScMirrorOpen auto
Sound property DRScMirrorClose auto
Idle property ElevatorBodyCamera auto
Idle property ElevatorFaceCamera auto


Event OnActivate(ObjectReference akActionRef)
	Actor PlayerREF = Game.GetPlayer()
	If akActionRef == PlayerREF
		If PlayerRef.IsInPowerArmor()
			debug.messagebox("You can not be in power armor to get a hair cut. Exit your power armor and come back.")
		Else
			DRScMirrorOpen.Play(self)
			Game.FadeOutGame(false, true, 0.0, 2.0)
			PlayerREF.SetHasCharGenSkeleton(False)
			PlayerREF.ChangeAnimFaceArchetype(AnimFaceArchetypePlayer)
			InputEnableLayer myLayer = InputEnableLayer.Create()
			InputEnableLayer MirrorInput  = inputenablelayer.Create()
			MirrorInput.DisablePlayerControls(True, True, false, FALSE, True, True, True, True, True, True, True)
			PlayerREF.PlayIdle(ElevatorBodyCamera)
   			Self.Activate(PlayerREF, true)
			Game.ForceThirdPerson() 
			PlayerREF.MoveTo(Dam_Haircut)
 			Game.SetCameraTarget(PlayerREF)
			;PlayerREF.SetAngle(0.0, 0.0, 180.0)
			myLayer.EnablePlayerControls()
     			Game.FadeOutGame(true, true, 2.0, 1.0)
			DRScMirrorClose.Play(self)
      		 	Game.ShowRaceMenu(uimode = 1)
			PlayerREF.ChangeAnimFaceArchetype(AnimFaceArchetypePlayer)    
		EndIf
	EndIf
EndEvent

Edited by cooldamien
Link to comment
Share on other sites

  • Recently Browsing   0 members

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