mathern Posted May 6, 2013 Share Posted May 6, 2013 (edited) Hello,This is my first post as I'm truly more of a do it yourself programmer/modder, but I cannot figure this out.I am trying to make a detect dead spell that behaves exactly like the vanilla one, but is toggled on and off rather than concentration casted. I've managed to get it to work on living actors, but corpses seem impossible to affect in this manner. Below is what I've tried before. I think this may require a custom scripted spell, but I can't figure out how to write a script that affects corpses not targeted, but rather within an area of the caster. Attempt 1: I modified the original detect life spell to be called as a constant effect ability by the "ToggleAbility" script. (This script uses a fire and forget spell to turn on an ability, and then off again when the spell is cast again). Result 1: Created a spell that detected dead things, but they remained highlighted after the ability was removed (I believe that the constant effect was applied to the corpse and then no longer retained any relation to whether or not the player had the ability or not) Attempt 2: I modified the Frost Cloak vanilla spell to have an increased range and create the detect dead highlight rather than being hostile or doing any damage. The Frost Cloak spell casts a Concentration/Aimed-or-TargetActor type spell at any living actor within the range. Result 2: The cloak archetype seemed to be unable to affect existing corpses in any way. I WAS, however, able to create an effect on living things as they turned to corpses (died). But the effect only on their death, it had no effect when cast again with the corpse already being dead. The problem here, seems to be the lack of an area of effect archetype that can affect corpses in the area of the player. Does anyone have any ideas? Thanks for reading! Edited May 6, 2013 by mathern Link to comment Share on other sites More sharing options...
steve40 Posted May 6, 2013 Share Posted May 6, 2013 Check if the effect has a Condition on it (isDead == 0) or (isDead != 1) that would prevent it from being applied to corpses. You might need to create a copy of the effect, then remove the condition, then use the copied effect in your new spell/ability. Also, you need to have the "no death dispel" flag set on the spell. You will have to keep silently recasting the spell every 2 seconds or so, otherwise the effect won't be applied to newly encountered corpses (that were previously out of range) as the player moves about. Set the effect duration to be about 3 seconds, while silently recasting it every 2 seconds. That way, once you toggle the spell off, the effects on the corpses will expire shortly after. Link to comment Share on other sites More sharing options...
mathern Posted May 6, 2013 Author Share Posted May 6, 2013 My flags are FXPersists and No Death Dispel. My effect has the following target conditions: S HasKeyword Keyword'ActorTypeUndead' == 1.00 ORS HasMagicEffectKeyword Keyword'MagicSummonUndead' == 1.00 ORS IsUndead NONE == 1.00 ORS GetDead NONE == 1.00 ORWhat is the grammar used to write a Magic Effect Papyrus Script that measures time and casts a spell every 2 seconds? Thanks Much! Link to comment Share on other sites More sharing options...
mathern Posted May 6, 2013 Author Share Posted May 6, 2013 *Bump*"What is the grammar used to write a Magic Effect Papyrus Script that measures time and casts a spell every 2 seconds? " Link to comment Share on other sites More sharing options...
blacksupernova Posted May 6, 2013 Share Posted May 6, 2013 hey, may be I don't fully understand your goal, but is that your detect corpse spell would behave like Aura Whisper i.e. the corpses are highlighted after casting the spell for the duration of the spell? Link to comment Share on other sites More sharing options...
mathern Posted May 6, 2013 Author Share Posted May 6, 2013 At this point I'm just looking for help creating a script to attach to a constant effect ability so that, while the player has the ability in effect, the script casts a spell every two seconds.My end goal is to have any corpse within an area of the player highlighted until the effect is removed. Link to comment Share on other sites More sharing options...
mathern Posted May 6, 2013 Author Share Posted May 6, 2013 Here's my pseudo code idea... obviously the grammar is wrong... help?Event OnEffectStart(Actor akTarget, Actor akCaster) lastgametime = game.getgametime() While(EffectIsNotFinished) If((game.getgametime() - lastgametime)>=2seconds) castSpell lastgametime = gametime Endif EndWhileEndEvent Link to comment Share on other sites More sharing options...
mathern Posted May 6, 2013 Author Share Posted May 6, 2013 Solution to problem: Spell Property DetectDead auto Event OnEffectStart(Actor akTarget, Actor akCaster) RegisterForUpdate(3.0) EndEvent Event OnUpdate() DetectDead.Cast(Game.GetPlayer()) EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) UnRegisterForUpdate() EndEvent Upon finding the rather elegant RegisterForUpdate(float x) function and OnUpdate() Event the rest fell into place. A little fiddling will do the rest. Thanks steve40 for the idea to cast a spell repeatedly every two seconds!!This still does not create a complete work around for my initial problem, though. Creating spells that affect corpses without directly aiming at them (i.e. by only having them in the area) seems to be quite difficult without using the "detect life" archetype... Any advice on that or examples of spells that affect corpses without aiming at them would be appreciated. That said, my current spell idea can be accomplished with no further input. Thank you all! Link to comment Share on other sites More sharing options...
EnaiSiaion Posted May 6, 2013 Share Posted May 6, 2013 Try a Script effect. Detect Xyz doesn't actually do anything useful, the visuals are all in the shader, and Script effects don't exclude corpses by default. Link to comment Share on other sites More sharing options...
mathern Posted May 6, 2013 Author Share Posted May 6, 2013 I will play around with this extensively.. is there a good place to post the necromatic findings I develope during my experiments? I feel like the knowledge of how to affect corpses with spells is kind of hard to come by at the moment.Thanks, Link to comment Share on other sites More sharing options...
Recommended Posts