Resurrecting the Player

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Resurrecting the Player[edit | edit source]

I am trying to make a script that will kill the player then teleport him to a place and recurrect him there without having the gameover screen show up. Is this possible and can you provide me with the script. --Saveron 18:04, 24 August 2006 (EDT)

Resurrect doesn't work properly in the console (try it, you can move around while your body still lies there...) You can try using GetActorValue to test if the player's health is below 10 or so, and then do stuff. Another idea (though I doubt that it works) would be using SetEssential player 1 --JOG 11:41, 26 August 2006 (EDT)
FlyFightFlea reports that setessential works okay, except that the camera is screwed up afterwards. Haven't tried it, but I assume that it means that you're stuck in "fatality cam" mode. --Wrye 19:20, 25 May 2007 (EDT)

Both Resurrect and SetEssential have camera problems that require user to quit out of Oblivion and then restart it. In addition, Resurrect is almost unusable because it loses the players abilities. However, an alternate approach combining a health buffer with SetEssential as a backup works fairly well.

See full analysis and description at UESP: Resurrecting the Player. --Wrye 19:53, 6 August 2007 (EDT)

Unconscious State, Ghost Effects[edit | edit source]

Is there a function that makes the character go into that "unconsious" state, i was looking in the function part of the wiki but the closest i got was SetUnconsious and from reading it, it doesnt seem like it kocksout the player only stops them from doing things. Also on an unrealted case(i put this here couse its a small problem) On the quest i am making I added dremora and i added custom dialog to them but when testing in game they do not say the custom dialog, other people i added do say custom dialog i added to them, i did the same things to the people that say custom dialog as i did to the dremora, so i cant figure out why the dremora whont say the dialog, can anyone help me with that? -- Saveron 18:07, 26 August 2006 (EDT)

Ghost Effects[edit | edit source]

Is it possible to make the player a transparent white, just like the actor in The Forlorn Watchman quest? --Saveron 18:11, 29 August 2006 (EDT)

SetGhost 1? --Dragoon Wraith TALK 02:45, 30 August 2006 (EDT)
SetGhost doesn't have any visual effects aside from causing weapons to slide right through the calling object. Think about using SetActorAlpha to make the actor semi-transparent, along with an Effect Shader to turn him white. I assume this is how the Forlorn Watchman was done, so taking a look at him in the CS should give you some clues.
As for your other questions: setUnconscious only affects the NPC's AI. To have him fall down as well, you want to paralyze him or set his fatigue below zero. Note that after using setUnconscious 1 the NPC can't be looted or activated until you reset it to 0. For your dialog issue and any other questions you have I'd suggest heading on over to the CS-Forums].


Player.pms GhostEffect


player.setghost 1


worked for me. God, this formatting is difficult. Sorry, guys. -- Scruggs 09:11, 30 August 2006 (EDT)


Ghost Effect with Health Threshold[edit | edit source]

Try this one. It works fine for me. You have to put this script into the script window of the Base "player", which can be found under the "NPC" section.



ScriptName 000PlayerResurrectScript

short DoOnce
short init
short TimeIsOut
short BaseHealth
short CurrentHealth
short FixHealth
short ReducedHealth
short EnduranceModifier
short BaseFatigue
short Death
float timer

Begin GameMode

;Remember the original Base HitPoints
;and set the Endurance +10 to give the Player an Threshold of 50 extra BASE HitPoints

if (DoOnce != 1)
	set BaseHealth to GetBaseActorValue Health
	set EnduranceModifier to (GetBaseActorValue Endurance + 10) 
	SetActorValue Endurance EnduranceModifier 
	set DoOnce to 1
endif

;Check the PC HitPoints
;if they reach the 50 Points Threshold
;be sure that the HitPoints never fall below 50 Points

if (GetActorValue Health < 51)
	set CurrentHealth to GetActorValue Health
	
	if (CurrentHealth != 50)
		set FixHealth to (50 - CurrentHealth) 
		ModActorValue Health FixHealth 
	endif

;Stop the enemys from attacking the Player
;Then set the Player to some kind of Death state by detracting his Fatigue 

	if (Death != 1)
		StopCombatAlarmOnActor
		SetGhost 1
		ForceActorValue Fatigue -1000
		set Death to 1
	endif

;after some Time (here 300 Seconds) 
;heal the Player up to 30% from his original Base HitPoints + the 50 Points Threshold  
;and resurrect him by restoring his original Fatigue

	if init == 0 
		set timer to 300.0
		set init to 1
	else
		if timer > 0
			set timer to timer - getSecondsPassed
		else
			SetGhost 0
			set ReducedHealth to ((BaseHealth*0.3-CurrentHealth)+50)
			ModActorValue Health ReducedHealth
			set BaseFatigue to (GetBaseActorValue Fatigue) 
			ForceActorValue Fatigue BaseFatigue
			set init to 0
			set Death to 0
        endif
	endif

endif

End GameMode

(EDT)

--User:Althir 02:09, 19 Juli 2008 (EDT)