Lou Montana/Sandbox/Template:Function – User
< User:Lou Montana | Sandbox
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (test) |
Lou Montana (talk | contribs) (Add documentation, Remove "problem" parameter, Prioritise "version1" over "version", "game1" over "game", Remove default game version) |
||
Line 4: | Line 4: | ||
-->{{DISPLAYTITLE:{{PAGENAMEE}}}}<!-- | -->{{DISPLAYTITLE:{{PAGENAMEE}}}}<!-- | ||
-->{{DEFAULTSORT:{{uc:{{PAGENAME}}}}}}<!-- | -->{{DEFAULTSORT:{{uc:{{PAGENAME}}}}}}<!-- | ||
-->{{ | -->{{#ifeq: {{Name|{{{game1|{{{game|{{{1}}}}}}}}}}} | {{Name|arma3dev}} | [[Category:Introduced with Arma 3 Development Branch]] | }}<!-- Includes every arma 3 dev function in one category as well as reg version subcategories | ||
[[Category:Functions|{{uc:{{#replace:{{#replace:{{PAGENAMEE}}|BIS_fnc_|}}|BIN_fnc_|}}}}]] | Category: Functions | ||
[[Category:{{Name|{{{ | Category:<game>: Functions | ||
Category:<game>: New Functions List | |||
↓ | |||
-->[[Category:Functions|{{uc:{{#replace:{{#replace:{{PAGENAMEE}}|BIS_fnc_|}}|BIN_fnc_|}}}}]]<!-- | |||
-->[[Category:{{Name|{{{game1|{{{game|{{{1}}}}}}}}}}}: Functions|{{uc:{{#replace:{{#replace:{{PAGENAMEE}}|BIS_fnc_|}}|BIN_fnc_|}}}}]]<!-- | |||
-->[[Category:{{Name|{{{game1|{{{game|{{{1}}}}}}}}}}}: New Functions List|{{uc:{{PAGENAME}}}}]]<!-- | |||
--><div class="_description fnc"><!-- | --><div class="_description fnc"><!-- | ||
-->{{GVI|{{{ | -->{{GVI|{{{game1|{{{game|{{{1}}}}}}}}}|{{{version1|{{{version|{{{2|}}}}}}}}}|categorize}}<!-- | ||
-->{{#if:{{{game2|}}}|{{GVI|{{{game2}}}|{{{version2| | -->{{#if:{{{game2|}}}|{{GVI|{{{game2}}}|{{{version2|}}}|categorize}}|}}<!-- | ||
-->{{#if:{{{game3|}}}|{{GVI|{{{game3}}}|{{{version3| | -->{{#if:{{{game3|}}}|{{GVI|{{{game3}}}|{{{version3|}}}|categorize}}|}}<!-- | ||
-->{{#if:{{{game4|}}}|{{GVI|{{{game4}}}|{{{version4| | -->{{#if:{{{game4|}}}|{{GVI|{{{game4}}}|{{{version4|}}}|categorize}}|}}<!-- | ||
-->{{#if:{{{game5|}}}|{{GVI|{{{game5}}}|{{{version5| | -->{{#if:{{{game5|}}}|{{GVI|{{{game5}}}|{{{version5|}}}|categorize}}|}}<!-- | ||
-->{{#if:{{{arg|{{{eff|}}}}}}|<span style="margin-left: 1em">|}}<!-- space between game versions and arguments/effects | -->{{#if:{{{arg|{{{eff|}}}}}}|<span style="margin-left: 1em">|}}<!-- space between game versions and arguments/effects | ||
Line 25: | Line 28: | ||
-->{{#if:{{{arg|{{{eff|}}}}}}|</span>|}}<!-- | -->{{#if:{{{arg|{{{eff|}}}}}}|</span>|}}<!-- | ||
--><div style="font-size: 0.9em"><!-- | ↓ People are not ready for you yet, my dear…! | ||
-->[[:Category:{{Name|{{{ | -->{{#ifeq:0|1|<div style="font-size: 0.9em"><!-- | ||
-->[[:Category:Introduced with {{Name|{{{ | -->[[:Category:{{Name|{{{game1|{{{game|{{{1}}}}}}}}}}}: New Functions List|Introduced in '''{{Name|{{{game1|{{{game|{{{1}}}}}}}}}}}''']] <!-- | ||
--></div> | -->[[:Category:Introduced with {{Name|{{{game1|{{{game|{{{1}}}}}}}}}}} version {{{version1|{{{version|{{{2|1.00}}}}}}}}}|version '''{{{version1|{{{version|{{{2|1.00}}}}}}}}}''']]<!-- | ||
--></div>|}} | |||
<div style="color:grey; font-size:0.75em"> | <div style="color:grey; font-size:0.75em">Hover & click on the images for descriptions</div> | ||
<h3>Description</h3> | <h3>Description</h3> | ||
Line 42: | Line 46: | ||
<dd>{{{mp}}}</dd>|}}<!-- | <dd>{{{mp}}}</dd>|}}<!-- | ||
-->{{#if: | -->{{#if:{{{pr|}}}| | ||
<dt>Problems:</dt> | <dt>Problems:</dt> | ||
<dd>{{{pr}}}</dd>|}}<!-- | <dd>{{{pr}}}</dd>|}}<!-- | ||
Line 86: | Line 90: | ||
<dd>{{#ifeq:{{{exec|call}}}|call|[[call]]|'''[[{{{exec}}}]]'''}}</dd> | <dd>{{#ifeq:{{{exec|call}}}|call|[[call]]|'''[[{{{exec}}}]]'''}}</dd> | ||
<dt>See also:</dt> | <dt>See also:</dt> | ||
<dd class="seealso"> | <dd class="seealso">{{#if:{{{seealso|{{{6|}}}}}} | ||
|{{#replace: | |||
{{#replace:{{{seealso|{{{6}}}}}}|], [|][}} | |||
|],[|][}} | |||
|{{See also needed}}}}</dd> | |||
</dl> | </dl> | ||
Line 102: | Line 110: | ||
}} | }} | ||
</dd> | </dd> | ||
</div></includeonly><noinclude> | </div></includeonly><noinclude><!-- | ||
########################################################################### | |||
################################################## | |||
######################### | |||
DOCUMENTATION STARTS HERE | |||
######################### | |||
################################################## | |||
########################################################################### | |||
| | -->[[:Category:Functions|Functions]] template, used by [[Special:WhatLinksHere/Template:Function|these pages]]. | ||
{{Warning | Do '''NOT''' edit this template before <u>heavy</u> testing, as it is widely used!}} | |||
|s1 | == Usage == | ||
{{<nowiki/>Function|''...parameters...''}} | |||
* game1: (can be game or unnamed parameter '''1''') short game name - same as [[Template:Name|Name]] template input format. e.g ofp, tkoh, arma3, etc. | |||
* version1: (Optional, default empty (unknown)) (can be version or unnamed parameter '''2''') number in [[Template:GVI]] template format: '''<Major>.<Minor>'''. e.g 1.46, 1.75, 1.86 etc. | |||
* arg: (Optional, default empty) argument locality definition - same as [[Template:EffArg|EffArg]] template input format. e.g local, loc or global, glob | |||
* eff: (Optional, default empty) effects locality definition - same as [[Template:EffArg|EffArg]] template input format. e.g local, loc or global, glob | |||
* exec: (Optional, default [[call]]) the command used '''to execute the function'''. Usually [[call]] or [[spawn]]. | |||
* descr: (can be unnamed parameter '''3''') the function description | |||
* s1: (Optional, default <tt>{{<nowiki/>PAGENAMEE}}</tt>) (can be unnamed parameter '''4''') function syntax with named parameters. e.g {{Inline code|unit1 '''setDammage''' 1}} | |||
* p1..20: (Optional, default empty) function parameters with description | |||
* r1: (Optional, default [[Nothing]]) (can be unnamed parameter '''5''') syntax's return value | |||
* x1..10: (Optional, default <tt>{{<nowiki/>Example needed}}</tt>) function examples (to be put between <nowiki><code></code></nowiki> tags where needed) | |||
* seealso: (Optional, default <tt>{{<nowiki/>See also needed}}</tt>) (can be unnamed param '''6''') list of related links in wiki format, separated by comma or space. e.g <nowiki>[[setDir]] [[setPos]]</nowiki> | |||
* '''Secondary parameters:''' | |||
** mp: (Optional, default empty) if provided, will show a Multiplayer note under the description | |||
** pr: (Optional, default empty) if provided, will show a Problems note under the description | |||
** game2..5: (Optional, default empty) same as ''game1'' | |||
** version2..5: (Optional, default empty) same as ''version1'', for the corresponding ''game#'' | |||
** s2: (Optional, default empty) Alternative syntax 1 (see ''s1'') | |||
** p21..40: (Optional, default empty) Alternative syntaxes parameters (20 each: p21..40) | |||
** r2: (Optional, default empty) Alternative syntax 1 return value (see ''r1'') | |||
== Automatic categories == | |||
* <tt>[[:Category:Functions]]</tt> | |||
* <tt>Introduced with ''game'''1''''' version ''version'''1'''''</tt> category (e.g [[:Category: Introduced with Arma 3 version 1.00|Category: Introduced with '''{{arma3}}''' version '''1.00''']]) | |||
* <tt>''game'''1''''': New Functions List</tt> category (e.g [[:Category: Arma 3: New Functions List|Category: '''{{arma2}}''': New Functions List]]) | |||
* <tt>[[:Category:Introduced with Arma 3 Development Branch]]</tt> if ''game1'' is <tt>arma3dev</tt> | |||
== Full template == | |||
<syntaxhighlight lang="html"> | |||
{{Command | |||
<!-- Games and versions --> | |||
| | |game1= GAME1 | ||
|version1= VERSION1 | |||
| | |game2= GAME2 | ||
|version2= VERSION2 | |||
|game3= GAME3 | |||
|version3= VERSION3 | |||
|game4= GAME4 | |||
|version4= VERSION4 | |||
|game5= GAME5 | |||
|version5= VERSION5 | |||
| | |arg= ARGUMENTS_LOCALITY | ||
|eff= EFFECTS_LOCALITY | |||
|exec= | |exec= COMMAND_EXECUTION | ||
| | <!-- Description and syntaxes --> | ||
|descr= DESCRIPTION | |||
|s1= SYNTAX | |||
|p1= PARAMETER1 | |||
|p2= PARAMETER2 | |||
|p3= PARAMETER3 | |||
|p4= PARAMETER4 | |||
|p5= PARAMETER5 | |||
|p6= PARAMETER6 | |||
|p7= PARAMETER7 | |||
|p8= PARAMETER8 | |||
|p9= PARAMETER9 | |||
|p10= PARAMETER10 | |||
|p11= PARAMETER11 | |||
|p12= PARAMETER12 | |||
|p13= PARAMETER13 | |||
|p14= PARAMETER14 | |||
|p15= PARAMETER15 | |||
|p16= PARAMETER16 | |||
|p17= PARAMETER17 | |||
|p18= PARAMETER18 | |||
|p19= PARAMETER19 | |||
|p20= PARAMETER20 | |||
|r1= RETURN_VALUE | |||
<!-- Syntax 2 (Alternative) --> | |||
|s2= SYNTAX2 | |||
|p21= SYNTAX2_PARAMETER1 | |||
|p22= SYNTAX2_PARAMETER2 | |||
|p23= SYNTAX2_PARAMETER3 | |||
|p24= SYNTAX2_PARAMETER4 | |||
|p25= SYNTAX2_PARAMETER5 | |||
|p26= SYNTAX2_PARAMETER6 | |||
|p27= SYNTAX2_PARAMETER7 | |||
|p28= SYNTAX2_PARAMETER8 | |||
|p29= SYNTAX2_PARAMETER9 | |||
|p30= SYNTAX2_PARAMETER10 | |||
|p31= SYNTAX2_PARAMETER11 | |||
|p32= SYNTAX2_PARAMETER12 | |||
|p33= SYNTAX2_PARAMETER13 | |||
|p34= SYNTAX2_PARAMETER14 | |||
|p35= SYNTAX2_PARAMETER15 | |||
|p36= SYNTAX2_PARAMETER16 | |||
|p37= SYNTAX2_PARAMETER17 | |||
|p38= SYNTAX2_PARAMETER18 | |||
|p39= SYNTAX2_PARAMETER19 | |||
|p40= SYNTAX2_PARAMETER20 | |||
|r2= SYNTAX2_RETURNVALUE | |||
<!-- Examples --> | |||
|x1= EXAMPLE1 | |||
|x2= EXAMPLE2 | |||
|x3= EXAMPLE3 | |||
|x4= EXAMPLE4 | |||
|x5= EXAMPLE5 | |||
|x6= EXAMPLE6 | |||
|x7= EXAMPLE7 | |||
|x8= EXAMPLE8 | |||
|x9= EXAMPLE9 | |||
|x10= EXAMPLE10 | |||
|seealso= SEE_ALSO | |||
}} | }} | ||
<h3 style="display:none"> | <h3 style="display:none">Bottom Section</h3> | ||
< | <!-- Appropriate categories go here e.g. [[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] --> | ||
<!-- | </syntaxhighlight> | ||
== Example == | |||
{| class="wikitable" | |||
! Code | |||
! Result | |||
|- | |||
| <syntaxhighlight lang="html">{{Function | |||
<!-- Games and versions --> | |||
|game1= ofp | |||
|game2= arma1 | |||
|game3= arma2 | |||
|game4= arma3 | |||
|game5= tkoh | |||
|version1= 5.50 | |||
|version2= 4.50 | |||
|version3= 3.50 | |||
|version4= 2.50 | |||
|version5= 1.50 | |||
|arg= local | |||
|eff= global | |||
|exec= spawn | |||
<!-- Description and syntaxes --> | |||
|descr= DESCRIPTION | |||
|s1= SYNTAX | |||
|p1= PARAMETER1 | |||
|p2= PARAMETER2 | |||
|p3= PARAMETER3 | |||
|p4= PARAMETER4 | |||
|p5= PARAMETER5 | |||
|p6= PARAMETER6 | |||
|p7= PARAMETER7 | |||
|p8= PARAMETER8 | |||
|p9= PARAMETER9 | |||
|p10= PARAMETER10 | |||
|p11= PARAMETER11 | |||
|p12= PARAMETER12 | |||
|p13= PARAMETER13 | |||
|p14= PARAMETER14 | |||
|p15= PARAMETER15 | |||
|p16= PARAMETER16 | |||
|p17= PARAMETER17 | |||
|p18= PARAMETER18 | |||
|p19= PARAMETER19 | |||
|p20= PARAMETER20 | |||
|r1= RETURN_VALUE | |||
|x1= <code>this '''BIS_fnc_function''' that</code> | |||
|seealso= | |||
[[Template:{{PAGENAME}}|seeAlso 1]] | |||
[[Template:{{PAGENAME}}|seeAlso 2]] | |||
[[Template:{{PAGENAME}}|seeAlso 3]] | |||
[[Template:{{PAGENAME}}|seeAlso 4]] | |||
}}</syntaxhighlight> | |||
| style="vertical-align: top" | | |||
{{Function | |||
<!-- Games and versions --> | |||
|game1= ofp | |||
|game2= arma1 | |||
|game3= arma2 | |||
|game4= arma3 | |||
|game5= tkoh | |||
|version1= 5.50 | |||
|version2= 4.50 | |||
|version3= 3.50 | |||
|version4= 2.50 | |||
|version5= 1.50 | |||
|arg= local | |||
|eff= global | |||
|exec= spawn | |||
<!-- Description and syntaxes --> | |||
|descr= DESCRIPTION | |||
|s1= SYNTAX | |||
|p1= PARAMETER1 | |||
|p2= PARAMETER2 | |||
|p3= PARAMETER3 | |||
|p4= PARAMETER4 | |||
|p5= PARAMETER5 | |||
|p6= PARAMETER6 | |||
|p7= PARAMETER7 | |||
|p8= PARAMETER8 | |||
|p9= PARAMETER9 | |||
|p10= PARAMETER10 | |||
|p11= PARAMETER11 | |||
|p12= PARAMETER12 | |||
|p13= PARAMETER13 | |||
|p14= PARAMETER14 | |||
|p15= PARAMETER15 | |||
|p16= PARAMETER16 | |||
|p17= PARAMETER17 | |||
|p18= PARAMETER18 | |||
|p19= PARAMETER19 | |||
|p20= PARAMETER20 | |||
|r1= RETURN_VALUE | |||
< | |x1= <code>this '''BIS_fnc_function''' that</code> | ||
|seealso= | |||
[[Template:{{PAGENAME}}|seeAlso 1]] | |||
[[Template:{{PAGENAME}}|seeAlso 2]] | |||
[[Template:{{PAGENAME}}|seeAlso 3]] | |||
[[Template:{{PAGENAME}}|seeAlso 4]] | |||
}} | |||
|} | |||
[[Category:Templates|{{uc:{{PAGENAME}}}}]] | [[Category:Templates|{{uc:{{PAGENAME}}}}]] | ||
</noinclude> | </noinclude> |
Revision as of 01:49, 26 December 2019
Functions template, used by these pages.
Usage
{{Function|...parameters...}}
- game1: (can be game or unnamed parameter 1) short game name - same as Name template input format. e.g ofp, tkoh, arma3, etc.
- version1: (Optional, default empty (unknown)) (can be version or unnamed parameter 2) number in Template:GVI template format: <Major>.<Minor>. e.g 1.46, 1.75, 1.86 etc.
- arg: (Optional, default empty) argument locality definition - same as EffArg template input format. e.g local, loc or global, glob
- eff: (Optional, default empty) effects locality definition - same as EffArg template input format. e.g local, loc or global, glob
- exec: (Optional, default call) the command used to execute the function. Usually call or spawn.
- descr: (can be unnamed parameter 3) the function description
- s1: (Optional, default {{PAGENAMEE}}) (can be unnamed parameter 4) function syntax with named parameters. e.g
unit1 setDammage 1
- p1..20: (Optional, default empty) function parameters with description
- r1: (Optional, default Nothing) (can be unnamed parameter 5) syntax's return value
- x1..10: (Optional, default {{Example needed}}) function examples (to be put between <code></code> tags where needed)
- seealso: (Optional, default {{See also needed}}) (can be unnamed param 6) list of related links in wiki format, separated by comma or space. e.g [[setDir]] [[setPos]]
- Secondary parameters:
- mp: (Optional, default empty) if provided, will show a Multiplayer note under the description
- pr: (Optional, default empty) if provided, will show a Problems note under the description
- game2..5: (Optional, default empty) same as game1
- version2..5: (Optional, default empty) same as version1, for the corresponding game#
- s2: (Optional, default empty) Alternative syntax 1 (see s1)
- p21..40: (Optional, default empty) Alternative syntaxes parameters (20 each: p21..40)
- r2: (Optional, default empty) Alternative syntax 1 return value (see r1)
Automatic categories
- Category:Functions
- Introduced with game1 version version1 category (e.g Category: Introduced with Arma 3 version 1.00)
- game1: New Functions List category (e.g Category: Arma 2: New Functions List)
- Category:Introduced with Arma 3 Development Branch if game1 is arma3dev
Full template
{{Command
<!-- Games and versions -->
|game1= GAME1
|version1= VERSION1
|game2= GAME2
|version2= VERSION2
|game3= GAME3
|version3= VERSION3
|game4= GAME4
|version4= VERSION4
|game5= GAME5
|version5= VERSION5
|arg= ARGUMENTS_LOCALITY
|eff= EFFECTS_LOCALITY
|exec= COMMAND_EXECUTION
<!-- Description and syntaxes -->
|descr= DESCRIPTION
|s1= SYNTAX
|p1= PARAMETER1
|p2= PARAMETER2
|p3= PARAMETER3
|p4= PARAMETER4
|p5= PARAMETER5
|p6= PARAMETER6
|p7= PARAMETER7
|p8= PARAMETER8
|p9= PARAMETER9
|p10= PARAMETER10
|p11= PARAMETER11
|p12= PARAMETER12
|p13= PARAMETER13
|p14= PARAMETER14
|p15= PARAMETER15
|p16= PARAMETER16
|p17= PARAMETER17
|p18= PARAMETER18
|p19= PARAMETER19
|p20= PARAMETER20
|r1= RETURN_VALUE
<!-- Syntax 2 (Alternative) -->
|s2= SYNTAX2
|p21= SYNTAX2_PARAMETER1
|p22= SYNTAX2_PARAMETER2
|p23= SYNTAX2_PARAMETER3
|p24= SYNTAX2_PARAMETER4
|p25= SYNTAX2_PARAMETER5
|p26= SYNTAX2_PARAMETER6
|p27= SYNTAX2_PARAMETER7
|p28= SYNTAX2_PARAMETER8
|p29= SYNTAX2_PARAMETER9
|p30= SYNTAX2_PARAMETER10
|p31= SYNTAX2_PARAMETER11
|p32= SYNTAX2_PARAMETER12
|p33= SYNTAX2_PARAMETER13
|p34= SYNTAX2_PARAMETER14
|p35= SYNTAX2_PARAMETER15
|p36= SYNTAX2_PARAMETER16
|p37= SYNTAX2_PARAMETER17
|p38= SYNTAX2_PARAMETER18
|p39= SYNTAX2_PARAMETER19
|p40= SYNTAX2_PARAMETER20
|r2= SYNTAX2_RETURNVALUE
<!-- Examples -->
|x1= EXAMPLE1
|x2= EXAMPLE2
|x3= EXAMPLE3
|x4= EXAMPLE4
|x5= EXAMPLE5
|x6= EXAMPLE6
|x7= EXAMPLE7
|x8= EXAMPLE8
|x9= EXAMPLE9
|x10= EXAMPLE10
|seealso= SEE_ALSO
}}
<h3 style="display:none">Bottom Section</h3>
<!-- Appropriate categories go here e.g. [[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] -->
Example
Code | Result |
---|---|
{{Function
<!-- Games and versions -->
|game1= ofp
|game2= arma1
|game3= arma2
|game4= arma3
|game5= tkoh
|version1= 5.50
|version2= 4.50
|version3= 3.50
|version4= 2.50
|version5= 1.50
|arg= local
|eff= global
|exec= spawn
<!-- Description and syntaxes -->
|descr= DESCRIPTION
|s1= SYNTAX
|p1= PARAMETER1
|p2= PARAMETER2
|p3= PARAMETER3
|p4= PARAMETER4
|p5= PARAMETER5
|p6= PARAMETER6
|p7= PARAMETER7
|p8= PARAMETER8
|p9= PARAMETER9
|p10= PARAMETER10
|p11= PARAMETER11
|p12= PARAMETER12
|p13= PARAMETER13
|p14= PARAMETER14
|p15= PARAMETER15
|p16= PARAMETER16
|p17= PARAMETER17
|p18= PARAMETER18
|p19= PARAMETER19
|p20= PARAMETER20
|r1= RETURN_VALUE
|x1= <code>this '''BIS_fnc_function''' that</code>
|seealso=
[[Template:{{PAGENAME}}|seeAlso 1]]
[[Template:{{PAGENAME}}|seeAlso 2]]
[[Template:{{PAGENAME}}|seeAlso 3]]
[[Template:{{PAGENAME}}|seeAlso 4]]
}}
|
Description
Syntax
Examples
Additional InformationNotes
|