OminousVoice Posted July 28, 2012 Share Posted July 28, 2012 I'm attempting to script a custom npc to spawn and despawn at certain times each day. The npc is a ghost who only appears at night and will return at 8pm even if the player has defeated her previously. So I figured this might achieve that: Scriptname WoodcuttersWifeRespawnScript extends Actor GlobalVariable Property GameHour Auto Function Enable (bool abFadeIn = false) native Function Disable (bool abFadeOut = false) native Function Resurrect() native bool function isdead() native bool function SpawnTime() if GameHour.GetValue() == 20.0 Self.Enable() endif if GameHour.GetValue() == 7.0 Self.Disable() endif endFunction bool function ResurrectTime() if GameHour.getValue() >= 20.0 && self.isdead() self.resurrect() endif endfunction Unfortunately nothing happens in game. The npc dosen't enable (and resurrect if need be) at 8pm, nor does she disable at 7am. I'll add a couple of debug messages and see if any of these functions are being called, but in the mean time can anyone see if there's something amiss with my script? Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
OminousVoice Posted July 29, 2012 Author Share Posted July 29, 2012 UPDATE: I added some debug.trace messages, tested, and checked the log. I found this: [07/29/2012 - 02:06:22AM] warning: Variable ::gametime_var on script WoodcuttersWifeRespawnScript loaded from save not found within the actual object. This variable will be skipped. I have no idea what this means nor how to alleviate it. Once again any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
Recommended Posts