Creating Script Event Templates

From Serious Sam Wiki
Jump to: navigation, search

Introduction

This page explains how to create templates for script events so that usage is well-documented and standardized.

Creating a Template

Wiki Page

Script Events must be created as templates so that the information transcluded on the calling page can be adjusted by an optional parameter. Use the following page name syntax:

Template:E [Event_Name]
[Event_Name]
Replace with the exact name of the event you want to create the page for as it appears in the dropdown menu of the editor.
Mandatory Content

Copy the following code to the template page and replace placeholders as specified below:

<noinclude>This template contains the following information about the [Event_Name] script event:
</noinclude>;[Event_Name] [Editor_Requirements]
:[Event_Description]<noinclude>
Use <code><nowiki>{{E [Event_Name]}}</nowiki></code> to transclude the above information on another page.

If you want the event description to refer to a specific entity use <code><nowiki>{{E [Event_Name]|Entity_Name}}</nowiki></code>. For instance
:<code><nowiki>{{E [Event_Name]|StaticModel}}</nowiki></code>
displays as
{{E [Event_Name]|StaticModel}}

[[Category:Entity Events]]
</noinclude>
[Event_Name] (mandatory)
See above. Make sure to replace all SIX placeholders!
[Editor_Requirements] (optional)
Delete or, if appropriate, replace with one of the following template calls:
[Event_Description] (mandatory)
Replace with brief description of the event. Refer to the calling entity by using {{#if: {{{1|}}} | {{{1}}} | entity}} in the description.

And that's all! :)

Example

As an example here's what the source code for the ReceiveDamage event template looks like:

<noinclude>This template contains the following information about the ReceiveDamage script event:
</noinclude>;ReceiveDamage {{Req 3.5+}}
:Triggers when the {{#if: {{{1|}}} | {{{1}}} | entity}} receives damage.
:{{Note|This event requires enabling via EnableReceiveDamageScriptEvent method.}}<noinclude>
Use <code><nowiki>{{E ReceiveDamage}}</nowiki></code> to transclude the above information on another page.

If you want the event description to refer to a specific entity use <code><nowiki>{{E ReceiveDamage|Entity_Name}}</nowiki></code>. For instance
:<code><nowiki>{{E ReceiveDamage|StaticModel}}</nowiki></code>
displays as
{{E ReceiveDamage|StaticModel}}

[[Category:Entity Events]]
</noinclude>

And this is how {{E_ReceiveDamage|example entity}} is transcluded:

ReceiveDamage → SEd3.5 or higher
Triggers when the example entity receives damage.
Info 16x16.png Note: This event requires enabling via EnableReceiveDamageScriptEvent method.