NV Play Cricket for WIndows includes a flexible templating system for outputting ball-by-ball data to a file that can then be consumed and processed by an external scoreboard system.
You can use this templating system to generate a wide variety of formats, or start with the provided files and customise them to suit your needs. The output format is defined by a template file, which uses field placeholders that are replaced with live match data whenever a scoring update occurs.
Example Configuration
In the following example, we will to output only the batting team name in JSON format using a text file called "simple-json-example.template".
Depending on the field information in the output file, the NV Play Cricket software updates the {{fieldname}} placeholders in the file as soon as it opens, or a soon as live ball-by-ball information becomes available.
Our test file contains a {{CurrentBattingTeamName}} placeholder field:
{ "thisIsTheBattingTeamName": "{{CurrentBattingTeamName}}" }
Once a ball is scored, the output might look like this:
{ "thisIsTheBattingTeamName": "NV Play Northern 1st XI" }
You can include any number of fields in the template file (for example, CurrentBowlingTeamName, Batter1_Name, Fielder1_Name, and CurrentRunRate). The output format can be JSON, XML, plain text, or any other format supported by your scoreboard system.
The full list of available fields is generated when NV Play Cricket starts and saved to the following reference files:
- %userprofile%\AppData\Local\NV_Play\NV\_Scoreboards\Fields\nvplay-scoreboard-fields.csv
- %userprofile%\AppData\Local\NV_Play\NV\_Scoreboards\Fields\nvplay-led-scoreboard-fields.csv
Open these reference files to see the fields you can choose to use in your own custom template file. Example template files are also available (though not recommended for new standard integrations) from:
- %userprofile%\AppData\Local\NV_Play\NV\_Scoreboards\Templates
By default, NV Play Cricket writes output files to this folder each time scoring data changes:
- %userprofile%\AppData\Local\NV_Play\NV\_Scoreboards\Output
Configure Scoreboard Output
To set up scoreboard output:
- Go to Tools > Configuration. The Configuration dialogue opens.
- Click the Scoreboard tab.
- Tick the Enable checkbox in the Output File 1 section.
- Click the Browse button beside Output file and select the output file that will be written to.
- Click the Browse button beside Template file and select a custom template file. If you leave this field empty, the output file will include all fields.
- Optionally, tick LED fields only to reduce output size (note that this might exclude some useful data).
- Repeat from step 3 in the Output File 2 section if you want to configure a second scoreboard output, or move to the next step if you only need one.
- Click OK to save and exit.
Example of a full field output without using a template:
Example using the "simple-json-example.template" file saved in the Templates folder: