How do I set the initial layer level for a piece ...


I have some game pieces which have multiple layers. These are used in a game where each counter has a number of “steps” each which shows the counter at a further reduced strength. The player can press 1 of 2 control keys to step the counter up and down from maximum to minimum. Some counters have 7 steps while others have only 2. In all cases the last step is the counter back or “blank” counter image. The first image level is always the counter maximum step strength. I place all the counters into At Start stacks on the OOB charts. Most counters begin at full strength (i.e. the first level in their game piece layers), BUT a small number of counters begin at a reduced strength, and the player will build them up later with replacements.

My question is, how can I set the initial image level of the game piece Layer attribute to something other than the “Image 1”

Now, before you answer, I realise I could just place the image I want first as image 1, then all the lower images, and then all the higher images after to the end, so when the step up and down the natural sequence follows …

example: image 3 - image 2 - image 1 - image 6 - image 5 - image 4

… I have used this method before, however I don’t want “Loop through levels” to be used. I prefer a hard stop at the top level and the bottom level. Any ideas? I am happy to code a small amount of JS if necessary, although I need a little more info about the internals of the Layer attribute.


Set the Layer to follow a Dynamic Property as follows:

Always Active
NO Loop Through Levels
Level Follow Property Value
Property Name = UnitStep
Remove all key commands

Above the layer trait in your trait order, set up a Dynamic Property

Name = UnitStep
Value = The initial step you want the unit at to start
Key Commands = Use the same key commands you’re using now to Increase / Decrease the steps

This way you can use the Dynamic Property to set your initial layer and the key commands on the Dynamic Property allows the player in change layers.

Thanks Dr, that worked a treat