Editing
Using Object Reference Interval
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Instructions == First you should copy the [https://gist.github.com/Langerz82/2f6be9eb062356031b00 Object Reference Interval] into the Skyrim\Data\Scripts folder. Take a look at the file and read the comments. <syntaxhighlight lang="papyrus"> Bool Property useLooking Auto ; Should we take into account Line of Sight or not. Int Property fMinutesInterval Auto ; Desired Minutes Interval /10.0 (minutes) ex. GlobalVariable Property GameHour Auto ; The Games Hour leave default. </syntaxhighlight> * useLooking - Set to TRUE if you want the interval to occur only when its in the players view. * fMinutesInterval - How many minutes can pass before the OnTimeElapsed Overridden function will get called. <syntaxhighlight lang="papyrus"> ;/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + OVERRIDE FUNCTIONS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/; ; Override Event - When Object exceeds elapsed time. Event OnTimeElapsed() ;Debug.Notification("ObjectReferenceInterval(Event:OnTimeElapsed)") EndEvent </syntaxhighlight> * OnTimeElapsed is called when the minutes interval is reached and should be overridden and include what you want to do with the Object Reference. * Ok next you need to provide your script that extends from the ObjectReferenceInterval file. For this example we have a script that locks/unlocks an object at a specified interval. Copy the [https://gist.github.com/Langerz82/79acce714b77f3b8d481 Lock/Unlock Interval Example] to your Skyrim/Data/Scripts/Source folder. <syntaxhighlight lang="papyrus"> ;/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + This script enables an ObjectReference like a door locked and unlocked + at specified intervals. + The Properties for this examples should be set too: + useLooking = TRUE ; We only want the interval to occur when in view. + fMinutesInterval = 5.0 ; Every five minutes in game time call OnTimeElapsed. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/; ScriptName jlLockInterval extends ObjectReferenceInterval bool isLocked = false; ; Overrided Function. Event OnTimeElapsed() Debug.Notification("jlLockInterval(Event:OnObjectElapsed)") if (isLocked) Self.Lock(FALSE, TRUE) else Self.Lock(TRUE, TRUE) endif isLocked = !isLocked EndEvent </syntaxhighlight> * The following overides the OnTimeElapsed Event by locking and unlocking the door at the specified interval which in this case should be every 5 minutes. * Find the jlLockInterval in the Creation Kit, under the Main menus Gameplay >> Papyrus Script Manager, look for jlLockInterval. * Attach it to an object for example a box or door you wish to use as an example. * Set the following Properties for the script. [[File:jlLockInterval.jpg|700px]] * Save the Mod file and run and test in-game.
Summary:
Please note that all contributions to the CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
CreationKit:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Landing page
Tutorials
Game Systems
Editor Reference
Scripting Reference
Recent changes
Help
Tools
What links here
Related changes
Special pages
Page information
Page values