How can I determine if the night-eye shader is currently act

Post » Fri May 04, 2012 5:35 am

So I've really bungled it, but I suppose if I find a solution it's just as well.

So, I managed to deliver a bad .ini file which gave night-eye powers to a lot of people that shouldn't have had them. I did the big no-no and made my night-eye effect an ability, so that when the user uninstalled the mod, the game thought the player had a night-eye bonus when they shouldn't have. This is because the game saved the night-eye bonus value with the game save, and restored it with my mod no longer active.

Now I've figured out how to manually clear the value, as well as by script.

I can also either manually clear out the effect just by doing a quick save and load save, or force a hidden object that has the night-eye effect to be added, equipped, unequipped, and then removed.

However, I ran into a weird scenario in which I managed to clear the NightEyeBonus value, but when I ran the auto add/remove item, nothing happened. And I'm still stuck with the night eye shader effect, or will be until I save and reload.

I'd really like to not have the player force themselves to do the save reload thing. Does anyone know any method of determining whether or not the night-eye shader is currently active or not?

Sorry this is so rambling, but I haven't had a lot of sleep.

Help!
User avatar
Riky Carrasco
 
Posts: 3429
Joined: Tue Nov 06, 2007 12:17 am

Post » Fri May 04, 2012 9:20 am

Have you tried using http://cs.elderscrolls.com/index.php/HasMagicEffect NEYE? It sounds though like the problem isn't removing the effect, but the add/remove item. If you add an item to the player's inventory, you need to put a little timer script in there so that it waits a couple of seconds before removing it again. Here's the page on http://cs.elderscrolls.com/index.php/RemoveItem that has that comment.
User avatar
Alycia Leann grace
 
Posts: 3539
Joined: Tue Jun 26, 2007 10:07 pm

Post » Fri May 04, 2012 8:51 pm

HasMagicEffect NightEye doesn't work.

The Shader appears based on the NightEyeBonus actor value. Each time a night-eye effect is added or removed, it only adds or subtracts from the effect. So if there is an error and the NightEyeBonus starts as 1, if there are no actual active NightEye Magic Effects, the shader still kicks in.

If you then set the NightEyeBonus to 0 in the control panel, the effect does not go away until you either save and reload the game or add and remove a night-eye effect item, which triggers the system to update itself.

Maybe another possibility is to cast a custom night-eye spell effect on the player with a one second duration and see if that works. Granted it would kill any invisibility effects, but this fix would only have to happen the one time (I hope).

I'll also look at the timer thing.
User avatar
Jinx Sykes
 
Posts: 3501
Joined: Sat Jan 20, 2007 11:12 pm

Post » Fri May 04, 2012 11:54 am

Did you see http://cs.elderscrolls.com/index.php/NightEyeBonus? That doesn't sound too bad and perhaps you can just ask people to do that. Put a section in your readme with those instructions as well.
User avatar
Carlos Vazquez
 
Posts: 3407
Joined: Sat Aug 25, 2007 10:19 am

Post » Fri May 04, 2012 11:47 am

Did you see http://cs.elderscrolls.com/index.php/NightEyeBonus? That doesn't sound too bad and perhaps you can just ask people to do that. Put a section in your readme with those instructions as well.
See it? Who do you think wrote it? ;)
User avatar
Jade
 
Posts: 3520
Joined: Mon Jul 10, 2006 6:42 am

Post » Fri May 04, 2012 11:01 am

:rofl: That is too funny. Well the workaround doesn't sound too bad to me. My only other suggestion is to use modAV instead of setAV.
User avatar
Juan Suarez
 
Posts: 3395
Joined: Sun Nov 25, 2007 4:09 am

Post » Fri May 04, 2012 1:16 pm

It's not a matter of modifying the value. The problem is that modifying the value doesn't trigger refreshing the effect. I keep getting stuck in these exceptions where the night eye shader effect is on, but the NightEyeBonus is 0, and the HasMagicEffect NEYE returns 0, so the script assumes everything is okay.

It's just lame that there doesn't seem to be a way to determine if the actual shader itself is active, 'cause then this would be a piece of cake.
User avatar
Sweet Blighty
 
Posts: 3423
Joined: Wed Jun 21, 2006 6:39 am


Return to IV - Oblivion