Question regarding scripts dealing with spells, animations,

Post » Wed Jun 20, 2012 12:22 pm

As an exercise, I am trying to create an AoE spell that that does some physics to affected targets and apply a constant stream of effects to them? For example, lifting them up in the air, making them play a stagger animation, set them on fire, and then have the player constantly shoot lightning at them, etc, etc, etc.

To start out, here's a brief description of my attempt:

Spoiler
SpellEffect is "Fire and Forget", "Target Location", has 40 AoE, and calls a script.

This script does the following:
OnEffectStart: Create an activator at the caster for each target. Store activator and target in a variable. Suspend the targets. All this work fine, except I can't get any animation to work except for "BleedOutStart" and I've already tried PlayIdle(), SendAnimationToActor(), and the like to no avail.

OnUpdate: Each activator shoots a corresponding target. That works fine. However, I can't change how often the update is conducted. I tried changing the parameter for RegisterForSingleUpdate() and that doesn't seem to do anything (I don't notice a visible difference between 0.1 and 0.01). It's possible that there's a set cooldown in spell casting, although I am using RemoteCast() so that shouldn't matter.

OnEffectStop: Clean up. That works totally fine.

One observation I have is that this script makes a separate instance for every affected target, which means variables are not shared. I am saying this because I would like to be corrected if wrong.

Anyway, here's what I want to do with the script that I have trouble accomplishing
1. I can't get any animation to work. All I wanted is to have all the affected actors stagger. I also can't get actors to scream
2. The triggering of the spell is very buggy. Sometimes it works and sometimes it doesn't even if casted right on the feet of an actor. I am not sure if that's a property of the "Target Location" option
3. I tried making the spell channeling and self-targeting but the script just totally stops working if I do that. What appears to be going on is that the actors in the AoE do not actually trigger "OnEffectStart". Is 40 too small a radius? I think it should at least affect the person beside the player.

I wonder if others suffered from the same problem.

Off-topic: Is there some way to trigger a script when it is within a certain radius of an object?

Thanks.
User avatar
Cat
 
Posts: 3451
Joined: Mon Dec 18, 2006 5:10 am

Post » Wed Jun 20, 2012 4:19 am

check this out :http://www.creationkit.com/Unit
40 units gets you about 60 cm (= really close melee range)
User avatar
joannARRGH
 
Posts: 3431
Joined: Mon Mar 05, 2007 6:09 am

Post » Wed Jun 20, 2012 3:25 am

check this out :http://www.creationkit.com/Unit
40 units gets you about 60 cm (= really close melee range)

The table on that page goes to 4096 skyrim units. That's the size of an exterior cell. 4096x4096.

To see it in game, open the console, type tb and hit enter. The yellow lines are the cell borders. Gives a good feel for it.
User avatar
Wayne W
 
Posts: 3482
Joined: Sun Jun 17, 2007 5:49 am

Post » Tue Jun 19, 2012 11:48 pm

The area field for spells is actually in feet, not Skyrim units. You can check the Fireball spell and its magic effect FireDamageFFAimedArea for proof.
User avatar
vanuza
 
Posts: 3522
Joined: Fri Sep 22, 2006 11:14 pm

Post » Tue Jun 19, 2012 11:25 pm

The reason that registering for updates every 100th of a second shows little different than every 10th of a second is the multithreaded time slicing that the script up date.

All running scripts and game objects get a time slice. So the real time between updates is the time you set plus time slices for other scripts plus time taken to execute your update event handling code.

Your updates are so frequent they are probably just queuing up essentially.

Why do you need such frequent updates. Using a loop with waits in the on effect start would work better for repeated executions with short delays.
User avatar
Ellie English
 
Posts: 3457
Joined: Tue Jul 11, 2006 4:47 pm

Post » Wed Jun 20, 2012 7:55 am

The area field for spells is actually in feet, not Skyrim units.

Good point. An exterior cell is approximately 192x192 feet.
User avatar
sam smith
 
Posts: 3386
Joined: Sun Aug 05, 2007 3:55 am


Return to V - Skyrim