Lou Montana/Sandbox/Template:Function – User

From Bohemia Interactive Community
Jump to navigation Jump to search
(Add documentation, Remove "problem" parameter, Prioritise "version1" over "version", "game1" over "game", Remove default game version)
(Page cleanup)
Tag: Replaced
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly><!--
To be removed; kept for Function history - [[User:Lou Montana|Lou Montana]] ([[User talk:Lou Montana|talk]]) 02:24, 26 December 2019 (CET)
-->__NOTOC__<!--
-->__NOEDITSECTION__<!--
-->{{DISPLAYTITLE:{{PAGENAMEE}}}}<!--
-->{{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
[[Category: Sandbox]]
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"><!--
 
-->{{GVI|{{{game1|{{{game|{{{1}}}}}}}}}|{{{version1|{{{version|{{{2|}}}}}}}}}|categorize}}<!--
-->{{#if:{{{game2|}}}|{{GVI|{{{game2}}}|{{{version2|}}}|categorize}}|}}<!--
-->{{#if:{{{game3|}}}|{{GVI|{{{game3}}}|{{{version3|}}}|categorize}}|}}<!--
-->{{#if:{{{game4|}}}|{{GVI|{{{game4}}}|{{{version4|}}}|categorize}}|}}<!--
-->{{#if:{{{game5|}}}|{{GVI|{{{game5}}}|{{{version5|}}}|categorize}}|}}<!--
 
-->{{#if:{{{arg|{{{eff|}}}}}}|<span style="margin-left: 1em">|}}<!-- space between game versions and arguments/effects
 
-->{{#if:{{{arg|}}}|{{EffArg|fnc|arg|{{{arg}}}|categorize}}|}}<!--
-->{{#if:{{{eff|}}}|{{EffArg|fnc|eff|{{{eff}}}|categorize}}|}}<!--
 
-->{{#if:{{{arg|{{{eff|}}}}}}|</span>|}}<!--
 
  ↓ People are not ready for you yet, my dear…!
-->{{#ifeq:0|1|<div style="font-size: 0.9em"><!--
-->[[:Category:{{Name|{{{game1|{{{game|{{{1}}}}}}}}}}}: New Functions List|Introduced in '''{{Name|{{{game1|{{{game|{{{1}}}}}}}}}}}''']] <!--
-->[[: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">Hover &amp; click on the images for descriptions</div>
 
<h3>Description</h3>
<dl>
<dt>Description:</dt>
<dd>{{{descr|{{{3|}}}}}}</dd>
</dl><!--
 
-->{{#if:{{{mp|}}}|
<dt>Multiplayer:</dt>
<dd>{{{mp}}}</dd>|}}<!--
 
-->{{#if:{{{pr|}}}|
<dt>Problems:</dt>
<dd>{{{pr}}}</dd>|}}<!--
 
--><h3>Syntax</h3>
<dl>
<dt>Syntax:</dt>
<dd>{{{s1|{{{4|'''{{PAGENAMEE}}'''}}}}}}</dd><!--
 
-->{{Command/params
|  {{{p1|}}} |  {{{p2|}}} |  {{{p3|}}} |  {{{p4|}}} |  {{{p5|}}} |  {{{p6|}}} |  {{{p7|}}} |  {{{p8|}}} |  {{{p9|}}} | {{{p10|}}}
| {{{p11|}}} | {{{p12|}}} | {{{p13|}}} | {{{p14|}}} | {{{p15|}}} | {{{p16|}}} | {{{p17|}}} | {{{p18|}}} | {{{p19|}}} | {{{p20|}}} }}<!--
 
--><dt>Return Value:</dt>
<dd>{{{r1|{{{5|[[Nothing]]}}}}}}</dd>
</dl><!--
 
-->{{#if:{{{s2|}}}|
<h3>Alternative Syntax</h3>
<dl>
<dt>Syntax:</dt>
<dd>{{{s2}}}</dd>|}}<!--
 
-->{{Command/params
| {{{p21|}}} | {{{p22|}}} | {{{p23|}}} | {{{p24|}}} | {{{p25|}}} | {{{p26|}}} | {{{p27|}}} | {{{p28|}}} | {{{p29|}}} | {{{p30|}}}
| {{{p31|}}} | {{{p32|}}} | {{{p33|}}} | {{{p34|}}} | {{{p35|}}} | {{{p36|}}} | {{{p37|}}} | {{{p38|}}} | {{{p39|}}} | {{{p40|}}} }}<!--
 
-->{{#if:{{{s2|}}}|
<dt>Return Value:</dt>
<dd>{{{r2|[[Nothing]]}}}</dd>
</dl>|}}<!--
 
-->
<h3>Examples</h3>
<dl>
{{Command/examples
| {{{x1|}}} | {{{x2|}}} | {{{x3|}}} | {{{x4|}}} | {{{x5|}}} | {{{x6|}}} | {{{x7|}}} | {{{x8|}}} | {{{x9|}}} | {{{x10|}}} }}
</dl>
 
<h3>Additional Information</h3>
<dl>
<dt>Execution:</dt>
<dd>{{#ifeq:{{{exec|call}}}|call|[[call]]|'''[[{{{exec}}}]]'''}}</dd>
<dt>See also:</dt>
<dd class="seealso">{{#if:{{{seealso|{{{6|}}}}}}
|{{#replace:
{{#replace:{{{seealso|{{{6}}}}}}|], [|][}}
|],[|][}}
|{{See also needed}}}}</dd>
</dl>
 
<h3>Notes</h3>
<dd style="font-size: smaller; text-align: center">
{{Messagebox
| '''Only post proven facts here.'''<!--
--> Report bugs on [http://feedback.arma3.com/ the feedback tracker].<!--
--> Use the [[{{NAMESPACE}} talk:{{PAGENAME}}|Talk page]] or the [https://forums.bohemia.net/ Forums] for discussions.
<div class{{=}}"plainlinks" style{{=}}"margin-top: -0.25em">
[{{canonicalurl:{{FULLPAGENAMEE}}|action=edit&section{{=}}new&preload{{=}}Template:Add_new_note&preloadtitle{{=}}&summary{{=}}Added+new+note&nosummary{{=}}true}} Add New Note] <nowiki>|</nowiki> [[How To#Add a new note|How To]]
</div>
| i
| #DAF5F5
}}
</dd>
</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!}}
 
== 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= 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}}}}]] -->
</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}}}}]]
</noinclude>

Latest revision as of 02:24, 26 December 2019

To be removed; kept for Function history - Lou Montana (talk) 02:24, 26 December 2019 (CET)