7. Scripting

MESS can be used in multiple ways. Some of them depend on the use of MScript, the scripting language that is embedded into MESS:

  • Using standard template entities or adding props to terrain does not require any scripting.
  • Randomizing the angles and scale of props, or creating customizable templates does require some basic scripting knowledge.
  • Creating new template entities requires more advanced scripting or programming skills.

The syntax of MScript is similar to that of Python and Javascript. MScript expressions can be embedded in entity property names or values by surrounding them with curly braces. For example, fire_{4 + 5} contains the expression 4 + 5, which evaluates to 9, so the resulting value will be fire_9. The most common use is to reference parent entity properties by name. For example, {targetname} references the targetname property of the macro entity that is creating an instance of the current template.

Scripting topics