Divinity Engine Wiki
Advertisement

The script function template creates an MSDN-style definition for a scripting function used in the Divinity Engine Toolkit.

Usage

Syntax

{{Script function
|stype         = 
|sversion      = 
|ftype         = 
|fname         = 
|fbrief        = 
|p1modifier    = 
|p1type        = 
|p1name        = 
|p1brief       = 
|p1default     = 
|p1optional    = 
:
|p15modifier   = 
|p15type       = 
|p15name       = 
|p15brief      = 
|p15default    = 
|p15optional   = 
}}

The first letter of each argument is shorthand:

  • s = script
  • f = function
  • p = parameter

The template supports functions with up to 15 parameters (numbered 1-15).

Parameters

stype
The script type: use "Dialog" for keyword actions and conditions; "Object" for character and item functions; and "Story" for Osiris functions.
sversion
The version of game the script/function information was extracted from.
ftype
The function's type.
fname
The function's name.
fbrief
A brief description of the function, normally extracted from the function's tooltip or help text.
p#modifier
The parameter's in/out modifier.
p#type
The parameter's type.
p#name
The parameter's name.
p#brief
A brief description of the parameter.
p#default
Default value for (some) optional parameters.
p#optional
Flags the parameter is optional. Any value can be used but "True" or "Yes" are recommended.

Example

{{Script function
|stype         = Story
|sversion      = 1.0.47
|ftype         = call
|fname         = TriggerCreateSurface
|fbrief        = Creates a surface of the specified type at the specified point.
|p1modifier    = 
|p1type        = TRIGGER
|p1name        = _Trigger
|p1brief       = The point at which to create the surface.
|p1default     = 
|p1optional    = 
|p2modifier    = 
|p2type        = STRING
|p2name        = _SurfaceType
|p2brief       = The type of surface to be created, e.g. water, lava, etc. or none.
|p2default     = 
|p2optional    = 
|p3modifier    = 
|p3type        = REAL
|p3name        = _Radius
|p3brief       = The size of the surface being created.
|p3default     = 
|p3optional    = 
}}

Remarks

A typical function page will have a number of other headers below this template where more detailed and free-form information will be added. The recommended headers and their purpose are:

  • Description: a more verbose description of the function
  • Remarks: hints and tips on usage; caveats or known issues; workarounds or unusual uses; etc.
  • Examples: script snippets demonstrating how to use the function
  • See also: links to related functions, articles or categories

Others sections can be added when and where needed.

Advertisement