Background for Skyrim SE
Member of the Actor script
voidfunctionSetAlpha(floatafTargetAlpha, boolabFade=false)Native

Description

Wiki Description

Sets this actor's alpha value, optionally fading them to that value rather then popping.

Documentation Comment

Sets this actor's alpha - with an optional fade to that alpha
The alpha will be clamped between 0 and 1


Caveats

CK Wiki - Notes

  • The player cannot be faded completely out and will always remain partially visible.
  • The fade boolean does not work if you set the alpha to (0.0). If you wish to fade to zero, then it must be set to (0.1) and then use Utility.Wait(0.3) (or any equally small number), calling the function afterwards to set to (0.0).
  • This function cannot be called on a dead or disabled actor. You will get an error that the actor has no AI process.

  • Actors with an alpha value less than 1 will not be able to ForceGreet the player, unless they are flagged as a ghost (either on the base actor or via the SetGhost command). Their package will run and they will approach the player when in range, but will not initiate dialogue.

    • Note that setting an NPC as a ghost will make them immune to all damage, and all weapons pass through them without playing hit effects or triggering hit events.
    • You can temporarily set an NPC as a ghost for the sake of a ForceGreet package through a package fragment script. Call akActor.SetGhost(true) when the package begins and akActor.SetGhost(false) when the package ends.

Parameters

floatafTargetAlpha

CK Wiki Description

The target alpha value, clamped to the 0 to 1 range. 0 is completely transparent, 1 is completely visible.

boolabFade=false

CK Wiki Description

If true, the actor will fade over time - otherwise they will pop to the value.

  • Default:False

Examples

; Pop the ghost to half-transparent
Ghost.SetAlpha(0.5)
; Fade the ghost to mostly visible
Ghost.SetAlpha(0.9, true)

Auto-Generated Example

float myFloat__afTargetAlpha
bool myBool__abFade

myActor__toCallFunctionOn.SetAlpha(myFloat__afTargetAlpha, myBool__abFade)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.