Jump to content

Ever-resurrecting NPC


morbid_angel

Recommended Posts

I'm having some trouble lately, i'm trying to make a battlefield where when you kill a foe it keeps resurrecting everytime you kill it after a few seconds.

 

Was trying to make a timer but i just can't compile the script right; so i tried to simply make one like this:

 

scn zres

 

begin On Death

 

RessurectActor

 

end

 

 

and placed it on the npc, but when i kill it after a few seconds he just disappear (limbs included). so i try to exit and enter again the "room\battlefield\whatever" and it suddenly reappear....

 

I just can't understand how this resurrect thing works, or why the character simply disappear;

 

anyone have any clue?

 

thanks in advance

Link to comment
Share on other sites

The ResurrectActor function isn't quite that simple.

 

- Calling ResurrectActor on NPCs with the animate flag false (i.e. either absent or 0) can cause Fallout 3 to crash

 

- Calling Resurrect on an actor with the animate flag true (or 1) will cause them to fall through the geometry unless it is called in the same frame as their death.

 

See also: http://geck.bethsoft.com/index.php/SetUnconscious

Link to comment
Share on other sites

Yes, that what i meant, it isn't simple, i read the instructions on the Geck page, in fact my script had the ResurrectActor set to 0; the game didn't crash, the NPC just disappear and reappear when you enter the room again;

 

The SetUnconcious command didn't exactly solved my problem; in fact the NPC get "reanimated" one time but whit his limbs\head missing and the animation\behaviour are all messed up, and if you kill him for the second time he simply didn't revive itself again.

 

Anyone knows how to compile the resurrect actor correctly to work continuously?? (and correctly)

 

 

thnx a lot

Link to comment
Share on other sites

Obviously this is a long-time bug in Gamebryo, and unless you happen to have the source code to that lying around, I doubt it's really possible.

 

It isn't really possible to reanimate a dead actor. The best you can do is wait until the actor isn't visible to the player (with GetLOS), then delete the old actor and replace it with a new copy of the same actor.

Link to comment
Share on other sites

Marking an npc as essential won't allow him to die, so no dismemberment or decapitation or explosion.

 

The problem with the script (both ResurrectActor or just Resurrect) is that the actor actually revive itself, but disappear! It reappear only if you exit and reenter the room\space;

so probably he is falling trough geometry? (in the manual it says that it happens if you set the animation variable true, yet i set it to false).

 

So for now the only thing I can do for now is move it (moveto) to a marker...

 

 

Sigh

Link to comment
Share on other sites

  • 4 weeks later...
Whatever works, although I'd be careful with that moveto. I recall from earlier experiments that moveto with a dismembered body would cause the game to crash (not every time, but sometimes).

probly a bit late for this but for those interested ive had succes with using a script like below for resurecting actors in fallout 3

 

set xt to target.getpos x;store x position

set yt to target.getpos y;store y position

set zt to target.getpos z;store z position

target.resurrect 1

target.disable

target.moveto targetmark; marker located in a dummy cell

target.enable

target.moveto player

target.setpos x xt;set x position

target.setpos y yt;set y position

target.setpos z zt;set z position

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...