Talk:Disable - ObjectReference

From the CreationKit Wiki
Jump to navigation Jump to search

I don't know if I have the right page ... but

I have had this issue for over a year now with the Enable() Disable() (latent functions) EnableNoWait() DisableNoWait() Non-latent functions. Using these simple functions in a small interior space has CONSISTENTLY caused CTD's. After a year, I have proven that it is precisely this, that causes a CTD. I have used Vanilla Skyrim, one mod - Skyrim with DLC and one mod - Skyrim w/DLC's and 28 mods. I am a programmer analyst, not unfamiliar with programming in papyrus. I have used a small ONE item enable/disable script in a room with NO containers or other scripts - I have used the same small script in homes with containers and other scripts - I have verified my game, I have re-installed my skyrim - I have used BOSS to ensure proper load order, I have re-arranged my load order - I have used TES5EDIT to clean all mods - I have examined the papyrus logs meticulously ... I am at my wit's end.

No errors in TES5EDIT - no missing assets - no conflicts ... no errors in papyrus, the log simply 'ends' with the last entry prior to re-entering the room or house - no errors in the CK. And I make good use of occlusion planes.

Now for the wrench in the works .. I created a LARGE interior space (home) with three floors, several occlusion planes (as usual), three quests and MANY enable/disable scripts - one the EXACT same one I'm having a problem with now (and the one I had a problem with last year)... it NEVER crashes. What the heck? Two significant differences - a very large home, and I had an NPC in the shower who activated it (disabling it) prior to the player killing the NPC and receiving the home as a reward. This mod has never failed - it has never crashed.

I don't understand. I don't drink ... but if I can't found out WHY this is happening ... I may have to start. Here is my very simple script that CTD's my player's home. If I remove the script - I have entered/exited the home SUCCESSIVELY over 40 times in/out/in/out with NO CTD.

Scriptname SeaPointShowerActivatorScript extends ObjectReference

ObjectReference Property SPShowerWaterfall Auto ObjectReference Property SPShowerSound Auto ObjectReference Property SPShowerLight Auto ObjectReference Property SPShowerFX Auto ObjectReference Property SPShowerPuddle Auto

Bool bToggle

Event OnActivate(ObjectReference akActionRef) bToggle = !bToggle If bToggle ; True ; Turn off shower SPShowerWaterfall.DisableNoWait() SPShowerSound.DisableNoWait() SPShowerLight.DisableNoWait() SPShowerFX.DisableNoWait() SPShowerPuddle.DisableNoWait() Else ; False ; Turn on Shower SPShowerWaterfall.EnableNoWait() SPShowerSound.EnableNoWait() SPShowerLight.EnableNoWait() SPShowerFX.EnableNoWait() SPShowerPuddle.EnableNoWait() Endif EndEvent


With all appropriate properties set correctly. This script is in a room, with 4 containers and one other enable/disable script for ambient sunbeams (that works fine). I have re-written this script to use the non-latency functions - as well as using an xmarker parent script / trigger script / linked ref script - just about EVERY way you can write an enable/disable. All to no avail.

Please note: I've used a simple enable/disable on other mods I've created, given an enable/disable script to friends for their player home mods and ALL of them CTD.

Please .. please help me.

--------------------------------------------------------------------------------------------------------------------

Hi!, try removing the line to disable the sound file and get back to me. - Wbunkey2244

--------------------------------------------------------------------------------------------------------------------

Howdy,

I've had an almost identical issue to this one for a long while now, and I think I've finally tracked down the culprit - the water. It seems that the game has issues performing certain operations on water objects (enable/disable, but also stuff like moving the object within a cell).

Like the original comment here, I tried a huge batch of possible solutions to no avail. Regardless of what I did, the same crash would occur: I could load the cell fine the first time, but after performing the change on the water, entering that cell again would instantly crash to the desktop. I also noticed that if I performed the action on the water from a different cell *without* first loading the water cell, I could enter that cell just fine and see the water disabled compared to how I had placed it in the CK. Exiting the cell, re-enabling the water, and entering the cell again caused the crash.

I imagine the issue comes from how the game handles the area below the water plane as being 'underwater'. Changing that within a cell that's loaded in memory may be causing problems for the engine.

So unless someone has found a workaround, I think we just have to find ways of avoiding performing actions on water. For me, that means having two copies of the area I have the water in, and using two doors placed directly on top of each other to access the areas individually. The script that would disable the water instead swaps the doors, creating the same overall effect. Obviously that doesn't work for a lot of cases, so you'll have to find your own solution.