The Elder Scrolls V: Skyrim
 
Find the best mods for your game
Finding and installing your favorite mods is easier than ever before. Mod-makers also enjoy a streamlined process for uploading mods directly to Steam. Click here to learn how.
Zim 18 Jun 19, 2013 @ 11:36am
Delayed effects with spells
Hello everyone.

I'm trying to make a mod with a sleep spell...something that when cast on a target will send them to sleep and prevent them from detecting sneaking players.

I had the idea to modify a simple paralysis spell, but this just makes the actors go stiff, and its pretty dull. Then I tried using a spell effect that made the actors ragdoll, and this worked great in making them fall down for a second, but they immediately get back up.

My idea is to have a spell that immediately ragdolls the target and then paralyses them 2 seconds later....this way you get the falling over animation and they actually stay down.

Does anyone know a way in which you can set a time delay for an effect to kick when cast on an NPC? Alternatively, if anyone knows any mods that already offer a sleep spell, please let me know! :)
Showing 1-8 of 8 comments
< >
J3X 12 Jun 20, 2013 @ 8:34am 
Good idea. You need a script for it. Easiest way to do it is probably to call "akCaster.DoCombatSpellApply(<paralyzeSpell>, akTarget)" on "OnEffectFinish(Actor akTarget, Actor akCaster)".
Set the time for the first magic effect to 2 seconds.
Zim 18 Jun 20, 2013 @ 2:15pm 
J3X....thanks pal, I thought I'd end up having to make a script. I hate to ask this, but you obviously know your stuff and i don't (i'm a noob when it comes to scripting)...but if you get a free 2 minutes, could you possibly write down the full script syntax for me? I copied and pasted what you wrote above, it wouldn't save. If you'd help me out, I'd be extremely grateful...but of course, if you can't be bothered, i'd totally understand. thanks anyway mate :)
Adura 1 Jun 20, 2013 @ 6:31pm 
Event OnEffectFinish(Actor akTarget, Actor akCaster)
akCaster.DoCombatSpellApply(Paralyze, akTarget)
EndEvent

SPELL Property Paralyze Auto

; You may or may not need to specify the spell in properties. I took a guess as to the Paralyze spell name. Also, you may wish to make a custom Paralyze spell to set a specific effect time or any other quirks you want.
; Just in case: Put this in after the first sentence/line of the script - that first part sets up some of the parameters.

; Post back if it doesn't compile or spits errors at you >.<. If it does, please copy-paste the error here.

; p.s.: Made off the top of my head right when I woke up >_< And I am not a morning person, so forgive me if it goes kaboom :P
Last edited by Adura; Jun 21, 2013 @ 2:08am
Trogdor 4 Jun 20, 2013 @ 9:31pm 
I just tried doing something similar. I wanted to make a chain lightning spell that would keep bouncing back and forth between targets. So I created a custom spell, effect, projectile, and explosion.
The way the original spell works is: The spell casts a projectile to the primary target, and an explosion. The explosion casts a second projectile onto another target. In my mod, the projectile creates another explosion, which casts another projectile, which creates an explosion, and so on until there is only one target left or they're all dead.

And it works great! Except for two problems.

The first and primary problem is that the jumps happen instantaneously, without any delay between explosions, and so my computer slows down to a CRAWL until the spell runs out of things to jump to.
This problem seems to be simple enough to solve; There is a section of the Projectile form where, in addition to selecting which explosion you want the projectile to trigger, you can select whether you want the explosion to fire "on impact" or "alt. trigger" and fill in either a Timer: or Proximity: field.
Except it doesn't bloody work. I select "alt. trigger" and type in a value for Timer: like .3 (I assume this field is in seconds, the CK wiki doesn't specify except to say "The time that must transpire before the explosion occurs.") I figure my computer should be able to keep up with 3 jumps per second. But wth "alt. trigger" selected, the spell doesn't work. It hits the primary target but it doesn't jump at all. (Again, unless I'm mistaken about the timer field and .3 actually means .3 hours or days or something)

If this did work, it would be a much easier solution for the OP; he could just create a paralysis/sleep/whatever explosion and fire it on a delay from his projectile.

The second problem is that I run with a few essential followers, and if the chain lightning spell jumps to them, it bounces back and forth between them forever because they can't die, and after a few seconds of that my game CTD.
Adura 1 Jun 20, 2013 @ 9:47pm 
Originally posted by Trogdor:
The first and primary problem is that the jumps happen instantaneously, without any delay between explosions, and so my computer slows down to a CRAWL until the spell runs out of things to jump to.


The second problem is that I run with a few essential followers, and if the chain lightning spell jumps to them, it bounces back and forth between them forever because they can't die, and after a few seconds of that my game CTD.


Note: Both of these solutions assume you use scripting, and would be easier to implement if your current setup for the spell involves scripting already.

First: The solution depends largely on how you got your spell to work. If you use scripts, I'd suggest using the RegisterForSingleUpdate(1) when the spell files, then use Event OnUpdate() to link it to the next target.

Again, it depends largely on your setup. And I haven't messed that much with spells, so I don't know of the full utility offered in the Creation Kit (as in, whether there's a better/simpler way).

Second: You may have success with making a lingering effect (for ~ a minute) on the target (as a spell), and script your Lightning spell to not go off or link or activate when striking a person with that effect.

If you go with this route, maybe you could call the effect 'Overcharged'.
Last edited by Adura; Jun 20, 2013 @ 10:05pm
Zim 18 Jun 21, 2013 @ 1:55am 
Adura.....loving the idea of having an effect that acts as a timer and then activates another effect, that'll work so well!

I did the script like you said and it didn't work....tried playing around with it, couldn't get it to work. i just know if i knew what i was doing i'd realise the problem was staring me in the face!

here's the script as i wrote it:

Scriptname ZAeR04Sleep extends ActiveMagicEffect

Event

OnEffectFinish(Actor akTarget, Actor akCaster)
akCaster.DoCombatSpellApply(Paralyze, akTarget)

EndEvent

SPELL Property Paralyze Auto


It says in the error box below: Object reference not set to an instance of an object.

Any idea what's going on?
Adura 1 Jun 21, 2013 @ 2:06am 
Originally posted by Zim:
Adura.....loving the idea of having an effect that acts as a timer and then activates another effect, that'll work so well!

^.^ But, you should experiment with basic scripting before tryin' it >.< If you don't do it right you can cause some save bloating or events that never stop going O_o The updates will ravage your game and all will be as a wasteland of scripts and sleepy doom D:

>.< Exaggeration, of course, but still, start small, work your way up :P

Originally posted by Zim:
Event

OnEffectFinish(Actor akTarget, Actor akCaster)

This should not be seperated.

It should be:
Event OnEffectFinish(Actor akTarget, Actor akCaster)

One thing ^^

I copy-pasted it back into a test script I use for stuff like this >.<, with this correction, and compiled it successfully. Didn't test the functionality, but it compiles, darnit >.<

edit: eheh >.< Didn't notice I forgot to put the "event" on the original post. Sorry :P that's what happens when I type stuff first thing in the morning O_o;
Last edited by Adura; Jun 21, 2013 @ 2:09am
Zim 18 Jun 21, 2013 @ 10:06am 
Adura....i figured it out on the train home...its working like a charm! thanks for the advice, I'll be sure to bear it in mind. thanks for all your help, you've been amazing :)
Showing 1-8 of 8 comments
< >
Per page: 15 30 50
Date Posted: Jun 19, 2013 @ 11:36am
Posts: 8