User Tools

Site Tools


functions

Differences

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

Link to this comparison view

Next revision
Previous revision
functions [2010/07/26 01:31] – created coopsquaredfunctions [2012/07/09 23:54] (current) – external edit 127.0.0.1
Line 2: Line 2:
  
 Back to [[edit_cartridges|Tabs List]].  Back to [[edit_cartridges|Tabs List]]. 
 +
 +Functions are an Earwigo-only feature, not available in the Groundspeak Builder.  A function is a sequence of one or more lines of code which you can "call" at any time, from an event handler (such as "when the cartridge is started" or "when the player enters a zone"), or from another function.
 +
 +In the Groundspeak Builder, you can write functions in the Lua programming language, but they have to go in the Author Script section, and you can't use any of the Builder tools to manage the statements of the function; for example, to use a zone or a character, you have to refer to its "internal" name.  Earwigo functions allow you to write "reusable" code without knowing too many of the details of Lua, and with an easy way to refer to the cartridge's objects.
  
 (Note1: picture showing the tab for Functions should go here) (Note1: picture showing the tab for Functions should go here)
Line 12: Line 16:
  
 (Brief explanation of the list tab, including how to add functions) (Brief explanation of the list tab, including how to add functions)
 +
 +(challenge: write an example of a more advanced function which uses the "parameter" possibility, that can be understood by the type of person who doesn't know how to write code in Lua, and will not generate lots of support calls from non-programmers! Nick 2010-07-26)
  
 ==== Properties ==== ==== Properties ====
    
 (Explanation of properties tab, including some commonly used functions) (Explanation of properties tab, including some commonly used functions)
functions.1280100699.txt.gz · Last modified: 2012/07/09 23:43 (external edit)