Jump to content
ℹ️ Intermittent Download History issues ×

Scripting help using Disable/Enable on Statci objects


leedavis

Recommended Posts

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 debug

import utility

 

int showhouse

 

Auto STATE Waiting

EVENT onActivate (objectReference triggerRef)

if showhouse == 0

byohfarmhouse05door.Enable()

showhouse = 1

endif

 

endEVENT

endState

 

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 undefined

c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\A00BYOH.psc(12,22): none is not a known user-defined type

No 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_-_ObjectReference

http://www.creationkit.com/Enable_-_ObjectReference

 

So what did they fail to explain.

Thanks.

Edited by leedavis
Link to comment
Share on other sites

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

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 by leedavis
Link to comment
Share on other sites

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

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

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 debug

import utility

 

Auto STATE Waiting

EVENT onActivate (objectReference triggerRef)

self.BlockActivation(true)

playAnimationandWait("Pull","Reset")

byohfarmhouse05door.Enable()

self.BlockActivation(false)

endEVENT

endState

 

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

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()

endif

EndEvent

 

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...