I've made a new creature race based on chaurus that I want only to appear anywhere in an exterior cell (I won't be putting them in interiors) at night, between the hours of 9pm (21.0) and 6.15am (6.25). I thought this script would achieve this...
GlobalVariable Property GameHour AutoActorBase Property NightFlyer AutoFloat fUpdateInterval = 5.0Event OnInit() RegisterForSingleUpdate(fUpdateInterval)EndEventEvent OnUpdate() Float curHour = GameHour.GetValue() If (curHour > 6.0 && curHour < 21.0) ; day If (!IsEnabled()) NightFlyer.Disable() EndIf Else ; night If (IsEnabled()) NightFlyer.Enable() EndIf EndIf RegisterForSingleUpdate(fUpdateInterval)EndEvent
But get these errors...
(16,23): Disable is not a function or does not exist
(20,23): Enable is not a function or does not exist
Also I considered that if player is in battle with one of these creatures and it disables, that would be weird. I checked Wiki and there is a script which uses LOS, this I thought should do it...
Actor Property PlayerREF Auto ; <-- Imperative for expedienceBool Property bEnableStuff Auto ; Leave as default or 'False'Float Property fHourToDisable Auto ; Desired disable time/6.25 for example's sakeFloat Property fHourToEnable Auto ; Desired enable time/21.0 for example's sakeFloat Property fUpdateInterval Auto ; 15.0 works well and isn't too frantic.GlobalVariable Property GameHour Auto ; Pointed to engine maintained, special GlobalVariableActorBase Property kYourObject Auto ; Pointed to your statue or object that is to enable Event OnInit() RegisterForSingleLOSGain(PlayerREF, Self) bEnableStuff = !kYourObject.IsDisabled() ToggleEnableStateIfApplicable()EndEvent Event OnGainLOS(Actor akViewer, ObjectReference akTarget) RegisterForSingleLOSLost(PlayerREF, Self) RegisterForSingleUpdate(fUpdateInterval) ToggleEnableStateIfApplicable()EndEvent Event OnLostLOS(Actor akViewer, ObjectReference akTarget) RegisterForSingleLOSGain(PlayerREF, Self) UnregisterForUpdate() ; Stop polling ToggleEnableStateIfApplicable()EndEvent Event OnUpdate() ToggleEnableStateIfApplicable() RegisterForSingleUpdate(fUpdateInterval)EndEvent Function ToggleEnableStateIfApplicable() Float fTime = GameHour.GetValue() If bEnableStuff != (fTime > fHourToEnable || fTime < fHourToDisable) bEnableStuff = !bEnableStuff If bEnableStuff kYourObject.Disable() Else kYourObject.Enable() EndIf EndIfEndFunction
But get these errors...
(13,29): IsDisabled is not a function or does not exist
(39,15): Disable is not a function or does not exist
41,15): Enable is not a function or does not exist
Help please.