ibengames Posted November 15, 2018 Share Posted November 15, 2018 I watched this TuT from Darkfox127 about "Build Your Own Home" But his Script had more than i wanted so i just took the parts of it i need. Scriptname BYOHBuildingibenObjectReference Property EnableRef_01 autoObjectReference Property EnableRef_02 autoObjectReference Property EnableRef_03 autoObjectReference Property DisableRef_01 autoMiscObject Property CraftItem AutoEvent OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) Game.FadeOutGame(false, true, 2.0, 1.0) EnableAll() Game.GetPlayer().RemoveItem(CraftItem,1,True) Return EndEventFunction EnableAll() EnableRef_01.enable() EnableRef_02.enable() EnableRef_03.enable() DisableRef_01.disable() EndFunction Compiling was no Problem and it partly works ingame.At first i was able to set the item into the workbench, (the hearthfire and the selfmade) ive build the item and the script managed to delete the item as intended. But the enabling Part did not work.So i added the "FadeOutGame" but that made it even worse, the game does not fade out and the item does not get deleted, and still no enabling of the references.From the Script in the TuT i cant see what i did wrong.I hope someone can tell me my mistake. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 15, 2018 Share Posted November 15, 2018 I'm guessing you left the Extends part off of the Scriptname line when posting the code. Cause without that, I'd see no way that it would compile correctly and you stated that it compiled fine. Are you testing on a new game? Did you fill all properties correctly? Link to comment Share on other sites More sharing options...
ibengames Posted November 15, 2018 Author Share Posted November 15, 2018 Added "Extends ObjectReference" to the scriptname and yes testet it with new save and also yes i did fill the properties correct.It compiled correctly without the extends sadly it still does not enable the selected reference Link to comment Share on other sites More sharing options...
Myst42 Posted November 15, 2018 Share Posted November 15, 2018 For this kinds of issues, there's a diagnostic trickStep 1: Get Papyrus Util installedStep 2, Add MiscUtil.PrintConsole("Some Text" + SomeVariableOrProperty) In this case, you first want to know if your script is actually correctly set to that specific ObjectReference, so the line would be MiscUtil.PrintConsole("Enable" + EnableRef_01)If the console gives you an ID, it means at least it knows it should enable an object reference.For whatever reason, some times, some stuff makes references go "None" and it could be enabling nothing... or even the wrong ObjectreferenceAnother possibility is the script not doing anything at all, you can know this because when the function gets called, console will print nothing.Possibilities go far beyond simple variable testing, you can eventually test every level of functionality (Events, Functions etc..) of the script with this trick, and of course, eventually find the part where it went wrong. Link to comment Share on other sites More sharing options...
foamyesque Posted November 15, 2018 Share Posted November 15, 2018 I'm guessing you left the Extends part off of the Scriptname line when posting the code. Cause without that, I'd see no way that it would compile correctly and you stated that it compiled fine. Are you testing on a new game? Did you fill all properties correctly? It'll compile without the extends, but it won't do anything. Every event and function in the script is either declared in it or in objects that are either universally available (Game) or themselves specifically declared (the ObjectReference properties). I am not sure if it will receive OnContainerChanged events unless it does extend ObjectReference though. That's something you'd find out at runtime; I'd make it extend ObjectReference anyway just for clarity. Link to comment Share on other sites More sharing options...
Recommended Posts