Debugging Tip: Interactive Property peek

Module developers can include a reporting trait on pieces to dump out some property values whilst developing a module. Indirection allows a way of doing this at runtime.

In its simplest form, to add the ability query the value of an arbitrary property from a given map;

  1. Select the piece that you wish to query in real-time. For global properties, select a piece that is always on the map/zone that you want to perform your query in.
  2. To this piece, add Dynamic Property and Report Action traits and a Trigger Action trait that will tie the two together under a single Key Command.
  3. Configure the Dynamic Property trait to get prompt for the name of a Property to report.
  4. Configure the Report Trait will report the value of that Property. Example report format:- {gpname + " = " + GetProperty(gpname)}

When done, the Key Command specified in the Trigger Action will prompt for the name of a property; the user/developer enters the name of the property that they wish to query. The property name and value will be output to the chat window. Subsequent uses of the same command will offer the property name as a default.

Hope this helps someone else.

Mark

1 Like

smart!