Problem when creating a spell with conditional magic effects

Post » Wed Jun 20, 2012 9:40 am

I'm creating a new spell that has two effects. This spell can be used both one-handed and two-handed. I would like to make one of the spell's effects only activate when the spell is dual cast and the other to activate only when the spell is not dual casted, so there is basically a different result for when the player uses two hands or not.

To do this I added a condition to the first effect (by double-clicking the effect on the spell window and adding a new condition on the conditions table) that read: "EffectWasDualCast" == 1.000 , Run on: "Subject" (everything else stayed unchanged). I also added one to the second effect exactly the same, except for the value which I changed to 0.

When testing I found this wasn't working at all. Dual casting or not, after releasing the spell it wouldn't do anything. Imagine casting "Fire storm" and after you end moving your hands and release the spell no explosion comes out, your hands just move to the normal position :( What I mean by this is that it seemed it wasn't activating ANY magic effect. I also tried making the conditions like this:
- activate effect 1 if EffectWasDualCast == 1
- activate effect 2 if EffectWasDualCast != 1 (notice the != 1, not == 0)

It still didn't work! It didn't activate either of the effects! Which number can be at the same time not different and not equal to one? This doesn't make sense at all! I also tested with "Run on: target", but I got the same results.

If you wanted to do something like this, how would you do it? It's important for the way I'm building my spell that one effect is only activated when the other is not, and one is activated only on dual casting. How, though?
User avatar
Kit Marsden
 
Posts: 3467
Joined: Thu Jul 19, 2007 2:19 pm

Post » Wed Jun 20, 2012 9:26 pm

"Subject" is the target of the spell. I'm not sure exactly what "EffectWasDualCast" is checking. The way you set it up, maybe the game thinks that you are passing "Subject" as a magic effect, and it's supposed to check whether or not "Subject" was dual cast. And since "Subject" isn't actually a magic effect, neither condition is working.

Maybe you can try "IsDualCasting" and run it on "Target" instead.
User avatar
Budgie
 
Posts: 3518
Joined: Sat Oct 14, 2006 2:26 pm

Post » Wed Jun 20, 2012 10:12 pm

The magic effect itself would be simply, well, itself. But I think he's talking about conditionals, right? I haven't done much of those outside quests, but I think "subject" is contextual. In the case of a spell's magic effect, it would (probably) be the spell if it's conditions on the effect IN the spell, but I cant be 100 percent sure.
User avatar
Queen of Spades
 
Posts: 3383
Joined: Fri Dec 08, 2006 12:06 pm

Post » Wed Jun 20, 2012 6:36 pm

While testing I found out a much bigger problem. So, follow my steps:
- First I started with a spell that contains one magic effect. In-game they work perfectly.
- Added a condition to the magic effect (for example: isDualCasting == 1, run on Target). With this condition the spell should only do something when dual casted, even though it can be cast with only one hand. In-game neither single handed casting nor dual casting activate the effect and so the spell basically stops working.
- Thinking this isn't working because the "run on" property is wrong, I change it to run on subject. In-game the problem persists.
- I delete the condition from the effect, click Ok, save, etc. In-game it should work again because there isn't a condition anymore, but it still doesn't work!

So I have a state where it works, I modify it and it stops working. I revert the changes so that it should work again and it doesn't. I don't get it. Any ideas?
I'm SURE I deleted the condition and that I saved, etc. I'm also testing in-game by opening Skyrim and, before loading any game on the title screen, typing coc Riverwood (creates a fresh new game) and adding the spell through the console.

The only way to make it work again is by deleting the .esp file and copying it from a version backup I have. It seems like after deleting the condition it stays as a ghost, preventing the effect from activating! (confused face)

And until I figure this I can't test any conditions, because if I just by adding a condition it stops working for all eternity then I can't test any more conditions after that. I can't solve my first problem until I solve this one.
User avatar
Taylor Tifany
 
Posts: 3555
Joined: Sun Jun 25, 2006 7:22 am

Post » Wed Jun 20, 2012 9:39 am

Sometimes when I change a magic effect the spells using that effect stop working, and the only way to get it back is entering the spell edit screen, clicking the Auto-Calculate check button twice just to "refresh" it, and then saving the spell again. Maybe doing this refreshes some internal references, who knows..

It's stupid. Don't ask me. But it works :)
User avatar
Mimi BC
 
Posts: 3282
Joined: Sat Oct 07, 2006 10:30 pm

Post » Wed Jun 20, 2012 9:03 am

Sometimes when I change a magic effect the spells using that effect stop working, and the only way to get it back is entering the spell edit screen, clicking the Auto-Calculate check button twice just to "refresh" it, and then saving the spell again. Maybe doing this refreshes some internal references, who knows..

It's stupid. Don't ask me. But it works :smile:

That is true. The spell "remembers" the old magic effect until you edit the spell once. You will notice that when you edit a magic effect, then save, and the open the spell, you get another "dirty" (*) mark next to you filename, meaning the spell changes something, likely updates itself. I had that effect when changing the area of a MGef, which would only be effective once I opened the corresponding spell, too.

That is likely what is happening to you, Truppelito.

As to the condition, you have this condition set on the spell's "effect item" window not the magic effect itself, right?

The Problem may well be that "Effectwasdualcast" is a property of the effect, not the spell. Therefore, you have to add that condition on the effect itself, not on the "effect item" that is part of the spell.

The reason for this is likely that the conditions checked in the "effect item" tab are checken on cast and never afterwards, while the conditions on the magic effect itself are checked when the effect starts.
Since the "on cast" event starts as soon as you start charging the spell, it does not yet know whether the spell will be dual cast or not (it might not be cast at all).

Tl:dr: Put the condition on the magic effect itself (check the Target, not the subject). That might work.
User avatar
emma sweeney
 
Posts: 3396
Joined: Fri Sep 22, 2006 7:02 pm

Post » Wed Jun 20, 2012 11:06 pm

Well, you guys are geniuses! Thanks veeery much! Using your trick I was able to revert to a working spell again. That second problem was solved. Now on to the first one! This is what I tried so far on the spell with only one effect:

>> Spell editor -> spell effect item -> conditions table
- EffectWasDualCast == 1, run on subject
- EffectWasDualCast == 1, run on target
- isDualCasting == 1, run on subject
- isDualCasting == 1, run on target


>> Effect editor -> conditions table
- EffectWasDualCast == 1, run on subject
- EffectWasDualCast == 1, run on target (@Cronos988 your suggestion didn't work either)
- isDualCasting == 1, run on subject
- isDualCasting == 1, run on target

(each of these cases was tested spearately - eight tests total)

On all of those cases the effect was activated both on one-handed and on two-handed casting, which means none of those conditions worked. Hmmm....
User avatar
sas
 
Posts: 3435
Joined: Thu Aug 03, 2006 8:40 am

Post » Wed Jun 20, 2012 4:11 pm

Maybe the conditions just don't work... You could try testing if it actually works or not by doing what kuertee describes in http://www.gamesas.com/topic/1354316-conditions-in-papyrus/. Only instead of using 'IsPC1stPerson', use 'IsDualCasting'. Then do some dual-casting.

If messages show up, you know the condition works. If it doesn't, you know the condition is broken. (I know that at least some of the conditions are broken because I tried it with GetHitLocation to try and see where I get hit; didn't work.)
User avatar
Krystal Wilson
 
Posts: 3450
Joined: Wed Jan 17, 2007 9:40 am

Post » Wed Jun 20, 2012 11:10 am

Well, the condition is used in several vanilla spells (specifically: All destructions spells subject to the "impact" perk), and it does trigger.
User avatar
Sheila Reyes
 
Posts: 3386
Joined: Thu Dec 28, 2006 7:40 am

Post » Wed Jun 20, 2012 11:44 pm

You're right... so the 'EffectWasDualCast' should work in the conditions of the magic effect editing window. Maybe the OP should try duplicating the PerkImpactStaggerPushFFAimed magic effect and then editing it?
User avatar
Sanctum
 
Posts: 3524
Joined: Sun Aug 20, 2006 8:29 am

Post » Wed Jun 20, 2012 9:06 am

You're right... so the 'EffectWasDualCast' should work in the conditions of the magic effect editing window. Maybe the OP should try duplicating the PerkImpactStaggerPushFFAimed magic effect and then editing it?

I did that for my stagger perk rework, and as far as I can tell, it worked. I can't remember if I specifically checked whether the effect was applied when casting one-handed though... I just assumed it works in Vanilla, so it will work here too. Just annoyed that there is no Script function to check whether it was dual cast.

Maybe this is a case of "randomly works for some effects and not for others"? What kind of effect are you using Truppelito?
User avatar
NAkeshIa BENNETT
 
Posts: 3519
Joined: Fri Jun 16, 2006 12:23 pm

Post » Wed Jun 20, 2012 2:02 pm

Well, my effect is mostly a copy (with some small changes) of FireDamageFFSelfArea100.
User avatar
Victoria Vasileva
 
Posts: 3340
Joined: Sat Jul 29, 2006 5:42 pm

Post » Wed Jun 20, 2012 8:30 pm

I tried seeing if the conditions actually work by adding an ability, etc and it does work, both of them (EffectWasDualCast and isDualCasting), so they should work as well on my effect. I also tried duplicating PerkImpactStaggerPushFFAimed but it didn't work.
User avatar
Michelle davies
 
Posts: 3509
Joined: Wed Sep 27, 2006 3:59 am

Post » Wed Jun 20, 2012 9:43 pm

.
User avatar
danni Marchant
 
Posts: 3420
Joined: Sat Oct 07, 2006 2:32 am


Return to V - Skyrim