Policy: Scripting Command Page Syntax – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
(Extended syntax line policy)
(Fixed bold / plain, added more examples)
Line 9: Line 9:
The parameters should be specified as names only, with types specified below, like this:
The parameters should be specified as names only, with types specified below, like this:


Syntax: '''a''' min '''b'''
Syntax: a '''min''' b


Parameter 1: a: [[Number]]
Parameter 1: a: [[Number]]
Line 15: Line 15:
Parameter 2: b: [[Number]]
Parameter 2: b: [[Number]]


In the syntax line the parameter names are written bold, command is in plain text.
In the syntax line the parameter names are plain text, command is written bold.


What to do with array parameters?
What to do with array parameters?


--[[User:Suma|Suma]] 10:36, 6 September 2007 (CEST)
--[[User:Suma|Suma]] 10:36, 6 September 2007 (CEST)
Currently Mikero seems to be doing a lot of work changing docs into a different syntax, like:
*[[Object]] <nowiki>=</nowiki> ''' nearestObject''' [[Position]]
*[[Object]] <nowiki>=</nowiki> ''' nearestObject''' [ [[Position]], "ClassType"]
*[[Object]] <nowiki>=</nowiki> ''' nearestObject''' [ [[Object]], "ClassType"]
What I do not like about this is arguments are not named, only their type is given, which seems confusing to me. However, it is clear such syntax is more concise and leads to shorter definitions. Still, I think it is not informative enough and I am against using it. Based on my proposal, this should look something like:
*object <nowiki>=</nowiki> ''' nearestObject''' [ position]
*object <nowiki>=</nowiki> ''' nearestObject''' [ position, classType]
*object <nowiki>=</nowiki> ''' nearestObject''' [ sourceObject, classType]
sourceObject: [[Object]]
object: [[Object]
position: [[Position]]
classType: [[String]]
--[[User:Suma|Suma]] 11:02, 6 September 2007 (CEST)

Revision as of 10:02, 6 September 2007

Proposal:

Values and commands are written with leading lowercase

Types are written with leading uppercase.

Syntax line:

The parameters should be specified as names only, with types specified below, like this:

Syntax: a min b

Parameter 1: a: Number

Parameter 2: b: Number

In the syntax line the parameter names are plain text, command is written bold.

What to do with array parameters?

--Suma 10:36, 6 September 2007 (CEST)

Currently Mikero seems to be doing a lot of work changing docs into a different syntax, like:

What I do not like about this is arguments are not named, only their type is given, which seems confusing to me. However, it is clear such syntax is more concise and leads to shorter definitions. Still, I think it is not informative enough and I am against using it. Based on my proposal, this should look something like:

  • object = nearestObject [ position]
  • object = nearestObject [ position, classType]
  • object = nearestObject [ sourceObject, classType]

sourceObject: Object object: [[Object] position: Position classType: String

--Suma 11:02, 6 September 2007 (CEST)