# A Tip using Restrict Commands Trait

**URL:** <https://forum.vassalengine.org/t/a-tip-using-restrict-commands-trait/12124>\
**Category:** General Discussion\
**Created:** [July 5, 2021, 1:05pm UTC](https://forum.vassalengine.org/t/a-tip-using-restrict-commands-trait/12124 "2021-07-05T13:05:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![palad0n](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/palad0n/32/215_2.png) [@palad0n](https://forum.vassalengine.org/u/palad0n)\
**Post date:** [July 5, 2021, 1:05pm UTC](https://forum.vassalengine.org/t/a-tip-using-restrict-commands-trait/12124/1 "2021-07-05T13:05:47Z")

</div>

I added some restrict commands to limit access to a few ‘send to’ traits to only those counters on specific maps. Counters on any other map within the module would have all ‘send to’ traits hidden - there are lot of these maps spread throughout the module.

While I could enter a very long condition to apply the hide traits, I wanted something way simpler.

After thinking about this for some time I came up with:

1. Use a calculated property to set a true/false depending on which current board/map a counter was on.  
((CurrentBoard==“Americas CE” || CurrentBoard==“Americas AiF” || CurrentBoard==“Pacific”) ? (true) : (false))

2, The restrict command then tests whether the CP (name used being whichboard) for false and if so hides all the ‘send to’ traits.

Voila.

---

<div class="post-metadata">

**Author:** ![marktb1961](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/marktb1961/32/231_2.png) [@marktb1961](https://forum.vassalengine.org/u/marktb1961)\
**Post date:** [July 5, 2021, 10:12pm UTC](https://forum.vassalengine.org/t/a-tip-using-restrict-commands-trait/12124/2 "2021-07-05T22:12:41Z")

</div>

Here’s another idea for shorter Restrict Command expressions, that recently dawned on me….

Set a Global Property at module level…. e,g,

notHere = true

Now, for each map where you want to allow the command,  
set the same property to, in this example, false.

Now you can have a Restrict Command expression that will restrict the command to those locations,  
In this example, {notHere}

You could apply at Zone level also, or some mixture of the two, which might offer a way to use this technique if you need to distinguish between multiple boards on the same map.

Mark

---

<div class="post-metadata">

**Author:** ![JoelCFC25](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/joelcfc25/32/2687_2.png) [@JoelCFC25](https://forum.vassalengine.org/u/JoelCFC25)\
**Post date:** [July 6, 2021, 2:54pm UTC](https://forum.vassalengine.org/t/a-tip-using-restrict-commands-trait/12124/3 "2021-07-06T14:54:48Z")

</div>

(CurrentBoard=~“Americas CE|Americas AiF|Pacific”)

…should work as a condensed form of the matching portion.
