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== | |||
== | ===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. | |||
===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. | |||
===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. | |||
==Scripts== | |||
===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==== | |||
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:==== | |||
* Create events that depend on player positioning | * Create events that depend on player positioning | ||
| Line 70: | Line 60: | ||
===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==== | |||
* 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 :) | ||