Difference between revisions of "Resurrect"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>DragoonWraith
(cleaning up)
imported>Talkie Toaster
(Changing the abysmally-written script)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Syntax:'''
'''Syntax:'''
  Resurrect ''AnimateFlag''  
  Resurrect ''AnimateFlag''
 


Resurrects the calling actor. If the AnimateFlag argument is 1, the actor will animate getting up (as if from a knockdown). Scripting or AI packages may interrupt the animation, so one should be careful to avoid these.
Resurrects the calling actor. If the AnimateFlag argument is 1, the actor will animate getting up (as if from a knockdown). Scripting or AI packages may interrupt the animation, so one should be careful to avoid these.


The AnimateFlag appears to be optional when Resurrect is used from the Console, but not when used in script.
The AnimateFlag appears to be optional when Resurrect is used from the Console, but not when used in script.
Resurrect may remove items from some actors, including items flagged as unplayable. 


== Animation Example ==
== Animation Example ==
The following code is used to allow the actor time to get up before continuing to execute:
The following code is used to allow the actor time to get up before continuing to execute. This may not always be necessary- if you're adding items, packages or factions to them, for example, whether or not they're getting up off the floor has no bearing:
  short FlagDead  ;Set to 1 when actor is dead and to 0 when resurection anim is
short FlagDead  ;Set to 1 when actor is dead and to 0 when resurection anim is
                    ;complete  
                  ;complete  
 
  short ResurrectAminTimer ;Counts frames since resurrection
  float Timer      ;Counts time since resurrection
 
  begin gamemode
Begin GameMode
 
   ;Set actor's Death Flag to 1 on death,(Note:You might have to interupt the current
   ;If the actor's dead, make a note of it- it'll take some time to revive them.
  ;AI package here)
   if ( Actor.GetDead )
   if (Actor.GetDead==1)
    set FlagDead to 1
        set FlagDead to 1
    Actor.resurrect 1
        Actor.resurrect 1
    set Timer to 0
  endif
   
 
   elseif( FlagDead )
  ;Timer that prevents the script from running before resurrection animation is
      if(Timer < 3)
  ;finished(including AI packages). Starts when actor is resurrected.
        ;Wait two seconds for the animation to finish playing
   if (FlagDead==1) && (Actor.GetDead ==0)
        set Timer to Timer + GetSecondsPassed
      set ResurrectAminTimer to ResurrectAminTimer+1
   
  endif
      else
 
        set FlagDead to 0
  ;After 200 frames (enough for resurrection animation to complete), resume script
        ;If it's been over three seconds, they're standing up.
  if ResurrectAminTimer>200
        ;Now you can play animations on them and so on.
        set FlagDead to 0
      endif
        set ResurrectAminTimer to 0
    endif
 
    ;when actor is alive and resurrect anim complete, Run main script
    if FlagDead == 0
        ;Do stuff on actor
     endif
     endif
 
End


== Using on Player ==  
== Using on Player ==  

Latest revision as of 15:17, 16 July 2009

Syntax:

Resurrect AnimateFlag

Resurrects the calling actor. If the AnimateFlag argument is 1, the actor will animate getting up (as if from a knockdown). Scripting or AI packages may interrupt the animation, so one should be careful to avoid these.

The AnimateFlag appears to be optional when Resurrect is used from the Console, but not when used in script.

Resurrect may remove items from some actors, including items flagged as unplayable.

Animation Example[edit | edit source]

The following code is used to allow the actor time to get up before continuing to execute. This may not always be necessary- if you're adding items, packages or factions to them, for example, whether or not they're getting up off the floor has no bearing:

short FlagDead   ;Set to 1 when actor is dead and to 0 when resurection anim is
                 ;complete 

float Timer      ;Counts time since resurrection

Begin GameMode

  ;If the actor's dead, make a note of it- it'll take some time to revive them.
  if ( Actor.GetDead )
    set FlagDead to 1
    Actor.resurrect 1
    set Timer to 0

  elseif( FlagDead )
     if(Timer < 3)
        ;Wait two seconds for the animation to finish playing
        set Timer to Timer + GetSecondsPassed

     else
        set FlagDead to 0
        ;If it's been over three seconds, they're standing up. 
        ;Now you can play animations on them and so on.
     endif
   endif
End

Using on Player[edit | edit source]

Using Resurrect on the player will result in loss of magic and racial abilities and cause camera problems (camera becomes centered on player's feet). See UESP: Resurrecting the Player for analysis and alternate approaches.

See Also[edit | edit source]