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

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
To: 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 (Messages@forums.vassalengine.org)
http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org

Post generated using Mail2Forum (mail2forum.com)

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

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.

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

Post generated using Mail2Forum (mail2forum.com)

PLEASE, submit the bug report.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

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. :slight_smile:

Clicky for download <

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)

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

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

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.

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]

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)

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

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.