Scripting: Difference between revisions

257 bytes added ,  23 April 2021
m
no edit summary
mNo edit summary
mNo edit summary
Line 9: Line 9:
=== The '''[[JavaScript field]]''' type ===
=== The '''[[JavaScript field]]''' type ===
Like the Memento Calculation field type that game before it, the JavaScript field exists to produce ("return") a value calculated with an ''expression'', which is a formula consisting of ''constants'', ''variables'', ''operators'', and possibly ''statements''.
Like the Memento Calculation field type that game before it, the JavaScript field exists to produce ("return") a value calculated with an ''expression'', which is a formula consisting of ''constants'', ''variables'', ''operators'', and possibly ''statements''.
==== Example scripts ====
;123: Just the value a hundred and twenty-three
; 2 * currentWeight: If currentWeight is 23 lbs, then this expression has the value 46 lbs
; (hours * 60) + 10:If hours is 5 and minutes if 10, then the expression has the value 310


==== Terminology ====
==== Terminology ====