Template:ScriptCommandPage: Difference between revisions

From Arx Libertatis Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(12 intermediate revisions by the same user not shown)
Line 4: Line 4:


   the script command name
   the script command name
   -->{{#vardefine:command_name|{{PAGENAME}}}}<!--
   -->{{#vardefine:command_name|{{{command|{{PAGENAME}}}}}}}<!--
  --><includeonly>{{DISPLAYTITLE:{{#var:command_name}}}}</includeonly><!--


   command obsolete
   command obsolete
Line 102: Line 103:


   -->{{#if:{{#var:command_param_name}}|<!--
   -->{{#if:{{#var:command_param_name}}|<!--
      -->{{#ifeq:{{#sub:{{#var:command_param_name}}|0|1}}|<|<!--
        -->{{#vardefine:command_param_name|{{#sub:{{#var:command_param_name}}|1}}}}<!--
      -->|<!-- else
        -->&nbsp;<!--
      -->}}<!--
   


       Extract parameter type
       Extract parameter type
Line 117: Line 125:
       Print parameter definition
       Print parameter definition
       -->{{#if:{{#var:command_param_flag}}|<!--
       -->{{#if:{{#var:command_param_flag}}|<!--
         -->&nbsp;[{{#var:command_param_flag}}?{{Highlight|{{#var:command_param_type}}|{{#var:command_param_name}}}}{{#var:command_param_var}}]<!--
         -->[{{#var:command_param_flag}}?{{Highlight|{{#var:command_param_type}}|{{#var:command_param_name}}}}{{#var:command_param_var}}]<!--
       -->|<!-- else
       -->|<!-- else
         -->&nbsp;{{#if:{{#var:command_param_type}}|<!--
         -->{{#if:{{#var:command_param_type}}|<!--
             --><{{Highlight|{{#var:command_param_type}}|{{#var:command_param_name}}}}{{#var:command_param_var}}><!--
             -->&lt;{{Highlight|{{#var:command_param_type}}|{{#var:command_param_name}}}}{{#var:command_param_var}}&gt;<!--
         -->|<!-- else
         -->|<!-- else
             -->{{#var:command_param_name}}<!--
             -->{{#var:command_param_name}}<!--
Line 189: Line 197:
   -->{{#ifeq:{{#var:command_param_type}}|command|<!--
   -->{{#ifeq:{{#var:command_param_type}}|command|<!--
       -->{{#set:has command param=true}}[[Category:Script delayed execution]]<!--
       -->{{#set:has command param=true}}[[Category:Script delayed execution]]<!--
  -->}}<!--
  -->{{#ifeq:{{#var:command_param_type}}|variable|<!--
      -->{{#set:has variable param=true}}<!--
   -->}}<!--
   -->}}<!--


-->
-->
<td><code style="font-weight: bold">{{#var:command_param_name}}</code>{{#if:{{#var:command_param_flag}}|&nbsp;(requires <code>-{{#var:command_param_flag}}</code>)}}</td>
<td><code style="font-weight: bold">{{#var:command_param_name}}</code>{{#if:{{#var:command_param_flag}}|{{#ifeq:{{#sub:{{#var:command_param_flag}}|0|1}}|!|&nbsp;(if not <code>-{{#sub:{{#var:command_param_flag}}|1}}</code>)|&nbsp;(requires <code>-{{#var:command_param_flag}}</code>)}}}}</td>
<td><code>{{Highlight|{{#var:command_param_type}}}}</code>{{#var:command_param_var}}{{#if:{{#arrayindex:command_param_typeextra|0}}|&nbsp;{{#arrayindex:command_param_typeextra|0}}}}</td>
<td><code>{{Highlight|{{#var:command_param_type}}}}</code>{{#var:command_param_var}}{{#if:{{#arrayindex:command_param_typeextra|0}}|&nbsp;{{#arrayindex:command_param_typeextra|0}}}}</td>
<td>{{#var:command_param}}</td>
<td>{{#var:command_param}}</td>
Line 209: Line 220:
== Usage ==
== Usage ==


Template for script event pages
Template for script command pages


Parameters:
Parameters:


* <code>description</code>  (required) - short description of what the command is used for
* <code>description</code>  (required) - short description of what the command is used for
* <code>context</code> (optional) - type of entity that is required for this command  - <code>any</code>, <code>item</code> or <code>none</code>
* <code>context</code> (optional) - type of entity that is required for this command  - <code>any</code>, <code>item</code>, <code>npc</code>, <code>camera</code>, <code>prop</code>, <code>self</code> or <code>none</code>
* <code>special</code>  (optional) - special invocations in the format <code>-f[lags] parameters...</code> or <code>keyword parameters...</code>, one per line
* <code>special</code>  (optional) - special invocations in the format <code>-f[lags] parameters...</code> or <code>keyword parameters...</code>, one per line
* <code>default</code>  (optional) - set to false to disable the default invocation
* <code>default</code>  (optional) - set to false to disable the default invocation

Latest revision as of 22:29, 2 January 2024

The ScriptCommandPage script command is used to.

Usage

ScriptCommandPage

Context: Ignored


Usage

Template for script command pages

Parameters:

  • description (required) - short description of what the command is used for
  • context (optional) - type of entity that is required for this command - any, item, npc, camera, prop, self or none
  • special (optional) - special invocations in the format -f[lags] parameters... or keyword parameters..., one per line
  • default (optional) - set to false to disable the default invocation
  • flags (optional) - flags accepted by this command in the format f Description, one per line.
    The space after the flag character can be replaced with ? to exclude the flag from the default invocation or with ! to indicate that one of the marked flags is required for the default invocation. The first flag of each special invocation is always excluded from the default invocation.
  • parameters (optional) - parameters accepted by this command in the format name type Description
    name can be prefixed with f? to make the parameter dependent on flag -f.
    type can be suffixed with * to indicate that the parameter will automatically be dereferenced if it looks like a variable and with any additional non-space text starting with a non-alpha character to provide additional type info.
  • obsolete (optional) - set to true to mark the command as obsolete and unimplemented. No description or context should be provided in this case
  • intro (optional) - additional text to insert before the usage section