I've created a display for Unusual Gems/Stones of Barenziah. To activate the display, the player "use"s an activation trigger, an invisible volume floating out in front of the display much like is done with the player bookshelf. The activator trigger then calls a function in a separate trigger which pulls as many gems out of the player's inventory as will fit on the display and arranges them nicely.
The problem is, the script for the activator trigger doesn't work. Not "I activate it and nothing happens" doesn't work, but "doesn't appear in the game at all" doesn't work. It sends an OnInit() event when the save is loaded, but doesn't send an OnCellLoad() event when its containing cell is loaded. The script is initially disabled, but for now can be enabled by pressing a button in the cell it's in (for testing purposes). All other objects enabled by the test button enable properly and send OnCellLoad() events normally. The script was attached to a unique form, an Activator called "Unusual Gem Display." One of the first things I tried was deleting that activator, creating a completely new one, and attaching the script to the new one, but I had the same problem, which makes me suspect that it's the script itself that's having some sort of issue. Here is the script in its entirety (DbHOC is an abbreviation for the name of my mod):
Scriptname DbHOCGemDisplayClickTriggerScript extends ObjectReference {Script which activates the Gem Display when clicked by the player.} import debugimport utility DbHOCGemDisplayTriggerScript Property DbHOCGemDisplayTrigger Auto{A reference to the gem display trigger object.} GlobalVariable Property DbHOCDebugMode Auto{Is DbHOC debug mode enabled?} bool Property DebugMode Auto Hidden{Store locally whether DbHOC debug mode is enabled to avoid calling GetValueInt() on the GlobalVariable property repeatedly.} Function setDebugMode() if DbHOCDebugMode.getValueInt() DebugMode = true else DebugMode = false endIfendFunction EVENT OnCellLoad() if DebugMode Debug.Trace(self + ": OnCellLoad() event triggered") ;this message never appears in my papyrus log, while all other custom scripts display a similar message normally EndIf setDebugMode()endEVENT Event OnInit() Debug.Trace(self + ": if you're seeing this, then I'm not completely ******* useless.") ;this message DOES appear in my Papyrus logendEvent Auto State Active ;in this state, the trigger can activate the gem display trigger when "used" by the player Event OnBeginState() if DebugMode Debug.Trace(self + ": entering Active state") EndIf endEvent Event OnEndState() if DebugMode Debug.Trace(self + ": leaving Active state") EndIf endEvent EVENT OnActivate(ObjectReference TriggerRef) if DebugMode Trace(self + ": OnActivate() triggered, signalling gem display trigger") endif DbHOCGemDisplayTrigger.addGems() endEVENTEndState State Inactive ;in this state, the trigger does nothing when activated Event OnBeginState() if DebugMode Debug.Trace(self + ": entering Inactive state") EndIf endEvent Event OnEndState() if DebugMode Debug.Trace(self + ": leaving Inactive state") EndIf endEvent Event OnActivate(ObjectReference TriggerRef) ;does nothing EndEventEndState
I've been combing it over looking for something that could cause it to just straight-up not work, but I'm not seeing anything. Maybe a different set of eyes will. Failing that, does anyone have any ideas why this script refuses to appear in-game?