# Properties for Players

**URL:** https://forum.vassalengine.org/t/properties-for-players/1627
**Category:** Module Design
**Created:** [February 27, 2009, 7:14pm UTC](https://forum.vassalengine.org/t/properties-for-players/1627 "2009-02-27T19:14:32Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Neumannium](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/neumannium/32/2562_2.png) [@Neumannium](https://forum.vassalengine.org/u/Neumannium)
#### Post date: [February 27, 2009, 7:14pm UTC](https://forum.vassalengine.org/t/properties-for-players/1627/1 "2009-02-27T19:14:32Z")

</div>

Hi all,

Quick one here…regarding properties for players?

For instance, I know $playerSide$ spits out the side they chose, and $playerName$ is their login name…

Are there properties for any of the following:

If a player side is selected or not?

The name of a player (for example, if I have a player Side = Player 1 and Dave logs in as Player 1, is there a property like $player1\_Name$?) I’m using it for a label, and want the user name there, not the side name…

Thanks,

Dave

---

<div class="post-metadata">

### Author: ![Tim\_M](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/tim_m/32/2_2.png) [@Tim\_M](https://forum.vassalengine.org/u/Tim_M)
#### Post date: [February 27, 2009, 7:39pm UTC](https://forum.vassalengine.org/t/properties-for-players/1627/2 "2009-02-27T19:39:41Z")

</div>

Not really that Im aware of but you could work around this I think.  
When the player logs in, have them access a side specific token (either click action verify button type or grab a token type thingy) When they perform this intermediate feat you could run a trigger sequence through the token to set a DP on it to the value of $playerSide$ and then transfer that value to a GP so that it could be constantly read. (one method)

Another method would be that if the piece with the label in question is constantly changing sides, set the text label value to a DP named $Owner$ and whenever the piece is activated/selected, run a trigger to set the DP to value of $playerSide$ so that your label will update.

Might not be exactly what you want but gives some ideas to go with to get around it possibly

From: Neumannium [messages@forums.vassalengine.org](mailto:messages@forums.vassalengine.org)  
To: [messages@forums.vassalengine.org](mailto:messages@forums.vassalengine.org)  
Sent: Friday, February 27, 2009 1:14:35 PM  
Subject: [Module Design]Properties for Players

Hi all,

Quick one here…regarding properties for players?

For instance, I know $playerSide$ spits out the side they chose, and $playerName$ is their login name…

Are there properties for any of the following:

If a player side is selected or not?

The name of a player (for example, if I have a player Side = Player 1 and Dave logs in as Player 1, is there a property like $player1\_Name$?) I’m using it for a label, and want the user name there, not the side name…

Thanks,

Dave

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org) ([Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org))  
[http://forums.vassalengine.org/mailman/listinfo/messages\_forums.vassalengine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

### Author: ![Tim\_M](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/tim_m/32/2_2.png) [@Tim\_M](https://forum.vassalengine.org/u/Tim_M)
#### Post date: [February 28, 2009, 11:32pm UTC](https://forum.vassalengine.org/t/properties-for-players/1627/3 "2009-02-28T23:32:53Z")

</div>

> [@TagDaze](#):
>
> Could you tell me what a DP is?
> 
> You see, I’m trying to make create a chip that shows the side ($playerSide) and the name of the player who owns it/is on that side.

DP is short for the Dynamic Property trait

other commonly used acronyms you may find in posts:

GP - Global property  
GKC - Global key command  
TA - Trigger action

---

<div class="post-metadata">

### Author: ![TagDaze](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/t/73ab20/32.png) [@TagDaze](https://forum.vassalengine.org/u/TagDaze)
#### Post date: [February 28, 2009, 11:55pm UTC](https://forum.vassalengine.org/t/properties-for-players/1627/4 "2009-02-28T23:55:14Z")

</div>

Heh, you caught my post before I deleted it. I figured it out with a bit of puzzling. And I’m exploring the options, but now I’ve got a different problem. It sounds logical enough to work, but I’m obviously not doing this right somewhere. Could you help me out here?

Please check the bottom of the post for the chit I’m working with and what it looks like when I start the game.

* * *

GOAL:  
I’m trying to make ownership chits. I need to make it a chit (card-type) that has two labels on them.

1. The player who owns them.
2. The side.

SO FAR:  
Let’s say I need to change the text label on the “Emperor” player card to “Alex” when he owns the Emperor side, to “TagDaze” when I own it, and to “Frank” when he owns it.

The side-label was easy. I just typed “Emperor” in there, since that won’t ever change. It’s that side’s card-type chit.

Now I need to assign ownership. This is what I did:

1. I added a SetGlobalProperty to the Emperor-card.

- Global Property Name: $EmpOwner$
- Locate Property starting in the: Current Zone/Current Map/Module
- KEY COMMANDS:
- Menu Command: Own side
- Key Command:
- Type: Set value directly
- New Value: $playerName$

1. I changed the text label.

- Text: $EmpOwner$
- Name format: $pieceName$ ($label$)

* * *

RESULT:

When I start the game, and I rightclick the card, it gives me the option “Own Side”. When I click on it, I expected it to change $EmpOwner$ to TagDaze (which is my $playerName$). Instead, it gave me a untrapped error / NullPointerException error.

My guess is that it has something to do with the $'s in the labels, but I have no clue where to start.

---

<div class="post-metadata">

### Author: ![Tim\_M](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/tim_m/32/2_2.png) [@Tim\_M](https://forum.vassalengine.org/u/Tim_M)
#### Post date: [March 1, 2009, 3:08am UTC](https://forum.vassalengine.org/t/properties-for-players/1627/5 "2009-03-01T03:08:30Z")

</div>

Could you post a link to your mod?  
Will be easier to see what your doing

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<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: [March 1, 2009, 7:24am UTC](https://forum.vassalengine.org/t/properties-for-players/1627/6 "2009-03-01T07:24:35Z")

</div>

> [@](#):
>
> Instead, it gave me a untrapped error NullPointerException error.

PLEASE, submit the bug report.

B.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

### Author: ![TagDaze](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/t/73ab20/32.png) [@TagDaze](https://forum.vassalengine.org/u/TagDaze)
#### Post date: [March 1, 2009, 12:11pm UTC](https://forum.vassalengine.org/t/properties-for-players/1627/7 "2009-03-01T12:11:40Z")

</div>

It’s a modified Dune module. I replaced some ridiculously huge graphics with a blank picture. They’re not necessary for the fix and it saves up/download time. 🙂

> [Clicky for download](http://www.danarend.net/dune/dunemod.mod) \<

When you start the module, go to the Markers window.  
At the top you’ll see a stack of chits, the top of which is a blue Bene Gesserit chip.  
Below that is the Guild chip, and below THAT is the Emperor chip I’m working with.

In the editor the chips are located under "Markers\Player Markers [Deck]"

ERRORLOG:  
– OS Windows Vista  
– Java version 1.6.0\_10  
– VASSAL version 3.0.17  
– Dune version 2.02 / 0.021  
java.lang.NullPointerException  
at VASSAL.counters.KeyBuffer.keyCommand(KeyBuffer.java:108)  
at VASSAL.counters.KeyCommand.actionPerformed(KeyCommand.java:103)  
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)  
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)  
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)  
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)  
at javax.swing.AbstractButton.doClick(Unknown Source)  
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)  
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)  
at java.awt.Component.processMouseEvent(Unknown Source)  
at javax.swing.JComponent.processMouseEvent(Unknown Source)  
at java.awt.Component.processEvent(Unknown Source)  
at java.awt.Container.processEvent(Unknown Source)  
at java.awt.Component.dispatchEventImpl(Unknown Source)  
at java.awt.Container.dispatchEventImpl(Unknown Source)  
at java.awt.Component.dispatchEvent(Unknown Source)  
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)  
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)  
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)  
at java.awt.Container.dispatchEventImpl(Unknown Source)  
at java.awt.Window.dispatchEventImpl(Unknown Source)  
at java.awt.Component.dispatchEvent(Unknown Source)  
at java.awt.EventQueue.dispatchEvent(Unknown Source)  
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)  
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)  
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)  
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)  
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)  
at java.awt.EventDispatchThread.run(Unknown Source)

---

<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: [March 1, 2009, 12:17pm UTC](https://forum.vassalengine.org/t/properties-for-players/1627/8 "2009-03-01T12:17:14Z")

</div>

> [@](#):
>
> – OS Windows Vista  
> – Java version 1.6.0\_10  
> – VASSAL version 3.0.17  
> – Dune version 2.02 / 0.021  
> java.lang.NullPointerException  
> at VASSAL.counters.KeyBuffer.keyCommand(KeyBuffer.java:108)

This bug is fixed in the current version (3.1.0) of Vassal.

B.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

### Author: ![TagDaze](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/t/73ab20/32.png) [@TagDaze](https://forum.vassalengine.org/u/TagDaze)
#### Post date: [March 1, 2009, 12:51pm UTC](https://forum.vassalengine.org/t/properties-for-players/1627/9 "2009-03-01T12:51:49Z")

</div>

Wait what, so I actually did it right?

Edit: No I didn’t. The label doesn’t show up at all.

Edit 2: Huzzah, I got one step closer.  
I made Dynamic Property. Name EmpOwner, Value Unowned. I had to remove the dollar signs there.

---

<div class="post-metadata">

### Author: ![JMOxx75](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/j/ee59a6/32.png) [@JMOxx75](https://forum.vassalengine.org/u/JMOxx75)
#### Post date: [August 16, 2009, 9:27pm UTC](https://forum.vassalengine.org/t/properties-for-players/1627/10 "2009-08-16T21:27:34Z")

</div>

> [@](#):
>
> Not really that Im aware of but you could work around this I think.  
> When the player logs in, have them access a side specific token (either click action verify button type or grab a token type thingy) When they perform this intermediate feat you could run a trigger sequence through the token to set a DP on it to the value of $playerSide$ and then transfer that value to a GP so that it could be constantly read. (one method)

How exactly do you assign a DP to a token with the player just dragging them to the map? And once you drag it to the map how do you transfer the DP value to a GP? I have been trying to wrap my head around it but I haven’t messed with Vassal in a while. If you could elaborate I would appreciate it.  
[/quote]

---

<div class="post-metadata">

### Author: ![Tim\_M](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/tim_m/32/2_2.png) [@Tim\_M](https://forum.vassalengine.org/u/Tim_M)
#### Post date: [August 16, 2009, 9:44pm UTC](https://forum.vassalengine.org/t/properties-for-players/1627/11 "2009-08-16T21:44:31Z")

</div>

> [@JMOxx75](#):
>
> How exactly do you assign a DP to a token with the player just dragging them to the map?

By setting a key command to the last field in the Map properties “Apply key command to pieces that end move on map” (or something like that its called)

> [@](#):
>
> And once you drag it to the map how do you transfer the DP value to a GP? I have been trying to wrap my head around it but I haven’t messed with Vassal in a while. If you could elaborate I would appreciate it.

By using a TA that is fired with the key from your Map key field that executes the sequence to set DP/GP what have you

---

<div class="post-metadata">

### Author: ![JMOxx75](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/j/ee59a6/32.png) [@JMOxx75](https://forum.vassalengine.org/u/JMOxx75)
#### Post date: [August 16, 2009, 10:47pm UTC](https://forum.vassalengine.org/t/properties-for-players/1627/12 "2009-08-16T22:47:44Z")

</div>

Thanks for the reply. Its amazing how clear that is and I didn’t see it. I will give it a try to see how it goes.
