Template:PapyrusFunction/doc

From the CreationKit Wiki
Jump to navigation Jump to search

A template for a Papyrus Function definition.

Parameters[edit source]

name
The name of the function, e.g. Activate
desc
The description of what the function does
return-type (optional)
The type of value the function returns, e.g. Int.
return-desc (required if return-type is set)
The description of what the function returns.
memberof (variadic)
The script that this function is a member of. Should be the plain name of the script (e.g. "ObjectReference"). This parameter is variadic, you can list multiple values by appending a number to the parameter name:
|memberof1=Foo
|memberof2=Bar
param-type (variadic)
The type of a function parameter. This parameter is variadic, you can list multiple values by appending a number to the parameter name:
|param-type1=[[Int]]
|param-type2=[[Float]]
param-type1 corresponds to the first function parameter, param-type2 to the second and so on.
param-name(variadic)
The name of a function parameter. This parameter is variadic, you can list multiple values by appending a number to the parameter name:
|param-name1=foo
|param-name2=bar
param-name1 corresponds to the first function parameter, param-name2 to the second and so on.
param-desc(variadic)
The description of a function parameter. This parameter is variadic, you can list multiple values by appending a number to the parameter name:
|param-desc1=foo
|param-desc2=bar
param-desc1 corresponds to the first function parameter, param-desc2 to the second and so on.
param-def(variadic)
The default value of a function parameter. This parameter is variadic, you can list multiple values by appending a number to the parameter name:
|param-def1=[[False]]
|param-def2=[[None]]
param-def1 corresponds to the first function parameter, param-def2 to the second and so on.
examples
Example usage content, usually a series of <pre>...</pre> blocks.
notes
Notes for the function, special cases, etc., usually a bulleted list.
also
A list of other articles related to this function that are worth mentioning.

Flags[edit source]

native
If 1, the function is marked as Native
global
If 1, the function is marked as Global
nondelayed
If 1, the function is marked as Non-Delayed
latent
If 1, the function is marked as Latent

Example[edit source]

{{PapyrusFunction
|name=Activate
|desc=Activates this reference with another reference as the activator.
|memberof=ObjectReference
|native=1
|wrap=1
|return-type=[[Bool]]
|return-desc=True if default activation processing was performed (and succeeded). Will return false if activation was blocked, or the activation failed for some other reason.
|param-type1={{LinkScript|ObjectReference}}
|param-name1=akActivator
|param-desc1=Who will activate this object.
|param-type2=[[Bool]]
|param-name2=abDefaultProcessingOnly
|param-def2=[[False]]
|param-desc2=If true, no [[OnActivate - ObjectReference|OnActivate]] event will be sent to any scripts and the object will ignore the blocked flag.
|examples=
<pre>
; Have the player 'activate' the door
NeatDoor.Activate(Game.GetPlayer())
</pre>
<pre>
; Have the player 'activate' the door, bypassing any blocked activation and NOT sending an event to any script
NeatDoor.Activate(Game.GetPlayer(), true)
</pre>
|notes=
If the object reference has had activation processing blocked, this will still send the OnActivate event to scripts attached to the object, but will ignore normal processing (i.e. picking up the object, opening the door, etc). Unless, of course, you have the abDefaultProcessingOnly parameter set to true, in which case no event is sent, and the block flag is ignored.
|also=
*[[UseIdleMarker (Procedure)]]
*[[Activate]]
*[[Activate (Procedure)]]
*[[Activator]]
*[[BlockActivation - ObjectReference]]
*[[OnActivate - ObjectReference]]
}}

Member of: ObjectReference

Activates this reference with another reference as the activator.

Definition[edit source]

Bool Function Activate(ObjectReference akActivator, Bool abDefaultProcessingOnly = False) Native

Parameters[edit source]

ObjectReference akActivator
Who will activate this object.
Bool abDefaultProcessingOnly = False
If true, no OnActivate event will be sent to any scripts and the object will ignore the blocked flag.

Returns[edit source]

Bool
True if default activation processing was performed (and succeeded). Will return false if activation was blocked, or the activation failed for some other reason.

Examples

; Have the player 'activate' the door
NeatDoor.Activate(Game.GetPlayer())
; Have the player 'activate' the door, bypassing any blocked activation and NOT sending an event to any script
NeatDoor.Activate(Game.GetPlayer(), true)

Notes

If the object reference has had activation processing blocked, this will still send the OnActivate event to scripts attached to the object, but will ignore normal processing (i.e. picking up the object, opening the door, etc). Unless, of course, you have the abDefaultProcessingOnly parameter set to true, in which case no event is sent, and the block flag is ignored.

See Also