Create account / Log in

Properties from another map

Topics related to Vassal game modules.

Moderator: bsmith

Properties from another map

Postby HealingAura » January 15th, 2012, 6:15 pm

In my module, map1 contains a deck "deck1".
In map2 I want to create a text label to count the number of cards in deck1 but when I try "$deck1_numPieces$" or "$map1_deck1_numPieces$".
How can you do that?
HealingAura
 
Posts: 9
Joined: July 4th, 2011, 4:46 am

Re: Properties from another map

Postby mycenae » January 15th, 2012, 6:36 pm

I think text labels can only display properties on a piece, or global properties.
mycenae
 
Posts: 376
Joined: May 16th, 2008, 6:41 pm

Re: Properties from another map

Postby HealingAura » January 15th, 2012, 7:19 pm

the text label is on a single piece that is in a at-start-stack
HealingAura
 
Posts: 9
Joined: July 4th, 2011, 4:46 am

Re: [messages] [Module General Discussion] Properties from a

Postby Tim M » January 15th, 2012, 7:24 pm

$deck1_numPieces$ is the correct expression, unfortunately it can not be
read across maps - only in the map that contains the deck

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of HealingAura
Sent: Sunday, January 15, 2012 12:16 PM
To: messages@vassalengine.org
Subject: [messages] [Module General Discussion] Properties from another map

In my module, map1 contains a deck "deck1".
In map2 I want to create a text label to count the number of cards in
deck1 but when I try "$deck1_numPieces$" or "$map1_deck1_numPieces$".
How can you do that?

_______________________________________________
Read this topic online here:
viewtopic.php?p=29540#p29540
Tim,
Vassal Uber Geek

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1570
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Properties from another map

Postby DrNostromo » January 16th, 2012, 12:47 am

$deck1_numPieces$ is the correct expression, unfortunately it can not be
read across maps - only in the map that contains the deck


True ...but you may be able to set the cards to trigger a Set Global Property trait when they are drawn. Create a Global Property called something like Deck1CardCount and set the GP to $deck1_numPieces$ whenever a card is drawn. Then have your text label display $Deck1CardCount$

If the card is being drawn to a different map than the map containing deck1, create an invisible At-Start stack piece on Map 1 to control the SGP. Then have the card send a Global Key Command to the At-Start stack piece to trigger the SGP.
Dr_Nostromo
Creator - To Be King, Trivial Wars, WWIV
Dr Nostromo's Place
Dr Nostromo's Forum
User avatar
DrNostromo
 
Posts: 819
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA


Return to Module General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron