Difference between revisions of "Template:Dafunction"

From Dragon Age Toolset Wiki
Jump to: navigation, search
(applying some stylistic changes suggested in user talk:Sunjammer)
m (Undo revision 18953 by Sunjammer (talk))
 
(34 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>
+
<includeonly>{{{brief}}}
 
+
{{{brief}}}
+
 
+
<dascript>
+
{{{returntype}}} {{{name}}} (
+
      {{{param1type}}} {{{param1name}}} = {{{param1default}}},
+
      {{{param2type}}} {{{param2name}}} = {{{param2default}}}
+
  )
+
</dascript>
+
  
 +
<div class="dascript" style="font-family:monospace; background-color:#F9F9F9; border: 1px dashed #2F6FAB; white-space:pre; line-height:1.25em; padding:1.0em;"><!--
 +
-->[[{{{returntype}}} keyword|{{{returntype}}}]]{{#if:{{{returnarra|}}}|[]}} {{{name}}}(<!--
 +
-->{{#if:{{{param1name|}}}| <br/>    [[{{{param1type}}} keyword|{{{param1type}}}]]{{#if:{{{param1arra|}}}|[]}} {{{param1name}}}{{#if:{{{param1default|}}}|&nbsp;= {{{param1default}}}|}}|}}<!--
 +
-->{{#if:{{{param2name|}}}|,<br/>    [[{{{param2type}}} keyword|{{{param2type}}}]]{{#if:{{{param2arra|}}}|[]}} {{{param2name}}}{{#if:{{{param2default|}}}|&nbsp;= {{{param2default}}}|}}|}}<!--
 +
-->{{#if:{{{param3name|}}}|,<br/>    [[{{{param3type}}} keyword|{{{param3type}}}]]{{#if:{{{param3arra|}}}|[]}} {{{param3name}}}{{#if:{{{param3default|}}}|&nbsp;= {{{param3default}}}|}}|}}<!--
 +
-->{{#if:{{{param4name|}}}|,<br/>    [[{{{param4type}}} keyword|{{{param4type}}}]]{{#if:{{{param4arra|}}}|[]}} {{{param4name}}}{{#if:{{{param4default|}}}|&nbsp;= {{{param4default}}}|}}|}}<!--
 +
-->{{#if:{{{param5name|}}}|,<br/>    [[{{{param5type}}} keyword|{{{param5type}}}]]{{#if:{{{param5arra|}}}|[]}} {{{param5name}}}{{#if:{{{param5default|}}}|&nbsp;= {{{param5default}}}|}}|}}<!--
 +
-->{{#if:{{{param6name|}}}|,<br/>    [[{{{param6type}}} keyword|{{{param6type}}}]]{{#if:{{{param6arra|}}}|[]}} {{{param6name}}}{{#if:{{{param6default|}}}|&nbsp;= {{{param6default}}}|}}|}}<!--
 +
-->{{#if:{{{param7name|}}}|,<br/>    [[{{{param7type}}} keyword|{{{param7type}}}]]{{#if:{{{param7arra|}}}|[]}} {{{param7name}}}{{#if:{{{param7default|}}}|&nbsp;= {{{param7default}}}|}}|}}<!--
 +
-->{{#if:{{{param8name|}}}|,<br/>    [[{{{param8type}}} keyword|{{{param8type}}}]]{{#if:{{{param8arra|}}}|[]}} {{{param8name}}}{{#if:{{{param8default|}}}|&nbsp;= {{{param8default}}}|}}|}}<!--
 +
-->{{#if:{{{param9name|}}}|,<br/>    [[{{{param9type}}} keyword|{{{param9type}}}]]{{#if:{{{param9arra|}}}|[]}} {{{param9name}}}{{#if:{{{param9default|}}}|&nbsp;= {{{param9default}}}|}}|}}<!--
 +
-->{{#if:{{{param10name|}}}|,<br/>    [[{{{param10type}}} keyword|{{{param10type}}}]]{{#if:{{{param10arra|}}}|[]}} {{{param10name}}}{{#if:{{{param10default|}}}|&nbsp;= {{{param10default}}}|}}|}}<!--
 +
--><br/>);</div>
 
<dl>
 
<dl>
<dt style="font-weight:normal;">Parameters:
+
<dt>Parameters:
<dd>
+
<dd>{{#if:{{{param1name|}}}|
<dl>
+
<dl><!--
<dt style="font-weight:normal; font-style:italic;">{{{param1name}}}<dd>{{{param1desc}}}
+
-->{{#if:{{{param1name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param1name}}}<dd>{{#if:{{{param1desc|}}}|{{{param1desc|}}}|{{undocumented}}}}|}}<!--
<dt style="font-weight:normal; font-style:italic;">{{{param2name}}}<dd>{{{param2desc}}}
+
-->{{#if:{{{param2name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param2name}}}<dd>{{#if:{{{param2desc|}}}|{{{param2desc|}}}|{{undocumented}}}}|}}<!--
</dl>
+
-->{{#if:{{{param3name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param3name}}}<dd>{{#if:{{{param3desc|}}}|{{{param3desc|}}}|{{undocumented}}}}|}}<!--
<dt style="font-weight:normal;">Returns:
+
-->{{#if:{{{param4name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param4name}}}<dd>{{#if:{{{param4desc|}}}|{{{param4desc|}}}|{{undocumented}}}}|}}<!--
<dd>{{{returndesc}}}
+
-->{{#if:{{{param5name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param5name}}}<dd>{{#if:{{{param5desc|}}}|{{{param5desc|}}}|{{undocumented}}}}|}}<!--
<dt style="font-weight:normal;">Source:
+
-->{{#if:{{{param6name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param6name}}}<dd>{{#if:{{{param6desc|}}}|{{{param6desc|}}}|{{undocumented}}}}|}}<!--
<dd>[[{{{sourcefile}}}]] from the module [[{{{sourcemodule}}}]]
+
-->{{#if:{{{param7name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param7name}}}<dd>{{#if:{{{param7desc|}}}|{{{param7desc|}}}|{{undocumented}}}}|}}<!--
</dl>
+
-->{{#if:{{{param8name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param8name}}}<dd>{{#if:{{{param8desc|}}}|{{{param8desc|}}}|{{undocumented}}}}|}}<!--
 
+
-->{{#if:{{{param9name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param9name}}}<dd>{{#if:{{{param9desc|}}}|{{{param9desc|}}}|{{undocumented}}}}|}}<!--
----
+
-->{{#if:{{{param10name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param10name}}}<dd>{{#if:{{{param10desc|}}}|{{{param10desc|}}}|{{undocumented}}}}|}}
 
+
</dl>|None}}
</noinclude><noinclude>
+
</dl><dl><dt>Returns:
 
+
<dd>{{#ifeq:{{{returntype}}}|void|Nothing.|{{#if:{{{returndesc|}}}|{{{returndesc|}}}|{{undocumented}}}}}}
Usage:
+
</dl><dl><dt>Source:
 
+
<dd>{{#if:{{{sourcemodule|}}}|[[{{{sourcemodule|}}}]].}}{{#if:{{{sourcefile|}}}|[[{{{sourcefile|}}}]]|{{undocumented}}}}
 +
</dl><!--
 +
-->{{#if:{{{sourcefile|}}}|[[Category:Functions from {{{sourcefile|}}}]]|[[Orphaned functions]]}}<!--
 +
-->{{#if:{{{version|}}}|[[Category:Functions from version {{{version}}}]]|[[Category:Functions from version 1.00]]}}<!--
 +
--></includeonly><noinclude>
 +
== Usage ==
 
<pre>
 
<pre>
 
{{dafunction
 
{{dafunction
|name = _AI_Condition_GetCreatureWithAIStatus
+
|version      =
|brief = Returns a creature with a specifc AI Status
+
|name         = _AI_Condition_GetCreatureWithAIStatus
|param1type = int
+
|brief         = Returns a creature with a specifc AI Status
|param1name = nAIStatus
+
|param1type   = int
|param1desc = the status being checked for if active on a creature
+
|param2arra    =
 +
|param1name   = nAIStatus
 +
|param1desc   = the status being checked for if active on a creature
 
|param1default =
 
|param1default =
|param2type = int
+
|param2type   = int
|param2name = nTargetType
+
|param2arra    =
|param2desc = the target type of creature we are looking for that might have the specified status
+
|param2name   = nTargetType
 +
|param2desc   = the target type of creature we are looking for that might have the specified status
 
|param2default =
 
|param2default =
 
.
 
.
 
.
 
.
 
.
 
.
|returntype = object
+
|returntype   = object
|returndesc = A creature of a specific type (self, ally, hostile) that has the status applied, OBJECT_INVALID otherwise
+
|returnarra    =
|sourcefile = ai_conditions_h
+
|returndesc   = A creature of a specific type (self, ally, hostile) that has the status applied, OBJECT_INVALID otherwise
|sourcemodule = Core Resources
+
|sourcefile   = ai_conditions_h
 +
|sourcemodule = Core Game Resources
 
}}
 
}}
 +
<!-- == Description == -->
 +
<!-- This section contains the full description from the functions comments. Do not change unless you are confident these are incomplete or incorrect. -->
 +
<!-- == Remarks == -->
 +
<!-- This section contains additional comments, observations and known issues. -->
 +
<!-- == Examples == -->
 +
<!-- This section contains examples transcluded from the snippet library. -->
 +
<!-- == See also == -->
 +
<!-- This section contains links to articles, functions or constant groups. -->
 +
 
</pre>
 
</pre>
 +
The return and parameter fields also have corresponding "arra" fields,  for example '''param1arra'''. When any value, normally "true", is placed in these fields the  corresponding return type or parameter type will be made into an array.  This is required because the [] notation of arrays conflicts with the  wiki's link notation.
  
Note: The finished version of this template will have much more complex source code that will make use of the parserfunctions extension to hide bits that shouldn't be visible (for example, if there's no default value for a parameter, there should be no "=". If there's only two parameters we don't want a whole lot of commas tacked on to the end of the parameter list. And so forth. Unfortunately, the web development team is busy getting the social site ready for certification right now so it'll be at least a week before the extension is installed. In the meantime this is a mockup to see what parameters are needed and how they're best laid out.
+
A standard function page will have a number of other headers below this template where more detailed and free-form information will be added by editors. The recommended headers and their purpose are:
 
+
A standard dafunction page will have a number of other headers below this template where more detailed and free-form information will be added by editors.
+
  
Suggested standard headers include:
+
* '''Description''': a more verbose description of the function
__NOTOC__
+
* '''Remarks''': hints and tips on usage; caveats or known issues; workarounds or unusal uses; etc.
== Description ==
+
* '''Examples''': dascript snippets demonstrating how to use the functions
== Examples ==
+
* '''See also''': links to related articles or categories
== Known bugs ==
+
== See also ==
+
  
With others added when and where needed.
+
Others sections can be added when and where needed.
  
 
[[Category:Formatting templates]]
 
[[Category:Formatting templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 00:38, 11 February 2013

Usage

{{dafunction
|version       =
|name          = _AI_Condition_GetCreatureWithAIStatus
|brief         = Returns a creature with a specifc AI Status
|param1type    = int
|param2arra    = 
|param1name    = nAIStatus
|param1desc    = the status being checked for if active on a creature
|param1default =
|param2type    = int
|param2arra    = 
|param2name    = nTargetType
|param2desc    = the target type of creature we are looking for that might have the specified status
|param2default =
.
.
.
|returntype    = object
|returnarra    = 
|returndesc    = A creature of a specific type (self, ally, hostile) that has the status applied, OBJECT_INVALID otherwise
|sourcefile    = ai_conditions_h
|sourcemodule  = Core Game Resources
}}
<!-- == Description == -->
<!-- This section contains the full description from the functions comments. Do not change unless you are confident these are incomplete or incorrect. -->
<!-- == Remarks == -->
<!-- This section contains additional comments, observations and known issues. -->
<!-- == Examples == -->
<!-- This section contains examples transcluded from the snippet library. -->
<!-- == See also == -->
<!-- This section contains links to articles, functions or constant groups. -->

The return and parameter fields also have corresponding "arra" fields, for example param1arra. When any value, normally "true", is placed in these fields the corresponding return type or parameter type will be made into an array. This is required because the [] notation of arrays conflicts with the wiki's link notation.

A standard function page will have a number of other headers below this template where more detailed and free-form information will be added by editors. The recommended headers and their purpose are:

  • Description: a more verbose description of the function
  • Remarks: hints and tips on usage; caveats or known issues; workarounds or unusal uses; etc.
  • Examples: dascript snippets demonstrating how to use the functions
  • See also: links to related articles or categories

Others sections can be added when and where needed.