Difference between revisions of "Template:Function"
no edit summary
imported>SnakeChomp m (Fix syntax) |
imported>Pintocat |
||
(46 intermediate revisions by 12 users not shown) | |||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
__NOTOC__ | |||
{{Incomplete}} | {{Incomplete}} | ||
This is a WIP, feedback is appreciated. To retain readability a lot of HTML comments are used, they shouldn't impact the working of the template, but could add to the confusion a bit. Example in the [[Sandbox#Function_Template_Test|Sandbox]]. | This is a WIP, feedback is appreciated. To retain readability a lot of HTML comments are used, they shouldn't impact the working of the template, but could add to the confusion a bit. Example in the [[Sandbox#Function_Template_Test|Sandbox]]. | ||
<nowiki>{{Function | {{Template:Community_Wiki}} | ||
<nowiki>{{Function</nowiki> | |||
''CSWikiPage'' = name of corresponding page on the [http://cs.elderscrolls.com/constwiki/index.php/Category:Functions TES CS Wiki] | ''CSWikiPage'' = name of corresponding page on the [http://cs.elderscrolls.com/constwiki/index.php/Category:Functions TES CS Wiki] | ||
origin = whether the function came from the GECK itself or was added by | origin = whether the function came from the GECK itself or was added by a script extender. | ||
valid values: GECK1 (GECK 1.1), | valid values: GECK1 (GECK 1.1), GECK1.5 (GECK 1.5), FOSE1 (FOSE v1), | ||
VEGAS1 (GECK 1.1 New Vegas), NVSE (NVSE), NX (NX plugin), LU (Lutana Plugin), PN (Project Nevada), MCM (MCM), UDF (UDF), JIP (JIP) | |||
summary = description of the function | summary = description of the function | ||
''name'' = the name of the function | ''name'' = the name of the function. The page name is the default value. | ||
'' | ''alias'' = An abbreviated version of the function name that can be | ||
used instead of the long name. | |||
''returnVal '' = what the function returns | ''returnVal '' = what the function returns. | ||
returnType = the type of the returned value | ''returnType'' = the type of the returned value. | ||
''referenceType'' = if appropriate, the type of reference that the function may be called on with the dot syntax | ''referenceType'' = if appropriate, the type of reference that the function may be called | ||
'' | on with the dot syntax | ||
''arguments'' = List of arguments specified using the [[Template:FunctionArgument]] template, | |||
or any other wiki syntax. | |||
''example'' = optionally, the function used as part of a script to serve as an example | ''example'' = optionally, the function used as part of a script to serve as an example | ||
CategoryList = the list of categories to which the page belongs | ''CategoryList'' = the list of categories to which the page belongs | ||
<nowiki>}}</nowiki></noinclude><includeonly><!-- | <nowiki>}}</nowiki> | ||
=Example= | |||
<pre>{{Function | |||
|CSWikiPage = Test | |||
|origin = GECK1 | |||
|summary = Used to test actor and activator references to assure that they are testable. | |||
|name = Test | |||
|alias = tst | |||
|returnVal = 0, 1 | |||
|returnType = void | |||
|referenceType = [Actor, Activator] | |||
|arguments = | |||
{{FunctionArgument | |||
|Name = Count | |||
|Type = int | |||
|Value = 1, 2, 3 | |||
}}{{FunctionArgument | |||
|Name = Target | |||
|Type = ref | |||
|Optional = y | |||
}} | |||
|example = Player.Test 3 | |||
ShackDoor.Test 1 Molerat01 | |||
}}</pre> | |||
=Result= | |||
{{Function | |||
|CSWikiPage = Test | |||
|origin = GECK1 | |||
|summary = Used to test actor and activator references to assure that they are testable. | |||
|name = Test | |||
|alias = tst | |||
|returnVal = 0, 1 | |||
|returnType = void | |||
|referenceType = [Actor, Activator] | |||
|arguments = | |||
{{FunctionArgument | |||
|Name = Count | |||
|Type = int | |||
|Value = 1, 2, 3 | |||
}}{{FunctionArgument | |||
|Name = Target | |||
|Type = ref | |||
|Optional = y | |||
}} | |||
|example = Player.Test 3 | |||
ShackDoor.Test 1 Molerat01 | |||
}} | |||
</noinclude><includeonly>__NOEDITSECTION__<!-- | |||
Back to: link-->{{Bc|Category:Functions}}<!-- | Back to: link-->{{Bc|Category:Functions}}<!-- | ||
link to the CS Wiki page | link to the CS Wiki page | ||
-->{{ #if: {{{CSWikiPage|}}} | Link to TES4 Construction Set Wiki: [http://cs.elderscrolls.com | -->{{ #if: {{{CSWikiPage|}}} | Link to TES4 Construction Set Wiki: [http://cs.elderscrolls.com/index.php?title={{{CSWikiPage}}} {{{CSWikiPage}}}].|<!-- no CSwiki page -->}}<!-- | ||
line about the origin of the function (GECK1, | line about the origin of the function (GECK1, FOSE1) | ||
--> | --> | ||
{{ #switch: {{{origin}}} | {{ #switch: {{{origin}}} | ||
| GECK1 = A function included in the GECK version 1.1.0.36. | | GECK1 = A function included in the GECK version 1.1.0.36. | ||
| | | GECK1.5 = A function included in the GECK version 1.5.0.19. | ||
| VEGAS1 = A function included in the GECK Version 1.1.0.262 for '''Fallout: New Vegas'''. | |||
| FOSE1 = A function added by the [[Fallout Script Extender]]. | |||
| NVSE = A function added by the [[New Vegas Script Extender]]. | |||
| NX = A function added by the [[NX]] NVSE plugin. | |||
| PN = A function added by the [[PN|Project Nevada]] NVSE plugin. | |||
| LU = A function added by the [[Lutana]] NVSE plugin. | |||
| MCM = A function added the [[MCM]] NVSE plugin. | |||
| JIP = A function added by the [[Functions_(JIP)|JIP NVSE Plugin]]. | |||
| UDF = An example [[User Defined Function|UDF]] script. | |||
| #default = {{Error|missing function origin info}} | | #default = {{Error|missing function origin info}} | ||
}}<!-- | }}<!-- | ||
Line 46: | Line 106: | ||
<!-- syntax starts here: --> | <!-- syntax starts here: --> | ||
== Syntax == | == Syntax == | ||
<!-- help link --> | |||
<div style="font-size:10px;margin-top:-3em;margin-left:6.3em;">[[Function syntax|[help]]]</div> | |||
<!-- return value: | <!-- return value: | ||
--> ({{ #if: {{{returnVal|}}} | {{{returnVal}}}<nowiki>:</nowiki> |}}<!-- | --> {{ #ifeq: {{{returnType|void}}} | void |<!-- no Return Value -->|({{ #if: {{{returnVal|}}} | {{{returnVal}}}<nowiki>:</nowiki> |}}<!-- | ||
return type (short, float, base object, ref, something else?): | return type (short, float, base object, ref, something else?): | ||
-->{{ #ifeq: {{{returnType|missing}}} | missing | '''missing return type!''' | {{{returnType}}}) | -->{{ #ifeq: {{{returnType|missing}}} | missing | '''missing return type!''' | {{{returnType}}}) }} }}<!-- | ||
optional reference type (actor, activator, door, etc.): | optional reference type (actor, activator, door, etc.): | ||
-->{{ #if: {{{referenceType|}}} |''{{{referenceType}}}.''|}}<!-- | -->{{ #if: {{{referenceType|}}} |''{{{referenceType}}}.''|<!-- no Reference Type -->}}<!-- | ||
the actual function: | the actual function: | ||
-->{{{name| {{PAGENAME}} }}}<!-- | -->{{{name|{{PAGENAME}}}}}<!-- | ||
arguments | |||
-->{{ #if: {{{ | -->{{ #if: {{{arguments|}}} | {{{arguments}}} |<!-- no Arguments -->}}<!-- | ||
--> | |||
<!-- FOR ALIAS: return value: | |||
-- | -->{{ #if: {{{alias|}}} | | ||
-->{{ #if: {{{ | Or: | ||
{{ #ifeq: {{{returnType|void}}} | void |<!-- no Return Value -->|({{ #if: {{{returnVal|}}} | {{{returnVal}}}<nowiki>:</nowiki> |}}<!-- | |||
-->{{ #if: {{{ | |||
-->{{ # | return type (short, float, base object, ref, something else?): | ||
-->{{ #ifeq: {{{returnType|missing}}} | missing | '''missing return type!''' | {{{returnType}}}) }} }}<!-- | |||
optional reference type (actor, activator, door, etc.): | |||
-->{{ #if: {{{ | -->{{ #if: {{{referenceType|}}} |''{{{referenceType}}}.''|<!-- no Reference Type -->}}<!-- | ||
--> | |||
alias: | |||
-->{{{alias}}}<!-- | |||
arguments | |||
-->{{ #if: {{{arguments|}}} | {{{arguments}}} |<!-- no Arguments -->}}|<!-- no Alias -->}}<!-- | |||
example: --> | example: --> | ||
{{ #if: {{{example|}}} | == Example == | {{ #if: {{{example|}}} | == Example == | ||
{{{example}}} |}}<!-- | {{{example}}} |<!-- no Example -->}}<!-- | ||
categorization code (needs something clever): -->{{{CategoryList|}}}</includeonly> | categorization code (needs something clever): -->{{{CategoryList|}}}</includeonly> |