Complete Example Scripts: Difference between revisions

Jump to navigation Jump to search
Tried to make the first section a bit clearer, and added titles to the section containing actual examples
imported>Evernewjoy
imported>Cipscis
(Tried to make the first section a bit clearer, and added titles to the section containing actual examples)
Line 1: Line 1:
==Complete Example Scripts==


== Complete Example Scripts ==
===Script Instantiation===


* '''Script Instantiation'''
Please remember that few example scripts will be complete by themselves, attach a script to an object in the Creation Kit before it will run. The exception is for "library" scripts, such as the [[Utility Script]], which contain definitions of global functions for use in other scripts.


Please remember that no example scripts are complete by themselves, you must create an object in your cell and add this script to the object.
===Property Setting===


* '''Property Setting'''
And if the script has any properties, those properties must be set on the object to which the script is attached in the Creation Kit before the script will work correctly.


And if the script has any properties, those properties must be set to actual values before script will work.
===Script Name===


* '''Script Name'''
If you use any of these example scripts, you can change the name to anything else, but if you're creating the file outside of the Creation Kit you must make sure it also matches the name of your file.


You can change the name in script below to be anything you want, but the name must match what you type into the editor when you select [NEW] to make a new script.


So it is best to make a new script, give it a name, and change the name of the script examples below to match the name you typed in.
==Scripts==




♥ and thanks to our friends at Bethesda!
===A Trigger To Activate When Player Walks Through It===
 
The Creation Kit is Beautiful!
 
 
----
 
 
'''A Trigger To Activate When Player Walks Through It
'''
<source lang="papyrus">
<source lang="papyrus">
Scriptname ExampleTrigger extends ObjectReference
Scriptname ExampleTrigger extends ObjectReference
Line 43: Line 34:
</source>
</source>


'''To Make This Script Work'''
====To Make This Script Work====


Select an existing object in your cell
Select an existing object in your cell
Line 60: Line 51:
* Then go in-game and walk into the space where this invisible box is.
* Then go in-game and walk into the space where this invisible box is.


 
====Uses:====
'''Uses:'''


* Create events that depend on player positioning
* Create events that depend on player positioning
Line 70: Line 60:




----
===A Fully Functional Dwemer Button===
 
 
'''A Fully Functional Dwemer Button'''
<source lang="papyrus">
<source lang="papyrus">
Scriptname DwemerButtonExampleScript extends ObjectReference   
Scriptname DwemerButtonExampleScript extends ObjectReference   
Line 112: Line 99:
</source>
</source>


'''To Make This Script Work'''
====To Make This Script Work====


* You must create this script on a Activator object, probably a dwemer button :)
* You must create this script on a Activator object, probably a dwemer button :)
Anonymous user

Navigation menu