Trouble Conditionalizing Effect

Post » Sat Aug 24, 2013 5:22 pm

Here's the scoop. I have an enchantment-based magic effect. I would like to prevent the player from using the effect until a perk is gained, via conditions either on the magic effect itself or on the enchantment effect item. The key is, I want to make sure any NPC can still use this effect.

Trouble is, I can't find a way to run a condition on the actor attacking with the enchanted weapon.

Running the condition on "subject," "target," or "combat target" all result in the condition being run on the person who is being attacked by the weapon. (Weird, since the "subject" that "owns" the effect, and that subject's "combat target" would have been opposite, you'd think?). If I run the condition (like HasPerk) on the player reference directly, it will get run on the player even when an NPC is using the weapon, and prevent the NPC from using it. There has to be some way to reference the actor using the weapon, no?

I am also open to scripting options, but I have already tried a scripted dispel() of enchantment effects and it isn't good enough, since some effects are too immediate to be prevented by dispel() (like Paralysis).

User avatar
Bryanna Vacchiano
 
Posts: 3425
Joined: Wed Jan 31, 2007 9:54 pm

Post » Sat Aug 24, 2013 7:37 pm

Instead of a perk can you do a global variable? There's a condition function to compare global values. Have it default to 0, and then change it when the player gets the perk.

User avatar
OJY
 
Posts: 3462
Joined: Wed May 30, 2007 3:11 pm

Post » Sat Aug 24, 2013 9:16 pm

Well, tried that originally, but then if the player doesn't have the perk and the global var hasn't been changed yet, NPCs won't be able to use the effect either, I think.

User avatar
Jenna Fields
 
Posts: 3396
Joined: Mon Dec 11, 2006 11:36 am

Post » Sat Aug 24, 2013 10:04 am

Guess not. Seems odd that the condition functions running on the wielder aren't working... They definitely work spells...

Papyrus would be too slow to catch it. You would to make remove the actual enchantment effect and then script it - Check if they have the perk and then DoCombatSpellApply...

User avatar
Shiarra Curtis
 
Posts: 3393
Joined: Thu Jan 04, 2007 3:22 pm

Post » Sat Aug 24, 2013 9:56 pm

Mm, good idea--I may have to give the replacement option a try.

User avatar
Aliish Sheldonn
 
Posts: 3487
Joined: Fri Feb 16, 2007 3:19 am

Post » Sat Aug 24, 2013 12:31 pm

The only thing to worry about is that you may notice a slight latency using papyrus :/

User avatar
Kate Schofield
 
Posts: 3556
Joined: Mon Sep 18, 2006 11:58 am


Return to V - Skyrim