Difference between revisions of "Resurrect"
imported>DragoonWraith (CS 1.0) |
imported>Wrye (Minor cleanup. Info on using on player.) |
||
Line 7: | Line 7: | ||
AnimateFlag = 1: The actor will animate getting up (as if from a knockdown). For the | AnimateFlag = 1: The actor will animate getting up (as if from a knockdown). For the | ||
animation to complete, make sure no script commands or AI packages affects the actor, otherwise the animation will not complete. | animation to complete, make sure no script commands or AI packages affects the actor, otherwise the animation will not complete. | ||
It appears that the animation flag is '''not''' optional. Using the command from a script without the flag will cause a CTD. (Oddly, this problem does not appear when the command is called from the console.) | |||
example: | example: | ||
Line 43: | Line 45: | ||
AnimateFlag = Nothing or 0: the actor will simply reset and snap back to its alive state. | AnimateFlag = Nothing or 0: the actor will simply reset and snap back to its alive state. | ||
===Using on Player=== | |||
Using resurrect on the player will result in loss of PC abilities and camera problems (camera becomes centered on players feet). See [http://www.uesp.net/wiki/Tes4Mod:Resurrecting_the_Player UESP: Resurrecting the Player] for analysis and alternate approaches. | |||
[[Category: Functions]] | [[Category: Functions]] |
Revision as of 20:14, 6 August 2007
Syntax:
Resurrect AnimateFlag (optional)
Resurrects the calling actor.
AnimateFlag = 1: The actor will animate getting up (as if from a knockdown). For the animation to complete, make sure no script commands or AI packages affects the actor, otherwise the animation will not complete.
It appears that the animation flag is not optional. Using the command from a script without the flag will cause a CTD. (Oddly, this problem does not appear when the command is called from the console.)
example: short FlagDead ;Set to 1 when actor is dead and to 0 when resurection anim is ;complete short ResurrectAminTimer ;Counts frames since resurrection begin gamemode ;Set actor's Death Flag to 1 on death,(Note:You might have to interupt the current ;AI package here) if (Actor.GetDead==1) set FlagDead to 1 endif ;Timer that prevents the script from running before resurrection animation is ;finished(including AI packages). Starts when actor is resurrected. if (FlagDead==1) && (Actor.GetDead ==0) set ResurrectAminTimer to ResurrectAminTimer+1 endif ;After 200 frames (enough for resurrection animation to complete), resume script if ResurrectAminTimer>200 set FlagDead to 0 set ResurrectAminTimer to 0 Actor.resurrect 1 endif ;when actor is alive and resurrect anim complete, Run main script if FlagDead == 0 ;Do stuff on actor endif
AnimateFlag = Nothing or 0: the actor will simply reset and snap back to its alive state.
Using on Player
Using resurrect on the player will result in loss of PC abilities and camera problems (camera becomes centered on players feet). See UESP: Resurrecting the Player for analysis and alternate approaches.