Difference between revisions of "Template:Function"

From Savage Game Design Wiki
Jump to navigation Jump to search
m (Add author)
(Add default Return Value)
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
-->__NOTOC__<!--
 
-->__NOTOC__<!--
 
-->__NOEDITSECTION__<!--
 
-->__NOEDITSECTION__<!--
-->{{DISPLAYTITLE:{{#ifeq: {{uc:{{FULLPAGENAME}}}} | TEMPLATE:FUNCTION | {{FULLPAGENAMEE}} | {{PAGENAMEE}} }} }}<!--
+
-->{{DISPLAYTITLE:{{#ifeq: {{uc:{{FULLPAGENAME}}}} | TEMPLATE:FUNCTION | {{FULLPAGENAMEE}} | {{PAGENAMEE}} }}}}<!--
-->{{#ifeq: {{uc:{{FULLPAGENAME}}}} | TEMPLATE:FUNCTION | |
 
{{DEFAULTSORT:{{#replace:{{uc:{{PAGENAMEE}}}}|VN_FNC_|}}}}
 
[[Category:Functions]]
 
{{#if:{{{v|}}}|[[Category:Introduced in v{{{v}}}]]}}}}<!--
 
 
--><div class="function">
 
--><div class="function">
 
{| class="topinformation"
 
{| class="topinformation"
Line 16: Line 12:
 
|-
 
|-
 
| Effect(s):  || {{#switch:{{{e|}}}|l|loc|local= '''{{Color|blue|local}}'''|g|glob|global= '''{{Color|red|global}}'''|'''''{{Color|grey|unknown}}'''''}}
 
| Effect(s):  || {{#switch:{{{e|}}}|l|loc|local= '''{{Color|blue|local}}'''|g|glob|global= '''{{Color|red|global}}'''|'''''{{Color|grey|unknown}}'''''}}
 +
{{#ifeq:{{{n|}}}|server|
 +
{{!}}-
 +
{{!}} Execution: {{!}}{{!}} '''{{Color|green|Server only}}'''
 +
}}
 
|}
 
|}
 
|}
 
|}
Line 40: Line 40:
 
-->{{Function/parameter|{{{p10n|}}}|{{{p10t|}}}|{{{p10d|}}}|{{{p10v|}}}}}
 
-->{{Function/parameter|{{{p10n|}}}|{{{p10t|}}}|{{{p10d|}}}|{{{p10v|}}}}}
 
}}
 
}}
{{#if:{{{r1t|}}}{{{r1d|}}}|<dt>Return value</dt><dd>{{#if:{{{r1t|}}}|{{DataType|{{{r1t}}}}}{{#if:{{{r1d|}}}|<nowiki> - </nowiki>}}}}{{{r1d|}}}</dd>}}
+
<dt>Return value</dt>
 +
<dd>{{DataType|{{{r1t|}}}}}{{#if:{{{r1d|}}}|<nowiki> - </nowiki>{{{r1d}}}}}</dd>
 
</dl>
 
</dl>
 
}}
 
}}
Line 57: Line 58:
 
{{#if:{{{x10|}}}|<dt>Example 10</dt><dd>{{{x10}}}</dd>}}
 
{{#if:{{{x10|}}}|<dt>Example 10</dt><dd>{{{x10}}}</dd>}}
 
</dl>
 
</dl>
 +
}}
 +
{{#ifeq: {{uc:{{FULLPAGENAME}}}} | TEMPLATE:FUNCTION | |
 +
{{DEFAULTSORT:{{#replace:{{uc:{{PAGENAMEE}}}}|VN_FNC_|}}}}
 +
[[Category:Functions]]
 +
{{#if:{{{v|}}}|[[Category:Introduced in v{{{v}}}]]}}<!--
 +
-->{{#if:{{{g1|}}}|[[Category:Function Group: {{{g1}}}]]}}<!--
 +
-->{{#if:{{{g2|}}}|[[Category:Function Group: {{{g2}}}]]}}<!--
 +
-->{{#if:{{{g3|}}}|[[Category:Function Group: {{{g3}}}]]}}<!--
 +
-->{{#if:{{{g4|}}}|[[Category:Function Group: {{{g4}}}]]}}<!--
 +
-->{{#if:{{{g5|}}}|[[Category:Function Group: {{{g5}}}]]}}
 
}}
 
}}
 
</div></includeonly><noinclude><!--
 
</div></includeonly><noinclude><!--
Line 80: Line 91:
 
|-
 
|-
 
| e || Effect(s) locality || same as ''a'' for effect(s) locality
 
| e || Effect(s) locality || same as ''a'' for effect(s) locality
 +
|-
 +
| n || Network || <q>server</q> if this function is server-side only - anything else will be discarded
 +
|-
 +
| g1..g5 || Group || Function's group (weapon, vehicle, module, etc)
 
|-
 
|-
 
| d || Description || Function summary, e.g <q>Sets provided unit's direction.</q>
 
| d || Description || Function summary, e.g <q>Sets provided unit's direction.</q>
Line 113: Line 128:
 
{{Function
 
{{Function
  
|author= John Doe
+
|author= author
  
 
|v= 1.00
 
|v= 1.00
Line 121: Line 136:
 
|e= effectsLocality
 
|e= effectsLocality
  
|d= DESCRIPTION
+
|n= serverOnly
 +
 
 +
|g1= group
 +
 
 +
|d= description
  
 
|s= [] call [[FUNCTION]]
 
|s= [] call [[FUNCTION]]
Line 154: Line 173:
  
 
|e= global
 
|e= global
 +
 +
|n= server
 +
 +
|g1= Command Group
  
 
|d= Sets provided unit's direction.
 
|d= Sets provided unit's direction.
Line 191: Line 214:
  
 
|e= global
 
|e= global
 +
 +
|n= server
 +
 +
|g1= Command Group
  
 
|d= Sets provided unit's direction.
 
|d= Sets provided unit's direction.

Latest revision as of 22:51, 25 February 2021

Shows a Function page, adds it to the Category:Functions page and the Category:Introduced in.

Usage

{{Function|arg1=value}}

Argument Name Description
author Author function's author(s)
v Version S.O.G. Prairie Fire's version.
Note: not Arma 3 version!
a Arguments locality l, loc or local for local arguments, g, glob or global for global arguments
e Effect(s) locality same as a for effect(s) locality
n Network server if this function is server-side only - anything else will be discarded
g1..g5 Group Function's group (weapon, vehicle, module, etc)
d Description Function summary, e.g Sets provided unit's direction.
s Syntax e.g <code>[unit, 45] call [[VN_fnc_setDir]];</code>
Parameters - p1..10
p1n Parameter 1 name (identifier) e.g unit, dir, etc.
p1t Parameter 1 type String, Number, etc.
Note: no need to use wiki formatting (like [[String]]) - simply type s, str or string - see Template:DataType for possible values.
p1d Parameter 1 description e.g Sets unit's direction.
p1v Parameter 1 default value e.g 10
Return value - r1..5
r1t Returned value type e.g Number - same note as p1t
r1d Returned value description e.g Angle set
Examples - x1..10
x1 Example 1 e.g <code>[player, 45] call [[VN_fnc_setDir]]</code>.
Note: be sure to use the HTML <code></code> tags around code.

Template

{{Function

|author= author

|v= 1.00

|a= argumentsLocality

|e= effectsLocality

|n= serverOnly

|g1= group

|d= description

|s= [] call [[FUNCTION]]

|p1n= identifier
|p1t= type
|p1d= description
|p1v= defaultValue

|p2n= identifier
|p2t= type
|p2d= description
|p2v= defaultValue

|r1t= type
|r1d= description

|x1= example1
}}

Example

{{Function

|author= John Doe

|v= 1.00

|a= loc

|e= global

|n= server

|g1= Command Group

|d= Sets provided unit's direction.

|s= [unit, direction] call [[VN_fnc_setDir]]

|p1n= unit
|p1t= object
|p1d= the unit to sets direction
|p1v= objNull

|p2n= direction
|p2t= number
|p2d= the direction value
|p2v= 0

|r1t= number
|r1d= set direction

|x1= <code>[player, 45] call [[VN_fnc_setDir]];</code>
}}

Result

Result is in a grey border to separate it from this page.

← back to Functions Introduced in S.O.G. Prairie Fire v1.00
by John Doe
Argument(s): local
Effect(s): global
Execution: Server only

Description

Sets provided unit's direction.

Syntax

Syntax
[unit, direction] call VN_fnc_setDir
Parameters
unit: Object - (Optional, default objNull) the unit to sets direction
direction: Number - (Optional, default 0) the direction value
Return value
Number - set direction

Examples

Example 1
[player, 45] call VN_fnc_setDir;