Scripting Guide - richardwilkes/gcs GitHub Wiki

Scripting Guide

Available in GCS 5.36.0 and later.

Some fields, such as notes, support using Javascript to resolve their content. Versions of GCS prior to v5.36.0 used a simple expression evaluator instead. Expressions from those old data files will be automatically transformed into the equivalent Javascript.

Fields that are scriptable will have a Scripting Guide button next to them to bring up this documentation. Scriptable fields that are intended to resolve to a number may either contain a number or a script. Scriptable fields that are intended to resolve to text, however, must have the scripting portion(s) wrapped in tags, like this:

My ST + DX is <script>$st + $dx</script> and my name is <script>entity.name</script>.

When your Javascript code is called, the following globals will be available for you to use:

In addition, any attributes you've defined for the sheet are available as globals using their ID prefixed with a dollar sign, e.g. $st refers to the Strength attribute.


Last updated for v5.41.0

⚠️ **GitHub.com Fallback** ⚠️