Toggled power scripts stuck on

Post » Fri Oct 08, 2010 9:39 am

So I have this night eye toggle that won't turn off - when I recast it, it just reapplies itself.

This is the script in Race Balancing Project:

Scriptname TabaxiNightEyeToggleref meBegin ScriptEffectStartSet me to getself	If ( me.IsSpellTarget TabaxiNightEye == 0 )		me.addSpell TabaxiNightEye	else		me.removeSpell TabaxiNightEye	endifEnd


I've tried using the removeSpell script command in the console to remove it, but it won't execute. Google is utterly failing me at finding any solution to this problem because of numerous other functions that are also described as toggles. How can I turn off a stuck toggle?
User avatar
SEXY QUEEN
 
Posts: 3417
Joined: Mon Aug 13, 2007 7:54 pm

Post » Fri Oct 08, 2010 2:57 pm

Try modifying the Script to this...

Begin ScriptEffectStart	If ( Player.IsSpellTarget TabaxiNightEye == 1 )		Player.RemoveSpell TabaxiNightEye	ElseIf ( Player.IsSpellTarget TabaxiNightEye == 0 )		Player.AddSpell TabaxiNightEye	EndifEnd


This is the way I had to do it in my Vampirism Mod to stop it randomly doing what you describe-- hopefully it will help :)


As for Console RemoveSpell function You'll need 2 things:
1. The Spells Editor ID, found in the Mod itself
2. Your Mod LO Position, and the ID -- You're best using something like Wrye Bash for that (I think OBMM also does it, but I've not used it for ages).

Then it is:
Player.RemoveSpell XX000000


The XX is the Load Order Position ID (I think these go fromm 01 - FF, but someone else might be able to confirm) and the 000000 is the Spell's Editor ID (Which in the CS is usually 01XXXXXX - Just ignore the 01)
User avatar
Shannon Lockwood
 
Posts: 3373
Joined: Wed Aug 08, 2007 12:38 pm

Post » Fri Oct 08, 2010 5:11 am

Try modifying the Script to this...

Begin ScriptEffectStart	If ( Player.IsSpellTarget TabaxiNightEye == 1 )		Player.RemoveSpell TabaxiNightEye	ElseIf ( Player.IsSpellTarget TabaxiNightEye == 0 )		Player.AddSpell TabaxiNightEye	EndifEnd


This is the way I had to do it in my Vampirism Mod to stop it randomly doing what you describe-- hopefully it will help :)


As for Console RemoveSpell function You'll need 2 things:
1. The Spells Editor ID, found in the Mod itself
2. Your Mod LO Position, and the ID -- You're best using something like Wrye Bash for that (I think OBMM also does it, but I've not used it for ages).

Then it is:
Player.RemoveSpell XX000000


The XX is the Load Order Position ID (I think these go fromm 01 - FF, but someone else might be able to confirm) and the 000000 is the Spell's Editor ID (Which in the CS is usually 01XXXXXX - Just ignore the 01)


Thanks much!

This was a problem I had years ago when I modded vampires and khajiit to have night eye as a toggle, but I don't remember if I ever had a solution beyond remembering to turn it off before saving.
User avatar
Hayley O'Gara
 
Posts: 3465
Joined: Wed Nov 22, 2006 2:53 am

Post » Fri Oct 08, 2010 1:03 pm

Wouldn't it also work in spell scripts without any "Player." parts so it automatically affects the actor the script is running on? GetSelf should only ever be needed when you need the affected actor as an explicit parameter to a function. At least that's how I recall it. Or am I mistaken?
User avatar
Kayla Keizer
 
Posts: 3357
Joined: Tue Dec 12, 2006 4:31 pm

Post » Fri Oct 08, 2010 1:04 pm

Wouldn't it also work in spell scripts without any "Player." parts so it automatically affects the actor the script is running on? GetSelf should only ever be needed when you need the affected actor as an explicit parameter to a function. At least that's how I recall it. Or am I mistaken?


That seems like it should work, but it's been years since I've done anything with Oblivion scripting. The script above I got from the race balancing project.

The toggling and detoggling worked fine before I saved and reloaded, but I saved with night eye on. While I fixed the problem by just using an earlier save, I didn't want to have to keep dealing with it.
User avatar
N3T4
 
Posts: 3428
Joined: Wed Aug 08, 2007 8:36 pm


Return to IV - Oblivion