Ghost visual effect won't wear off. Script help.

Post » Thu Aug 15, 2013 5:22 am

So I thought I might try to add the same transparency the stealth NPCs get in my mod, to the 24 hour powers of the player if the player chooses to drink the Berne blood potion, I figured it would add to the immersion, and combined with fortify sneak would be the closest thing to ever getting chameleon back. For the stealth NPCs in my mod it isn't an issue really if they are constantly transparent. For the player that's a different matter entirely though. Even though it appears to have a duration, the player is permanently transparent after casting the spell.

The script involving the spell exists in the default game, but since I believe I need to alter it, I am going to need a duplicate copy of the script to avoid messing with default game stuff. If I make a duplicate renamed copy of this script, see where it says "{Check this if you do not want to return to normal after the spell ends}"? That makes me suspect an altered renamed duplicate of this script, is going to be needed to make this work, although I'm really bad at scripting. So anyways, can someone who knows scripting better than me, please make a slightly altered version of this that I can copy and paste to make the script I need for this to work properly?

So here is the script in question.

Spoiler
scriptName magicSetActorAlphaScript extends ActiveMagicEffect
{Scripted effect Setting the Alpha of an Actor and back}

;======================================================================================;
; PROPERTIES /
;=============/


float property AlphaValue = http://forums.bethsoft.com/topic/1470270-ghost-visual-effect-wont-wear-off-script-help/1.0 auto
{Alpha Value the target will be faded to.}
Bool property FadeToAlpha = False auto
{Do we fade the alpha to the value over time?}
Bool property DontFadeBack = False auto
{Check this if you do not want to return to normal after the spell ends}

;======================================================================================;
; EVENTS /
;=============/


Event OnEffectStart(Actor Target, Actor Caster)
If AlphaValue != 1.0 ;Do we have any data?
Target.SetAlpha (AlphaValue, FadeToAlpha)
EndIf
EndEvent

Event OnEffectFinish(Actor Target, Actor Caster)
if DontFadeBack == False
If AlphaValue != 1.0 ;Do we have any data?
Target.SetAlpha (1.0, FadeToAlpha)
EndIf
endif
EndEvent

User avatar
Gemma Archer
 
Posts: 3492
Joined: Sun Jul 16, 2006 12:02 am

Post » Thu Aug 15, 2013 12:24 pm

You don't shouldn't need an altered version.

Bool property FadeToAlpha = False auto

The actor will "pop" to alpha.

Bool property DontFadeBack = False auto

The actor will fade back because DontFadeBack is false by default.

If you attach this script as-is, I believe it will do what you want. I wasn't aware that there was an issue with adjusting the alpha value of the player.

Make sure that the duration field of the spell is actually counting down in your active magic effects menu in-game?

User avatar
Sophh
 
Posts: 3381
Joined: Tue Aug 08, 2006 11:58 pm

Post » Thu Aug 15, 2013 12:24 pm

Here are some screenshots if they help.

http://i.imgur.com/pLQI6rl.png

http://i.imgur.com/KBAW8Jn.png

The casting type is cast and forget, I also tried constant effect, but that didn't work either.

Also after the spell wore off, the transparency still remained yet it wasn't listed in active effects.

User avatar
John Moore
 
Posts: 3294
Joined: Sun Jun 10, 2007 8:18 am

Post » Thu Aug 15, 2013 4:57 am

That's odd.

What did you set the AlphaValue property to?

User avatar
ashleigh bryden
 
Posts: 3446
Joined: Thu Jun 29, 2006 5:43 am

Post » Thu Aug 15, 2013 4:13 pm

I'm not sure really, I'm using the default script atm although I didn't alter it. If I end up needing to alter it I'm going to make a duplicate script. Also I could be mistaken, though I think that possibly ghost visual magic effects were created with constantly effect stuff in mind, and may have not been intended to be used as spells being casted temporarily, but then that guess could be totally off.

User avatar
Budgie
 
Posts: 3518
Joined: Sat Oct 14, 2006 2:26 pm

Post » Thu Aug 15, 2013 7:02 pm

You do not need to alter the actual script code to change the value of a property. That's done in the CK. Select the script, and select Properties.

The default value according to the code is 1.0. The trigger in the code to restore the alpha value is if the Alpha Value IS NOT 1.0. So you must set the AlphaValue property some other value between 0.0 and 1.0 in order for the OnEffectFinish event to do its job.

User avatar
Siidney
 
Posts: 3378
Joined: Fri Mar 23, 2007 11:54 pm


Return to V - Skyrim