Jump to content

Resurrecting Skeletons as an Event


caseywollberg

Recommended Posts

I'm trying to have a group of defeated skeletons resurrect when the player opens a door. Here's my script:

 

scriptName Resurrect extends Actor

{Resurrects twelve skeletons in Valtheim Family Barrow when burial vault door is opened by player.}

 

Spell property reanimateSpell Auto ; this is the special self-resurrection spell to use

objectReference property BurialVaultDoor auto ; This is the reference we are waiting on to send an activate

 

Event OnOpen(ObjectReference akActionRef)

; I've been activated - see if was BurialVaultDoor

if (akActionRef == BurialVaultDoor)

; Cast a Reanimate spell on the skeletons

reanimateSpell.Cast(Self, Self)

EndIf

EndEvent

 

I have the spell dunReanimateSelf assigned to the property reanimateSpell and the appropriate door assigned to the property BurialVaultDoor, but it still doesn't seem to be working. I've also saved and compiled and saved the mod before testing. Please help if you can. I would really appreciate it.

Link to comment
Share on other sites

I don't see anything in your script telling the spell to target the skeletons. The "(Self, Self)" parameter seems to indicate that the spell itself is both the source and target of... well, itself. You'll need to add the skeletons in as properties and assign them as the target(s) of the spell.

 

EDIT: Another quick tip - you'll need twelve copies of that event to fire simultaneously to get the effect you're looking for, as the spell can only have one target.

Edited by JanusForbeare
Link to comment
Share on other sites

It would be better to put the script on the door, so it will extend objectreference and the event OnOpen() will fire.

 

Maybe something like this (not tested):

 

Scriptname Resurrect Extends objectreference

Spell property reanimateSpell Auto

Actor property Skeleton01 auto
Actor property Skeleton02 auto 
Actor property Skeleton03 auto 
Actor property Skeleton04 auto 
Actor property Skeleton05 auto
Actor property Skeleton06 auto 
Actor property Skeleton07 auto 
Actor property Skeleton08 auto 
Actor property Skeleton09 auto
Actor property Skeleton10 auto 
Actor property Skeleton11 auto 
Actor property Skeleton12 auto 

Event OnOpen(ObjectReference akActionRef)
if (akActionRef == Game.GetPlayer())
; Cast a Reanimate spell on the skeletons
	reanimateSpell.Cast(Self, Skeleton01)
	reanimateSpell.Cast(Self, Skeleton02)
	reanimateSpell.Cast(Self, Skeleton03)
	reanimateSpell.Cast(Self, Skeleton04)
	reanimateSpell.Cast(Self, Skeleton05)
	reanimateSpell.Cast(Self, Skeleton06)
	reanimateSpell.Cast(Self, Skeleton07)
	reanimateSpell.Cast(Self, Skeleton08)
	reanimateSpell.Cast(Self, Skeleton09)
	reanimateSpell.Cast(Self, Skeleton10)
	reanimateSpell.Cast(Self, Skeleton11)
	reanimateSpell.Cast(Self, Skeleton12)
EndIf
EndEvent

Link to comment
Share on other sites

Okay, Ghaundaur, I tried your solution (minus the "if" argument, since I don't necessarily want it to be exclusively triggered by the player) and got a promising sound upon opening the door, but...no resurrected skeletons. I have made the door an activate parent of each of the skeletons and set the properties accordingly (the spell to dunReanimateSelf and skeleton01 through skeleton 12 to one of each of the desired actors). Full disclosure, these skeletons are also ambush skeletons linked to a defaultActivateSelfTRIG. The idea is to have them ambush the player upon entering the room and then, once they have been defeated, to have them reanimate when the player tries to exit through the door on the opposite end of the room. Is there something I'm still missing? Thanks again for any help you can give me. This newb really appreciates it.
Link to comment
Share on other sites

It seems the spell doesn't work on skeletons. I tested also with a draugr and a bandit and it worked as intended. This was the script I used:

 

 

 

Spell property reanimateSpell Auto

Actor property Skeleton01 auto
Actor property Skeleton02 auto 
Actor property Skeleton03 auto 
Actor property Skeleton04 auto 
Actor property Skeleton05 auto
Actor property Skeleton06 auto 
Actor property Skeleton07 auto 
Actor property Skeleton08 auto 
Actor property Skeleton09 auto
Actor property Skeleton10 auto 
Actor property Skeleton11 auto 
Actor property Skeleton12 auto 

Event OnOpen(ObjectReference akActionRef)

; Cast a Reanimate spell on the skeletons
	reanimateSpell.Cast(Skeleton01, Skeleton01)
	reanimateSpell.Cast(Skeleton02, Skeleton02)
	reanimateSpell.Cast(Skeleton03, Skeleton03)
	reanimateSpell.Cast(Skeleton04, Skeleton04)
	reanimateSpell.Cast(Skeleton05, Skeleton05)
	reanimateSpell.Cast(Skeleton06, Skeleton06)
	reanimateSpell.Cast(Skeleton07, Skeleton07)
	reanimateSpell.Cast(Skeleton08, Skeleton08)
	reanimateSpell.Cast(Skeleton09, Skeleton09)
	reanimateSpell.Cast(Skeleton10, Skeleton10)
	reanimateSpell.Cast(Skeleton11, Skeleton11)
	reanimateSpell.Cast(Skeleton12, Skeleton12)
	
EndEvent

 

 

 

 

The function Resurrect() will work, but it hasn't this nice effect. The code will look like this:

 

		.....
               Skeleton01.resurrect()
	Skeleton02.resurrect()
	Skeleton03.resurrect()
               .....

 

I'm not very familiar with making spells, but it should be possible to make a working spell using the resurrect function. Hope you get it to work.

Link to comment
Share on other sites

Thanks, Ghaunadaur. I was afraid that was the problem, but I wanted to see if anyone with more experience could verify that I wasn't just doing something wrong. It would be soooo cool to have the player turn around and see all those scattered bones rising up and reassembling. Sad. Oh well. I'll try it with the resurrect function and see how jarring it looks. If nothing else, I'll change them all to Draugr instead. Kudos for your help! Edited by caseywollberg
Link to comment
Share on other sites

Okay, so I got it to work...sporadically. Otherwise, the game crashes when the door opens. Any idea as to why a script that (seemingly) works perfectly one time might crash the game the next? One thing: it seems it crashes every time I test it with a brand new coc spawn, whereas an old save sometimes works and sometimes crashes. Thanks again--I really appreciate the help!
Link to comment
Share on other sites

  • Recently Browsing   0 members

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