jtucker40 Posted July 13, 2015 Share Posted July 13, 2015 Hi guys, I'm currently working on trying to script a simple modification where if a certain reference container contains a specific item, the script enables a referenced object in-game. Basically, I'm trying to something like the weapon wall from Underground Hideout. The base script I'm using as a reference however is not from UH, but instead the script from the TTW Interiors Rivet City player home that displays toys around your house depending on if they're in a chest or not. Here's what I have: SCN ItemDisplay Script Begin OnClose DisplayBoxREF If DisplayBoxREF.GetItemCount WeapLaserRifle >= 1 LaserRifleREF.Enable endif If DisplayBoxREF.GetItemCount WeapLaserRifle == 0 LaserRifleREF.Disable endif endif end Here I'm trying to have a laser rifle static on the wall be displayed whenever a Laser Rifle is placed inside the container "DisplayBoxREF." The script saved fine in the GECK, and I have the script selected in the appropriate box for the Display Box base object, however in-game it doesn't appear to be working. The rifle on the wall is enabled initially, even when there is nothing inside the display box. There didn't seem to be much to the original TTW script, and that worked fine, so I'm not sure what I'm doing wrong. I don't know much about scripting so any help would be appreciated. Link to comment Share on other sites More sharing options...
jtucker40 Posted July 16, 2015 Author Share Posted July 16, 2015 (edited) Made sure I have "persistent reference" ticked on both references and "initially disabled" ticked on the laser rifle but it's still not working. Does anyone know what could be going wrong? Edited July 16, 2015 by jtucker40 Link to comment Share on other sites More sharing options...
ThatOtherUser Posted July 16, 2015 Share Posted July 16, 2015 Should try throwing some message displays in there that print out the conditions of what's going on. Can't really put together a script example for you at the moment, though :/. Have you tried running it OnOpen instead? Just a different case, see if that even triggers? Your logic is sound from what I can tell, at the least. Link to comment Share on other sites More sharing options...
Recommended Posts