Difference between revisions of "Template:Command"

From Bohemia Interactive Community
Jump to navigation Jump to search
(increasing parameter count to 10)
m
Line 18: Line 18:
 
<dt>Syntax:
 
<dt>Syntax:
 
<dd>{{{4}}}
 
<dd>{{{4}}}
}}{{if defined call|{{{p1|}}}|Command-param|{{{p1}}}|<dt>Parameters:}}{{if defined call|{{{p2|}}}|Command-param|{{{p2}}}}}{{if defined call|{{{p3|}}}|Command-param|{{{p3}}}}}{{if defined call|{{{p4|}}}|Command-param|{{{p4}}}}}{{if defined call|{{{p5|}}}|Command-param|{{{p5}}}}}{{if defined call|{{{p6|}}}|Command-param|{{{p6}}}}}{{if defined call|{{{p7|}}}|Command-param|{{{p7}}}}}{{if defined call|{{{p8|}}}|Command-param|{{{p8}}}}}{{if defined call|{{{p9|}}}|Command-param|{{{p9}}}}}{{if defined call|{{{p10|}}}|Command-param|{{{p10}}}}}{{if defined call|{{{4|}}}|echo|
+
}}
 +
{{if defined call|{{{p1|}}}|Command-param|{{{p1}}}|<dt>Parameters:}}{{if defined call|{{{p2|}}}|Command-param|{{{p2}}}}}{{if defined call|{{{p3|}}}|Command-param|{{{p3}}}}}{{if defined call|{{{p4|}}}|Command-param|{{{p4}}}}}{{if defined call|{{{p5|}}}|Command-param|{{{p5}}}}}{{if defined call|{{{p6|}}}|Command-param|{{{p6}}}}}{{if defined call|{{{p7|}}}|Command-param|{{{p7}}}}}{{if defined call|{{{p8|}}}|Command-param|{{{p8}}}}}{{if defined call|{{{p9|}}}|Command-param|{{{p9}}}}}{{if defined call|{{{p10|}}}|Command-param|{{{p10}}}}}{{if defined call|{{{4|}}}|echo|
 
<dt>Return Value:
 
<dt>Return Value:
 
<dd>{{{5|None.}}}
 
<dd>{{{5|None.}}}
Line 27: Line 28:
 
<dt>Syntax:
 
<dt>Syntax:
 
<dd>{{{s2}}}
 
<dd>{{{s2}}}
}}{{if defined call|{{{p21|}}}|Command-param|{{{p21}}}|<dt>Parameters:}}{{if defined call|{{{p22|}}}|Command-param|{{{p22}}}}}{{if defined call|{{{p23|}}}|Command-param|{{{p23}}}}}{{if defined call|{{{p24|}}}|Command-param|{{{p24}}}}}{{if defined call|{{{p25|}}}|Command-param|{{{p25}}}}}{{if defined call|{{{p26|}}}|Command-param|{{{p26}}}}}{{if defined call|{{{p27|}}}|Command-param|{{{p27}}}}}{{if defined call|{{{p28|}}}|Command-param|{{{p28}}}}}{{if defined call|{{{p29|}}}|Command-param|{{{p29}}}}}{{if defined call|{{{p30|}}}|Command-param|{{{p30}}}}}{{if defined call|{{{s2|}}}|echo|
+
}}
 +
{{if defined call|{{{p21|}}}|Command-param|{{{p21}}}|<dt>Parameters:}}{{if defined call|{{{p22|}}}|Command-param|{{{p22}}}}}{{if defined call|{{{p23|}}}|Command-param|{{{p23}}}}}{{if defined call|{{{p24|}}}|Command-param|{{{p24}}}}}{{if defined call|{{{p25|}}}|Command-param|{{{p25}}}}}{{if defined call|{{{p26|}}}|Command-param|{{{p26}}}}}{{if defined call|{{{p27|}}}|Command-param|{{{p27}}}}}{{if defined call|{{{p28|}}}|Command-param|{{{p28}}}}}{{if defined call|{{{p29|}}}|Command-param|{{{p29}}}}}{{if defined call|{{{p30|}}}|Command-param|{{{p30}}}}}{{if defined call|{{{s2|}}}|echo|
 
<dt>Return Value:
 
<dt>Return Value:
 
<dd>{{{r2|None.}}}
 
<dd>{{{r2|None.}}}

Revision as of 17:58, 7 March 2013

Syntax

You can insert a command using the following syntax:

{{Command|=
____________________________________________________________________________________________

| GAME |=

|GAMEVERSION|=

|arg= MPARGUMENTS |=

|eff= MPEFFECTS |=
____________________________________________________________________________________________

| DESCRIPTION |=
____________________________________________________________________________________________

| SYNTAX |=

|p1= PARAMETER1 |=

|p2= PARAMETER2 |=

|p3= PARAMETER3 |=

|p4= PARAMETER4 |=

|p5= PARAMETER5 |=

|p6= PARAMETER6 |=

|p7= PARAMETER7 |=

|p8= PARAMETER8 |=

|p9= PARAMETER9 |=

|p10= PARAMETER10 |=

| RETURNVALUE |=


START alternative syntax (optional)

|s2= ALT_SYNTAX |= 

|p21= ALT_PARAMETER1 |= 

|p22= ALT_PARAMETER2 |=

|p23= ALT_PARAMETER3 |= 

|p24= ALT_PARAMETER4 |= 

|p25= ALT_PARAMETER5 |=

|p26= ALT_PARAMETER6 |=

|p27= ALT_PARAMETER7 |=

|p28= ALT_PARAMETER8 |=

|p29= ALT_PARAMETER9 |=

|p30= ALT_PARAMETER10 |=

|r2= ALT_RETURNVALUE |=

END alternative syntax (optional)


|mp= MPBEHAVIOUR |=
____________________________________________________________________________________________

|x1= EXAMPLE1 |=
____________________________________________________________________________________________

|x2= EXAMPLE2 |=
____________________________________________________________________________________________

|x3= EXAMPLE3 |=
____________________________________________________________________________________________

|x4= EXAMPLE4 |=
____________________________________________________________________________________________

| SEEALSO |=

}}

<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->

<!-- Note Section END -->
</dl>

<h3 style="display:none">Bottom Section</h3>

Parameters

All of the following parameters should be replaced by reasonable text!

The paramter GAME should contain the short name of the game when the command was introduced, being one of "ofp", "ofpr" or "arma".

The parameter GAMEVERSION is obvious: It contains the version number when this command was included. This is the only parameter where you must not have spaces before or after the parameter!!! If the game version is a round number, include two zeros after the comma (ie, 1.00, 2.00). If not, write the version number with all required numbers after the comma (ie, 1.5, 1.34 ...)

The parameter MPARGUMENTS is optional. If you don't include it, delete the whole line. It contains either "local" or "global" and describes whether this command needs the arguments to be local to the client it is executed on or if they can be global.

The parameter MPEFFECTS is optional. If you don't include it, delete the whole line. It contains either "local" or "global" and describes whether the effects of the command are transfered through the net.

The parameter DESCRIPTION should contain a brief but detailed description of the command.

The parameter SYNTAX should show the syntax for the command. There are several possibilities of format:

'''commandName'''

preargument '''commandName'''

'''commandName''' postargument

preargument '''commandName''' postargument

[prearg1, prearg2] '''commandName''' postargument

preargument '''commandName''' [postarg1, postarg2]

etc. You get the drill.

PARAMETER1 to PARAMETER5 are all optional and should contain descriptions of the parameters. If there are no parameters, delete all lines. If there are two parameters, mention only |p1= PARAM | and |p2= PARAM | and delete |p3=, |p4= and |p5=. The format should be one of the following two:

parameter: [[Type]]

parameter: [[Type]] - Description

The parameter RETURNVALUE should contain a description of the return value. Again, there are two possible formats:

[[Type]]

[[Type]] - Description

All parameters starting with ALT_ belong to the "alternative syntax" section and can be left away in commands with only one syntax. They are of the same format as the parameters without ALT_.

The parameter MPBEHAVIOUR should contain a description of the command's behaviour in multiplayer. If you have no description, delete the line.

The parameters EXAMPLE1 to EXAMPLE3 are again all optional. If you don't include one of them, delete the line. They should contain examples for the command (using <pre> or <code> ?) including descriptions of the examples.

The parameter SEEALSO should contain a comma-separated list of links related to this command. Example for doFire would be:

[[commandFire]], [[fire]]

Example

Should be replaced by a valid example later . . .

{{Command|=
____________________________________________________________________________________________

|1.00|=
____________________________________________________________________________________________

| Adds an event handler to a given unit. For more information about event handlers and their 
types check the scripting topic Event Handlers in this reference. You may add as many event 
handlers of any type as you like to every unit, if you add an event handler of type "killed" 
and there already exists one, the old one doesn't get overwritten. Use removeEventHandler to 
delete event handlers. |=
____________________________________________________________________________________________

| object '''addEventHandler''' [type, code] |=

|p1= object: [[Object]] |=

|p2= type: [[String]] - Explanation |=

|p3= code: [[String]] - Explanation |=

| [[Integer]] - The index of the currently added event handler is returned. Indices start at 
0 for each unit and increment with each added event handler. |=

| Behaviour unknown. |=
____________________________________________________________________________________________

|x1= Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam 
et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est 
Lorem ipsum dolor sit amet. 

<code>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</code>

At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea 
takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur 
sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 
erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita 
kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. |=
____________________________________________________________________________________________

|x2= Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam 
et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est 
Lorem ipsum dolor sit amet. |=
____________________________________________________________________________________________

| [[removeEventHandler]] |=

}}

<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->

<!-- Note Section END -->
</dl>

<h3 style="display:none">Bottom Section</h3>