skyrimsasuke Posted August 21, 2019 Share Posted August 21, 2019 So I'm trying to attach this script to an NPC so that they spawn semi-transparent, but nothing happens. ScriptName GhostInvis1 extends Actor Function SetAlpha(float afTargetAlpha, bool abFade = false) native float afTargetAlpha = 0.1 Can anyone tell me what I'm doing wrong? Normally you can set an npc semi-transparent with SetActorAlpha <value> using console commands, I don't know how to accomplish this with papyrus though because I am not a scripter. Link to comment Share on other sites More sharing options...
SKKmods Posted August 21, 2019 Share Posted August 21, 2019 ScriptName GhostInvis1 extends Actor Event OnLoad() float afTargetAlpha = 0.1 Self.SetAlpha(afTargetAlpha, abFade = false) End Event Link to comment Share on other sites More sharing options...
skyrimsasuke Posted August 21, 2019 Author Share Posted August 21, 2019 (edited) ScriptName GhostInvis1 extends Actor Event OnLoad() float afTargetAlpha = 0.1 Self.SetAlpha(afTargetAlpha, abFade = false) End Event It fails to compile GhostInvis1.psc(6,4): no viable alternative at input 'Event'No output generated for GhostInvis1, compilation failed.Edit: Nevermind, thanks it was 'EndEvent' not 'End Event' Edited August 21, 2019 by skyrimsasuke Link to comment Share on other sites More sharing options...
skyrimsasuke Posted August 21, 2019 Author Share Posted August 21, 2019 Is there a way to make it repeat indefinitely? it becomes visible again after a few seconds Link to comment Share on other sites More sharing options...
SKKmods Posted August 21, 2019 Share Posted August 21, 2019 (edited) Messy, dont want to spawn too many of these. Looping scripts like this can get out of control to cause lag leading to CTD so be careful. ScriptName GhostInvis1 extends Actor Event OnLoad() MakeInvisible() EndEvent Function MakeInvisible() If (Self.IsDead() == False) && (Self.IsDisabled() == False) Self.SetAlpha(afTargetAlpha = 0.1, abFade = false) StartTimer(5) ;in seconds EndIf EndFunction Event OnTimer(Int iTimer) If (Self.Is3dLoaded() == True) MakeInvisible() EndIf EndEvent Event OnUnload() CancelTimer() EndEvent Edited August 21, 2019 by SKK50 Link to comment Share on other sites More sharing options...
skyrimsasuke Posted August 22, 2019 Author Share Posted August 22, 2019 (edited) Thanks! Worked like a charm, I'm making a ghost npc incase you couldn't tell and this is perfect. Edited August 22, 2019 by skyrimsasuke Link to comment Share on other sites More sharing options...
Recommended Posts