User Tools

Site Tools


4rpl:commands:func

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
4rpl:commands:func [2021/01/13 18:22] – created virgilw4rpl:commands:func [2021/01/15 09:12] (current) – Definition -> Declaration Sanian
Line 2: Line 2:
 <=[[4rpl:start| Index]] <=[[4rpl:start| Index]]
  
-=== Syntax ===+====== Function Declaration ====== 
 + 
 +===== Syntax ===== 
 :FunctionName :FunctionName
  
-=== Description === +===== Description ===== 
-Defines the beginning of a function block.  + 
-Choose a unique name for the function.  +Defines the beginning of a function block. Choose a unique name for the function. Statements after a function block only execute if called by invoking the  function with an '@FunctionName' call. The end of a function block is either the end of the script or the  beginning of another function, whichever comes first. 
-Statements after a function block only execute if called by invoking the  + 
-function with an '@FunctionName' call.  +A few specific names exist that when used will make that function get automatically called by the game itself under certain circumstances. Read more about it under "Built in Function Callbacks" on the [[4rpl:start|Index]] page. 
-The end of a function block is either the end of the script or the  + 
-beginning of another function, whichever comes first.+===== Examples =====
  
-=== Examples === 
 <code 4rpl> <code 4rpl>
 # --- Roll a 100 sided die--------------  # --- Roll a 100 sided die-------------- 
Line 23: Line 25:
  # then compare to a random float.   # then compare to a random float. 
  100.0 div RandFloat gt  100.0 div RandFloat gt
-</code>  +</code>
  
4rpl/commands/func.1610580131.txt.gz · Last modified: 2021/01/13 18:22 by virgilw