Policy: Scripting Command Page Syntax – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Added titles)
(Mixed alternative)
Line 30: Line 30:
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:
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
*object <nowiki>=</nowiki> ''' nearestObject''' [ position, classType]
*object <nowiki>=</nowiki> ''' nearestObject''' [ position, classType]
*object <nowiki>=</nowiki> ''' nearestObject''' [ sourceObject, classType]
*object <nowiki>=</nowiki> ''' nearestObject''' [ sourceObject, classType]
Line 43: Line 43:


--[[User:Suma|Suma]] 11:02, 6 September 2007 (CEST)
--[[User:Suma|Suma]] 11:02, 6 September 2007 (CEST)
===Mixed alternative===
Mixed alternative could be to have both name and type specified at the same place, like this:
*object:[[Object]] <nowiki>=</nowiki> ''' nearestObject''' position:[[Position]]
*object:[[Object]] <nowiki>=</nowiki> ''' nearestObject''' [ position:[[Position]], classType:[[String]]]
*object:[[Object]] <nowiki>=</nowiki> ''' nearestObject''' [ sourceObject:[[Object]], classType:[[String]]]
or perhaps even using types only as links (very consise, but perhaps not that clear):
*[[Object|object]] <nowiki>=</nowiki> ''' nearestObject''' [[Position|position]]
*[[Object|object]] <nowiki>=</nowiki> ''' nearestObject''' [ [[Position|position]], [[String|classType]]]
*[[Object|object]] <nowiki>=</nowiki> ''' nearestObject''' [ [[Object|sourceObject]], [[String|classType]]]
--[[User:Suma|Suma]] 11:43, 6 September 2007 (CEST)

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

Type only alternative

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)

Mixed alternative

Mixed alternative could be to have both name and type specified at the same place, like this:

or perhaps even using types only as links (very consise, but perhaps not that clear):

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