How to delay the time before moving a dead NPC

Post » Sat Sep 17, 2011 10:35 am

I know how to make a script that will resurrect a dead NPC and move it to a location. I want to know how to make a time delay, between when the NPC dies and when the NPC is moved to another room and resurrected. I have 4 NPCs which i have made persistant references, i also want a result script for a quest, that enables the NPC to have a time delay before it is moved back to the "MoveTo" location.
User avatar
Tiff Clark
 
Posts: 3297
Joined: Wed Aug 09, 2006 2:23 am

Post » Sat Sep 17, 2011 5:20 am

I did this to the guardians in my Ancient Towers mod.

Here is a slightly stripped down version of it.

scn CreatureOnDeathScriptfloat actorAlphashort deathActivefloat timershort timerStatusshort myStatusBegin OnDeath	set timer to 5	set timerStatus to 1	set myStatus to 2EndBegin GameMode	if myStatus == 0		return	endif	if timerStatus == 1		if timer > 0			set timer to timer - getSecondsPassed		else			set timerStatus to 0			set deathActive to 1		endif	endif	if deathActive == 1		pme STRP		set actorAlpha to 0.9		SetActorAlpha actorAlpha		set deathActive to 2	endif	if deathActive == 2		set actorAlpha to ( actorAlpha - .01 )		if actorAlpha < 0			set actorAlpha to 0			set deathActive to 3		endif		SetActorAlpha actorAlpha	endif	if deathActive == 3		set deathActive to 0		disable		sme STRP		set deathActive to 0	endifEnd

User avatar
Emma Louise Adams
 
Posts: 3527
Joined: Wed Jun 28, 2006 4:15 pm


Return to IV - Oblivion