Using Activated Object Reference: Difference between revisions

Jump to navigation Jump to search
m
Convert source tags to syntaxhighlight
imported>Langerz82
m (Convert source tags to syntaxhighlight)
 
Line 9: Line 9:
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">
Float Property fCheckActiveInterval Auto ; Desired Update check time/5.0 ex.
Float Property fCheckActiveInterval Auto ; Desired Update check time/5.0 ex.
</source>
</syntaxhighlight>


* This property is how often the script is going to check the users conditions measured in real-time seconds.
* This property is how often the script is going to check the users conditions measured in real-time seconds.


<source lang="papyrus">
<syntaxhighlight lang="papyrus">
;/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ OVERRIDE FUNCTIONS
+ OVERRIDE FUNCTIONS
Line 37: Line 37:
Function ObjectInactive()
Function ObjectInactive()
EndFunction
EndFunction
</source>
</syntaxhighlight>


* The isObjectActive and isObjectInactive are the conditional functions you should override if you want to check something before the ObjectActive and ObjectInactive functions are called respectively. Return true when you want it to trigger the Object Active/Inactive functions, and false if you dont.
* The isObjectActive and isObjectInactive are the conditional functions you should override if you want to check something before the ObjectActive and ObjectInactive functions are called respectively. Return true when you want it to trigger the Object Active/Inactive functions, and false if you dont.
Line 45: Line 45:
* The following overrides the Conditionals to take into account day and time for the door Object to lock and unlock.
* The following overrides the Conditionals to take into account day and time for the door Object to lock and unlock.


<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; Overrided Function.
; Overrided Function.
Bool Function IsObjectActive()
Bool Function IsObjectActive()
Line 81: Line 81:
return false
return false
EndFunction
EndFunction
</source>
</syntaxhighlight>


* The following overides the Active/Inactive function by locking and unlocking the door respectively and showing a message to the Users when a Line-Of-Sight and the Conditions hold true.
* The following overides the Active/Inactive function by locking and unlocking the door respectively and showing a message to the Users when a Line-Of-Sight and the Conditions hold true.


<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; Overrided Function.
; Overrided Function.
Function ObjectActive()
Function ObjectActive()
Line 99: Line 99:
Self.Lock(FALSE, TRUE)
Self.Lock(FALSE, TRUE)
EndFunction
EndFunction
</source>
</syntaxhighlight>


* Find the jlTimedLock3 in the Creation Kit, under the Main menus Gameplay >> Papyrus Script Manager, look for jlTimedLock.
* Find the jlTimedLock3 in the Creation Kit, under the Main menus Gameplay >> Papyrus Script Manager, look for jlTimedLock.

Navigation menu