Changes between Initial Version and Version 1 of Cheat_Templates


Ignore:
Timestamp:
May 4, 2014, 5:24:37 AM (10 years ago)
Author:
leper
Comment:

Initial version

Legend:

Unmodified
Added
Removed
Modified
  • Cheat_Templates

    v1 v1  
     1Cheat template files use the [wiki:JSON JSON] format and are put in [source:/ps/trunk/binaries/data/mods/public/simulation/data/cheats simulation/data/cheats] (see [wiki:Mod_Layout mod layout]).
     2
     3The basic format is:
     4{{{
     5#!js
     6{
     7        "Name": "i want pizza",
     8        "Data": {
     9                "Action": "addresource",
     10                "Type": "food",
     11                "DefaultParameter": 1000,
     12                "isNumeric": true,
     13                "Templates": []
     14        }
     15}
     16}}}
     17
     18'''Name''' is the string which has to be entered in the chat to execute the '''Action''' (if cheats are enabled). The code which decides what to do (based on the '''Action''' is [source:/ps/trunk/binaries/data/mods/public/simulation/helpers/Cheat.js Cheat.js].
     19
     20'''Type''': '''Optional''' passed as an additional parameter (to differentiate between similar actions).
     21
     22'''!DefaultParameter''': '''Optional'''. If this is defined the cheat takes an additional parameter. The default, which is used if no additional parameter is provided is the value of '''!DefaultParameter'''.
     23
     24'''isNumeric''': '''Optional''', only used iff the cheat takes a parameter. If true the parameter is passed as a number, else it is passed as a string. Only positive integers are currently passed on.
     25
     26'''Templates''': '''Optional'''. Array of templates that the cheat uses (eg [source:/ps/trunk/binaries/data/mods/public/simulation/data/cheats/createPlane.json createPlane.json]).