# Implementing a lookup table

**URL:** https://forum.vassalengine.org/t/implementing-a-lookup-table/72442
**Category:** Module Design
**Created:** [September 19, 2021, 2:17am UTC](https://forum.vassalengine.org/t/implementing-a-lookup-table/72442 "2021-09-19T02:17:44Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![jestew](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/jestew/32/77_2.png) [@jestew](https://forum.vassalengine.org/u/jestew)
#### Post date: [September 19, 2021, 2:17am UTC](https://forum.vassalengine.org/t/implementing-a-lookup-table/72442/1 "2021-09-19T02:17:45Z")

</div>

I want to add a function in a module that rolls a die and replaces a units trait value with the corresponding value in the lookup table using the die roll. Spreadsheet traits don’t seem to expose their values to expressions so I’m wondering how other modules do this - I’m guessing custom classes? Any examples I can look at to help me along? Thanks! jas…

---

<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: [September 19, 2021, 4:39am UTC](https://forum.vassalengine.org/t/implementing-a-lookup-table/72442/2 "2021-09-19T04:39:07Z")

</div>

My first thought is to implement your lookup table as set of global properties, such as:  
gp1 = “a”  
gp2 = “b”  
gp3 = “c”  
Etc

If the die result is in a property called “result”, set the trait to `{GetProperty(“gp”+result)}`

Is that any help?

---

<div class="post-metadata">

### Author: ![jestew](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/jestew/32/77_2.png) [@jestew](https://forum.vassalengine.org/u/jestew)
#### Post date: [September 19, 2021, 4:37pm UTC](https://forum.vassalengine.org/t/implementing-a-lookup-table/72442/3 "2021-09-19T16:37:06Z")

</div>

Yes, I suspect that’s GEFN.

I’d like it if the tables were all in one nicely package place instead of floating around as disconnected properties. A property list for example. But until then, or if there isn’t anyone out there that has implemented this as a custom class solution - I will use your suggesting to “Just Get It Done”. Thanks! jas…

---

<div class="post-metadata">

### Author: ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)
#### Post date: [September 19, 2021, 10:09pm UTC](https://forum.vassalengine.org/t/implementing-a-lookup-table/72442/4 "2021-09-19T22:09:58Z")

</div>

> I’d like it if the tables were all in one nicely package place instead of floating around as disconnected properties.

Put that set of properties in an appropriately named folder.

---

<div class="post-metadata">

### Author: ![jestew](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/jestew/32/77_2.png) [@jestew](https://forum.vassalengine.org/u/jestew)
#### Post date: [June 11, 2022, 6:04pm UTC](https://forum.vassalengine.org/t/implementing-a-lookup-table/72442/5 "2022-06-11T18:04:06Z")

</div>

I don’t think it can be stated too many times how wonderful folders are at cleaning up and organizing module behaviors.

Galileo: “How do we know there’s a God?”  
Grand Inquisitor: “Because VASSAL has folders!”

---

<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: [June 25, 2022, 12:14pm UTC](https://forum.vassalengine.org/t/implementing-a-lookup-table/72442/6 "2022-06-25T12:14:38Z")

</div>

> [@Brent\_Easton](#):
>
> Put that set of properties in an appropriately named folder

The GPs folder can accept sub folders and still remain GPs? That would be absolutely grand as I have of beggars ATM and it takes while to scroll down through them.

---

<div class="post-metadata">

### Author: ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)
#### Post date: [June 25, 2022, 12:22pm UTC](https://forum.vassalengine.org/t/implementing-a-lookup-table/72442/7 "2022-06-25T12:22:07Z")

</div>

Yes, Folders are completely invisible in the hierarchy. Any ‘thing’ that can go into a component can also go into a folder in that component to any depth of folders and still be a ‘thing’ belonging to that component.

---

<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: [June 25, 2022, 12:32pm UTC](https://forum.vassalengine.org/t/implementing-a-lookup-table/72442/8 "2022-06-25T12:32:36Z")

</div>

Swear word, cool. I never knew that. Does the developers guide say that somewhere? I know the old 3.1 designers guide pretty well, still sort of going through the new wiki as I need to, and I do not believe that I have read that core information.

---

<div class="post-metadata">

### Author: ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)
#### Post date: [June 25, 2022, 9:19pm UTC](https://forum.vassalengine.org/t/implementing-a-lookup-table/72442/9 "2022-06-25T21:19:13Z")

</div>

It is mentioned in the Reference manual, which we maintain, but the Developer/Designer guide was not written by the Dev team and has not been updated in a long time.

---

<div class="post-metadata">

### Author: ![twenck](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/t/dc4da7/32.png) [@twenck](https://forum.vassalengine.org/u/twenck)
#### Post date: [August 24, 2022, 8:39pm UTC](https://forum.vassalengine.org/t/implementing-a-lookup-table/72442/10 "2022-08-24T20:39:52Z")

</div>

Not so fast Brent. The Move Camera Button cannot be placed into a folder of its parent Map.
