G General

{NRI} Scriptable Domino Version 1.0

{NRI} Scriptable Domino
Details
Features
Contents
Reviews

This scriptable domino is meant for use in games, it can be commanded to display 0-9 pips on either side of the domino. The domino has both PBR and fallback materials.

########
## Setup ##
########

1. Link the domino to your project.
2. Change the name or description to something useful for your code to refer to.
3. In your script, you can then write to the domino using one of three options: Global link messages, specific link messages, or linkset data.

##################
## Global Link Messages ##
##################

To write to the domino using global link messages, use the following command:

llMessageLinked(LINK_SET, -38464, DISPLAYED_PIPS, DOMINO_ID);

In this command, DISPLAYED_PIPS is a string of 2 numbers. To set the domino to show 3 on side 1 and 7 on side 2, you'd send it "37". You can replace one of the numbers with a dash to update only one side, for example to only change side 2 to an 8, you'd send it "-8".

DOMINO_ID can be any of: The link name, the link description, or the link key.

###################
## Specific Link Messages ##
###################

Specific link messages work exactly like the global version, except you replace the DOMINO_ID with NULL_KEY, and replace the LINK_SET with the link number of the domino.

llMessageLinked(DOMINO_LINK_NUMBER, -38464, DISPLAYED_PIPS, NULL_KEY);


#############
## Linkset Data ##
#############

Alternatively, you can set the state of the domino using linkset data.

llLinksetDataWrite(DOMINO_ID, DISPLAYED_PIPS);

DOMINO_ID works exactly like the link message parameter of the same name, with the exception that once you pick an ID, you have to keep using the same one.

DISPLAYED_PIPS works exactly like the link message parameter of the same name, with the exception that if you send a parameter like "8-", the domino will write back the digit that you didn't change to linkset data. This is so that that it can reload the linkset data upon start.

If you reset the script and there is linkset data set, the linkset data will be reloaded.

If you have set the domino using linkset data, it will also listen to delete and reset events, and wipe itself if needed.

#########
## License ##
#########

The code of the ".dominocontroller" script is licensed under the GPLv3 license.

The mesh and textures are licensed under the CC-BY-SA v4 license.

What this means is that you must:
- Include a full-perm copy of the domino in your project package.
- The .dominocontroller script MUST remain full-perm, even if you change it. Any other script using all or part of the code inside .dominocontroller must remain full-perm as well.

You are free to charge for your product, or give it away, or do anything with it as long as you follow the terms of the license.