CreateDetectionEvent - ObjectReference: Difference between revisions

From the CreationKit Wiki
Jump to navigation Jump to search
(Linking to the actual explanation for detection and detection events.)
m (Convert source tags to syntaxhighlight)
 
Line 6: Line 6:


== Syntax ==
== Syntax ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
Function CreateDetectionEvent(Actor akOwner, int aiSoundLevel = 0) native
Function CreateDetectionEvent(Actor akOwner, int aiSoundLevel = 0) native
</source>
</syntaxhighlight>


== Parameters ==
== Parameters ==
Line 19: Line 19:


== Examples ==
== Examples ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; Creates a detection event for Bob at the tripwire location, 0 sound
; Creates a detection event for Bob at the tripwire location, 0 sound
TripwireProperty.CreateDetectionEvent(Bob)
TripwireProperty.CreateDetectionEvent(Bob)
</source>
</syntaxhighlight>
<br/>
<br/>
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; Creates a detection event for Bob at the tripwire location, 100 sound
; Creates a detection event for Bob at the tripwire location, 100 sound
TripwireProperty.CreateDetectionEvent(Bob, 100)
TripwireProperty.CreateDetectionEvent(Bob, 100)
</source>
</syntaxhighlight>


== See Also ==
== See Also ==
*[[ObjectReference Script]]
*[[ObjectReference Script]]

Latest revision as of 19:55, 5 September 2026

Member of: ObjectReference Script

Creates a detection event at this object's location.

Syntax[edit | edit source]

Function CreateDetectionEvent(Actor akOwner, int aiSoundLevel = 0) native

Parameters[edit | edit source]

  • akOwner: The "owner" of the detection event
  • aiSoundLevel: The sound level of the detection event (0 to 100). Values bigger than 100 are not used in vanilla scripts but they work.
    • Default: 0

Return Value[edit | edit source]

None.

Examples[edit | edit source]

; Creates a detection event for Bob at the tripwire location, 0 sound
TripwireProperty.CreateDetectionEvent(Bob)


; Creates a detection event for Bob at the tripwire location, 100 sound
TripwireProperty.CreateDetectionEvent(Bob, 100)

See Also[edit | edit source]