Difference between revisions of "Resurrect"
Jump to navigation
Jump to search
imported>JOG |
imported>Mundane |
||
Line 3: | Line 3: | ||
Resurrects the calling actor. | 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. | |||
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. | |||
<B>Note:</B> In some situations the flag is required to prevent a crash. | <B>Note:</B> In some situations the flag is required to prevent a crash. |
Revision as of 21:31, 28 September 2006
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.
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.
Note: In some situations the flag is required to prevent a crash.