Policy: Scripting Command Page Syntax – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
(Fixed bold / plain, added more examples)
m (Fixed formatting)
Line 34: Line 34:


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


--[[User:Suma|Suma]] 11:02, 6 September 2007 (CEST)
--[[User:Suma|Suma]] 11:02, 6 September 2007 (CEST)

Revision as of 11:03, 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)