Script to disable actor by day and enable by night

Post » Wed Aug 21, 2013 8:43 am

As a last resort I've been looking around for a simple script that I can add to my NPCs who fight outside at night, that simply makes them disappear via disable when the sun comes up, and makes them reappear/be renabled when the sun goes down. I've had a hard time trying to find scripts to use, because mods that do these things seem to be relatively rare. I've also been thrown for a loop when attempting to use this script, because unlike other scripts I've used in the past- pretty much teleport scripts, there doesn't appear to be a click to make linked reference option for this.

Does anyone know of a mod that uses a script to do just that, so I can add a similar script to my respawning npcs? Also as always to try to save both our time, I'll put up some screenshots in addition to the script I attempted to use. (It was an imitation of this http://www.gamesas.com/topic/1399404-help-with-timed-respawn-script/?hl=night but slightly altered with the debug message removed).

Scriptname ALectraVampRaiderVanish  Extends ActorGlobalVariable Property GameHour AutoEvent OnInit()    RegisterForSingleUpdate(5)EndEventEvent OnUpdate()    RegisterForSingleUpdate(5)    Float fTime = GameHour.GetValue()    If IsEnabled() != (fTime > 20.0 || fTime < 7.0)        If IsEnabled()            Disable()        Else            Enable()            If IsDead()                Resurrect()            EndIf        EndIf    EndIfEndEvent

This mod which I've invested over half a year into is nearly ready to release, if I can make a script like this work, then I can probably finally release it today. If anyone has any advice I'd be extremely thankful.

User avatar
Oscar Vazquez
 
Posts: 3418
Joined: Sun Sep 30, 2007 12:08 pm

Return to V - Skyrim