Using Object Reference Interval: Difference between revisions

Jump to navigation Jump to search
m
Convert source tags to syntaxhighlight
imported>Langerz82
m (Convert source tags to syntaxhighlight)
 
Line 8: Line 8:
Take a look at the file and read the comments.
Take a look at the file and read the comments.


<source lang="papyrus">
<syntaxhighlight lang="papyrus">
Bool Property useLooking Auto ; Should we take into account Line of Sight or not.
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.
Int Property fMinutesInterval Auto ; Desired Minutes Interval /10.0 (minutes) ex.
GlobalVariable Property GameHour Auto ; The Games Hour leave default.
GlobalVariable Property GameHour Auto ; The Games Hour leave default.
</source>
</syntaxhighlight>


* useLooking - Set to TRUE if you want the interval to occur only when its in the players view.
* 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.
* fMinutesInterval - How many minutes can pass before the OnTimeElapsed Overridden function will get called.


<source lang="papyrus">
<syntaxhighlight lang="papyrus">
;/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ OVERRIDE FUNCTIONS
+ OVERRIDE FUNCTIONS
Line 26: Line 26:
;Debug.Notification("ObjectReferenceInterval(Event:OnTimeElapsed)")
;Debug.Notification("ObjectReferenceInterval(Event:OnTimeElapsed)")
EndEvent
EndEvent
</source>
</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.
* OnTimeElapsed is called when the minutes interval is reached and should be overridden and include what you want to do with the Object Reference.
Line 32: Line 32:
* 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.
* 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.


<source lang="papyrus">
<syntaxhighlight lang="papyrus">
;/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ This script enables an ObjectReference like a door locked and unlocked
+ This script enables an ObjectReference like a door locked and unlocked
Line 55: Line 55:
isLocked = !isLocked
isLocked = !isLocked
EndEvent
EndEvent
</source>
</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.
* 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.

Navigation menu