Jump to content

Night active script?


Dimensionlord1

Recommended Posts

There are different ways on how to make it active and inactive, like moving it into a holding cell and replacing it with an inanimate placeholder or simply turning off its AI, locking it in place like was done with the statue in Bruma (doesn't always work 100% reliably though, as I've seen said statue run around and killing guards myself on returning to the city after a long time off a couple times... fun times :laugh: ).

However, the way to determine the time of day is pretty much straight forward though. It's used for guards to draw their torches at night, streetlights use it, too, for example.
GetCurrentTime or the global variable "GameHour" should be all that's needed.

 

edit: Coming to think of it, there might also be a way to script its AI packages so it's "sleeping" during the day but still possible to be woken up or something. But AI packages are beyond my scope of knowledge, sadly.

Edited by DrakeTheDragon
Link to comment
Share on other sites

There is a way to accomplish this via script; attach the following to your creature (or leveled list, if you're using one):



Begin OnLoad ;this block will only run when the cell containing your creature loads

  If GameHour >= 20 || GameHour <= 6 ;if it is after 8PM or before 6AM

     If GetDisabled == 1 ;if the spawn point is currently disabled

        Enable

     Endif

  ElseIf GameHour > 6 && GameHour < 20 ;if it is after 6AM and before 8PM

     If GetDisabled == 0 ;if the spawn point is NOT currently disabled

        Disable

     Endif

  Endif

End

That will make sure your creature only shows up at night.

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...