Jump to content

Need help in making a spell please


LargeStyle

Recommended Posts

I've recently released the mod Dead Body Collision Fix (currently in Hot Files) - however I'm trying to improve it by adding a spell to the game which disintegrates dead NPCs when cast.

 

I have spent ages looking into this and experimenting with spells' setups in Creation Kit, but I have absolutely no experience in spell creation and although I've made some progress, I'm still not getting the result that I want.

 

I made a new spell (duplicated and adjusted from another spell)...

 

http://img442.imageshack.us/img442/3718/disintergratecorpse.png

 

What I've found and attempted to apply is the "Disintegrate Health" spell option into my spell, and set the condition that it only affects actors with health equal to 0 (dead) - but although the spell casts, nothing actually happens.

 

I've seen that there is a Disintegrate perk...

 

http://img803.imageshack.us/img803/4222/disintegrateperk.png

 

... but it's a perk (that I don't have) and not a spell.

 

The spell "Lightning Storm" also causes disintegration...

 

http://img845.imageshack.us/img845/5686/lightningstorm.png

 

...and I've played around with this spell settings but again without the result that I want.

 

 

I'm assuming that the problem is due to casting a spell on a dead NPC as the disintergrate command works within a spell on an alive NPC that then dies. I thought / hoped that applying the condition of health=0 would force the use of the spell on corpses but no joy as yet.

 

I'm sorry for sounding totally noobie on this but I "specialise" in weather and lighting modding, not spells!!! If anyone can assist / contribute to this issue and add to this mod then I'd be much appreciated and full acknowledgements will be made on my mods main page.

Link to comment
Share on other sites

I wonder... try taking one of the standard "raise dead" spells (i.e. not Dead Thrall, we want one that does the ash pile thing), duplicating it, and shortening the duration to 0 seconds. Unless a 0-second duration does something totally unexpected, you should be able to cast the spell, which technically resurrects the corpse, but then immediately expires and turns the body into an ash pile.

 

Just a thought, I really have no idea about targeting dead actors, it's not something I can say I've ever tried before. Of course, then you have issue of this de-summoning/de-rezzing any atronachs/zombies the caster already has...

 

Another option is to change your condition from "health = 0" on your current spell to simply "isdead" -- it's possible dead actors simply have no health, as opposed to a health of 0...

Edited by kromey
Link to comment
Share on other sites

Thanks for the info!

 

You seem to be right but I've had partial success: I adjusted the Lightning Storm spell so that it had the condition of "GetDead" and now the spell flings corpses around and leaves alive NPCs alone. However once the corpse is done flying around it just lays there - no disintegration.

 

Still testing / experimenting with it....

Link to comment
Share on other sites

Here's a brief little script I cooked up that can be attached to a Magic Effect. I only tested it a little bit, but it seems to work fine. It removes corpses and doesn't remove living actors.

 

 

EffectShader Property pShader  Auto  

Event OnEffectStart(Actor akTarget, Actor akCaster)
Bool aretheydead = akTarget.IsDead()
If aretheydead == 1
	pShader.play(akTarget)
	akTarget.SetAlpha (0.0,True)
	akTarget.AttachAshPile()
Else
	;don't do anything
EndIf
EndEvent

 

To use this, go to Magic -> Magic Effect, duplicate one that you want (I copied BanishFFActor50 and removed everything it already had under Target Conditions and Papyrus Scripts), then next to Papyrus Scripts click "Add", click [New Script], name it whatever you want and click Ok. Then it will show up in the list of Papyrus Scripts on your Magic Effect, right-click it and go to Edit Source and paste the code in and save it. After that, highlight the script and click Properties, and for pShader pick "ShockDisintegrate01FXS"

 

 

You'll also need to make a new Spell and add the Magic Effect to it

Edited by BLOODGAZMS
Link to comment
Share on other sites

Kromey's suggestion was pretty good. The problem you're running in to is in the script attached to the disintegrate effect.

 

That scripts entire function happens inside an OnDying script event. (A caveat of which is the actor has to be alive initially so that it can die)

 

To get around this you need to either change the script to work on dead actors, or make the target alive again (so you can kill it).

 

The reanimate spells are completely fubar though, so no guarantees that they are what you want.

 

EDIT: also make sure the "FX Persist" and "No Death Dispel" flags are ticked on your Magic Effect.

Edited by cscottydont
Link to comment
Share on other sites

Thank you BLOODGAZMS - yeah I'm slowly sussing out the spell system now.

 

I'm looking into what you said right now...

 

Just FYI - doesn't a Papyrus script do the ash piles? Look at bottom right of picture...

 

http://img571.imageshack.us/img571/7816/moredisintegrate.png

Link to comment
Share on other sites

I changed my post to include code that forms an ash pile and puts disintegrate effects. Thank you cscottydont for giving me the idea to actually check the built-in Disintegrate script.

 

Also, in your magic effect you might wish to untick "Hostile" so that accidentally casting it at a living actor won't make them angry and get the guards to come after you.

Edited by BLOODGAZMS
Link to comment
Share on other sites

God I must be thick - I still can't get it working. I've followed your instructions BLOODGAZMS and I don't know where I've gone wrong. Here's where I'm up to...

 

http://img832.imageshack.us/img832/6261/31525768.png

 

http://img33.imageshack.us/img33/4481/18747516.png

 

..plus I also adjusted the Script Properties just like you said to.

 

So far the spell shows up in game, and in the form of the Fireball spell, but there's no disintegration of corpses on impact of the spell. I've been walking around Windhelm killing everyone I see and no joy :wallbash:

 

I need a break for an hour or two as I'm starting to get somewhat ****ed of with it now.

 

FWIW: here's the tweaked (broken) mod as it currently stands: My link

Edited by LargeStyle
Link to comment
Share on other sites

You need to remove everything in the "Target Conditions" box for the Magic Effect, I made the script handle that stuff by itself. The Effect Item in the spell doesn't need any conditions either, in fact having that may interfere with it (probably not, but it's still redundant). I can see in the Magic Effect screenshot that it still has the condition preventing it from working if the player doesn't have the Disintegrate perk for Destruction, so that's likely the main culprit here. Remove them all though just to be sure, one of them checks the targets health and I'm not sure if corpses work properly with that.

 

I'm glad to help out, because I like this mod a lot. I hope you're able to get everything in working order.

Edited by BLOODGAZMS
Link to comment
Share on other sites

Thanks again BLOODGAZMS.

 

Just FYI: I used a .bat file cheat that enabled me all perks just for this mods testing purposes just so that I met the disintegrate perk requirement, so that shouldn't have interfered with anything.

 

I've just remade the mod from scratch using your latest instructions. I used a duplicate of the Fireball spell as the basis for the disintegration spell. When I simply added the disintegration magic effect (including your script) to the Fireball spell the targets disintegrated when killed, and an ash pile was left behind. However corpses remain unaffected and just stay there when hit by the spell.

 

I changed the Fireball spell properties so that no damage would be issued (as it perhaps should be in the final version of the mod) - as I was no longer able to kill anyone with the spell disintegration didn't occur to anyone.

 

I then added the condition of "GetDead" to the spells disintegration effect list, made no difference.

 

Still going to carry on reading / learning / experimenting with this....

Link to comment
Share on other sites

  • Recently Browsing   0 members

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