I am attempting to make it so that a ship only appears between 8pm to 9pm. The final script will also enable/disable more objects/actors and dialogue options but I just wanted to get the ship done first. I thought I had it with the script below. The ship is initially disabled and when player enters the trigger box between 8-9pm the ship does enable (btw there won't be any access/doors to the ship it'll just be there) but when player enters the trigger box outside of the allotted "enable hour" it doesn't disable. I'm not quite sure how to accomplish this so this is the script so far which as I said partially works.
ObjectReference Property Obj1 Auto
float Function GetCurrentHourOfDay()
float Time = Utility.GetCurrentGameTime()
Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit
Time *= 24 ; Convert from fraction of a day to number of hours
Return Time
EndFunction
Auto State Waiting
Event OnTriggerEnter (objectReference triggerRef)
float curHour = GetCurrentHourOfDay()
if (curHour >= 20.0 && curHour <= 21.0)
Obj1.Enable()
Else
if (curHour < 20.0)
Obj1.Disable()
Endif
GoToState("Dormant")
Endif
EndEvent
EndState
State Dormant
;does nothing
EndState