leedavis Posted April 11, 2012 Share Posted April 11, 2012 (edited) I'm trying get a damaged house to disappear and a normal house to appear. I tried this script: Scriptname A00BYOH extends ObjectReference {Starting script} import debugimport utility int showhouse Auto STATE Waiting EVENT onActivate (objectReference triggerRef) if showhouse == 0 byohfarmhouse05door.Enable() showhouse = 1 endif endEVENTendState I get this error: Starting 1 compile threads for 1 files...Compiling "A00BYOH"...c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\A00BYOH.psc(12,2): variable byohfarmhouse05door is undefinedc:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\A00BYOH.psc(12,22): none is not a known user-defined typeNo output generated for A00BYOH, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on A00BYOH\ The Creation Kit Wiki doesn't explain how to use .Disable() or .Enable() http://www.creationkit.com/Disable_-_ObjectReferencehttp://www.creationkit.com/Enable_-_ObjectReference So what did they fail to explain.Thanks. Edited April 11, 2012 by leedavis Link to comment Share on other sites More sharing options...
gasti89 Posted April 11, 2012 Share Posted April 11, 2012 Have you defined properties? Link to comment Share on other sites More sharing options...
leedavis Posted April 11, 2012 Author Share Posted April 11, 2012 Have you defined properties? What you see is all I know to do...the Wiki didn't say anything about havign to DEFINE anything. Link to comment Share on other sites More sharing options...
gasti89 Posted April 11, 2012 Share Posted April 11, 2012 right click on the script ---> edit properties ---> new Object Reference property ---> fill it with your damaged house (name it whatever) Object Reference property ---> fill it with your new house (name it whatever) Now in the script use the name of the properties instead of the formIDs of the houses Also, what does that showhouse means? I can't understand your IF Link to comment Share on other sites More sharing options...
leedavis Posted April 11, 2012 Author Share Posted April 11, 2012 (edited) right click on the script ---> edit properties ---> new Object Reference property ---> fill it with your damaged house (name it whatever) Object Reference property ---> fill it with your new house (name it whatever) Now in the script use the name of the properties instead of the formIDs of the houses I tried this and it will not creat the property...the Script Errors Window opens and says the same thing. What do you mean FILL? There is no option to fill. only TYPE, NAME, ARRAY (check box), INITIAL VALUE, HIDDEN (check box), and DOCUMENTATION STRING As for the IF showhouse, this just means do once (OBLIVION had a doonce function) Edited April 11, 2012 by leedavis Link to comment Share on other sites More sharing options...
leedavis Posted April 11, 2012 Author Share Posted April 11, 2012 okay so I looked at my script and it added this line ObjectReference Property byohOldfarmhouse Auto but how does this help the script know which object to disable/enable Link to comment Share on other sites More sharing options...
gasti89 Posted April 11, 2012 Share Posted April 11, 2012 What do you want to trigger the enabling? An activation of something or an entering in a trigger zone? What is this script attached to? Link to comment Share on other sites More sharing options...
leedavis Posted April 11, 2012 Author Share Posted April 11, 2012 What do you want to trigger the enabling? An activation of something or an entering in a trigger zone? What is this script attached to? The script is attached to a nordic pull bar. As of now, I just want to learn how to enable/disable Static objects, so pull the bar. old house disappears, new house appears. Very simple. Later I'll add this to a quest so the player cant see the enable disable action. Thanks for yuo help by the way. If you know of tutorials for this, please send me a link. I just could figure it out mysefl using teh links given above. Link to comment Share on other sites More sharing options...
leedavis Posted April 11, 2012 Author Share Posted April 11, 2012 I looked at the script for the Nordic Pull bar... Copy and pasted everything but the name and added the lines you meantioned...to get this Scriptname A00BYOH extends ObjectReference {Starting script} ObjectReference Property byohfarmhouse05door Auto import debugimport utility Auto STATE Waiting EVENT onActivate (objectReference triggerRef) self.BlockActivation(true) playAnimationandWait("Pull","Reset") byohfarmhouse05door.Enable() self.BlockActivation(false) endEVENTendState I deleted the norpullbarSCRIPT so mine replaced it. The animation still worked BUT my extra line did not get implented. I must still be missing something important. Link to comment Share on other sites More sharing options...
gasti89 Posted April 11, 2012 Share Posted April 11, 2012 I think direcltly doing it with a quest is reeeeeeally easier ;) http://www.creationkit.com/Scripting_tutorial_lever Watch this tutorial to understand how levers work (there's something out of my knowledge, like the animations fo the lever and the positioning By the way, you script (apart from the animations and position parts) should be something like this: Scriptname myScript extends ObjectReference ObjectReference property BurningHouse auto ObjectReference property NewHouse auto Event OnActivate(ObjectReference akActionRef)if (newHouse.IsDisabled())BurningHouse.Disable()newHouse.Enable()endifEndEvent After compiling this, go to properties, select them and fill the "value" dropdown with the references of the 2 objects With this script, when you activate the lever, the game will check if the new house is disabled. If yes, it will disable the burning one and activate the new house. Let me know if it works, and again, let me know how you want to do it via quest, cause it's reeeeally easier! Link to comment Share on other sites More sharing options...
Recommended Posts