Create account / Log in

Having a Layer Property Follow Map Property

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Having a Layer Property Follow Map Property

Postby bugstomper » July 25th, 2010, 9:13 pm

I'm making a game where each of the map zones has a Global Property called wealth (numeric).

I have game markers to show which side controls the zone. The control markers have a Layer called tax, which I have set to follow the property called wealth so they can display the tax rate on the marker.

However, when the control marker is in the map zone, the layer doesn't change to reflect the map property.

Is something else needed?
User avatar
bugstomper
 
Posts: 28
Joined: July 7th, 2010, 4:56 am

Re: Having a Layer Property Follow Map Property

Postby DrNostromo » July 26th, 2010, 4:59 am

bugstomper wrote:I'm making a game where each of the map zones has a Global Property called wealth (numeric).

I have game markers to show which side controls the zone. The control markers have a Layer called tax, which I have set to follow the property called wealth so they can display the tax rate on the marker.

However, when the control marker is in the map zone, the layer doesn't change to reflect the map property.

Is something else needed?


You need to have a trigger of some kind to update the value. Try this...

Change the variable name on the layer to something like ZoneWealth.

Include a Dynamic Property trait on the control marker to set the variable ZoneWealth to equal the variable Wealth in the Named Zone $CurrentZone$. Set it to trigger on a key command.

Then set some way for this key command to trigger when the control marker in placed in the zone.

When the trigger is set off, the ZoneWealth will be updated to equal the Wealth of the Current Zone and the layer will display the new value.

I just did this off the top of my head without testing it but I think it should work.
User avatar
DrNostromo
 
Posts: 1064
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Re: Having a Layer Property Follow Map Property

Postby bugstomper » July 26th, 2010, 5:19 am

Thanks, Doc
User avatar
bugstomper
 
Posts: 28
Joined: July 7th, 2010, 4:56 am

Re: Having a Layer Property Follow Map Property

Postby bugstomper » July 27th, 2010, 1:32 am

None of the suggestions Dr. Nostromo suggested worked. It made no difference whether I made ZoneWealth a DP or a GP. It made no difference whether I made ZoneWealth = Wealth or $Wealth$. ZoneWealth read the variable $Wealth$ as text input.

However, I did discover the solution. Quite simple. Add a Text Label to the counter and put $Wealth$ in the Text box. My Control Counter instantly displays each zones GP of Wealth on the face of the counter.

Why can't we use numeric variables for setting the value of a DP or GP?
User avatar
bugstomper
 
Posts: 28
Joined: July 7th, 2010, 4:56 am

Re: [messages] [Module Design] Re: Having a Layer Property F

Postby tmccarron » July 27th, 2010, 1:47 am

That would be the "Is numeric" checkbox for those traits.


-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of bugstomper
Sent: Monday, July 26, 2010 8:33 PM
To: messages@vassalengine.org
Subject: [messages] [Module Design] Re: Having a Layer Property Follow Map
Property

None of the suggestions Dr. Nostromo suggested worked. It made no
difference whether I made ZoneWealth a DP or a GP. It made no
difference whether I made ZoneWealth = Wealth or $Wealth$. ZoneWealth
read the variable $Wealth$ as text input.

However, I did discover the solution. Quite simple. Add a Text Label
to the counter and put $Wealth$ in the Text box. My Control Counter
instantly displays each zones GP of Wealth on the face of the counter.

Why can't we use numeric variables for setting the value of a DP or GP?

_______________________________________________
Read this topic online here:
viewtopic.php?p=18867#p18867
I'm doing something Vassal related all the time
User avatar
tmccarron
 
Posts: 19
Joined: July 17th, 2010, 12:36 pm

Re: Having a Layer Property Follow Map Property

Postby bugstomper » July 27th, 2010, 1:53 am

The numeric box is checked in all instances.
User avatar
bugstomper
 
Posts: 28
Joined: July 7th, 2010, 4:56 am

Re: [messages] [Module Design] Re: Having a Layer Property F

Postby tmccarron » July 27th, 2010, 1:55 am

Has to be how it's set up then. Would have to see it to work out but the
Text Label is a good solution also

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of bugstomper
Sent: Monday, July 26, 2010 8:53 PM
To: messages@vassalengine.org
Subject: [messages] [Module Design] Re: Having a Layer Property Follow Map
Property

The numeric box is checked in all instances.

_______________________________________________
Read this topic online here:
viewtopic.php?p=18869#p18869
I'm doing something Vassal related all the time
User avatar
tmccarron
 
Posts: 19
Joined: July 17th, 2010, 12:36 pm

Re: Having a Layer Property Follow Map Property

Postby bugstomper » July 27th, 2010, 2:16 am

Setup -

In the mapboard section under multi-zoned grid I have a numeric GP named Wealth for each zone, and the value for Wealth is a number.

In the Game Piece Pallette, I have a marker named Control with a layer named Tax set to follow a property. I then tried setting a numeric DP named Tax to the value $Wealth$. When that didn't work I tried it with a numeric GP named Tax. I added a Global Hot Key to trigger the operation. I tried with the layer above and below the property setting.

When I triggered the hot key, I always got a message stating that the value of Tax was non-numeric; Tax = Wealth.
I got the same message when the DP/GP variable was entered as Wealth or $Wealth$.
User avatar
bugstomper
 
Posts: 28
Joined: July 7th, 2010, 4:56 am

Re: [messages] [Module Design] Re: Having a Layer Property F

Postby tmccarron » July 27th, 2010, 2:24 am

I really need to see it. It is difficult to troubleshoot descriptions. The
GP under the Map Zones doesn't sound right somehow though.

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of bugstomper
Sent: Monday, July 26, 2010 9:17 PM
To: messages@vassalengine.org
Subject: [messages] [Module Design] Re: Having a Layer Property Follow Map
Property

Setup -

In the mapboard section under multi-zoned grid I have a numeric GP named
Wealth for each zone, and the value for Wealth is a number.

In the Game Piece Pallette, I have a marker named Control with a layer
named Tax set to follow a property. I then tried setting a numeric DP
named Tax to the value $Wealth$. When that didn't work I tried it with
a numeric GP named Tax. I added a Global Hot Key to trigger the
operation. I tried with the layer above and below the property setting.

When I triggered the hot key, I always got a message stating that the
value of Tax was non-numeric; Tax = Wealth.
I got the same message when the DP/GP variable was entered as Wealth or
$Wealth$.

_______________________________________________
Read this topic online here:
viewtopic.php?p=18873#p18873
I'm doing something Vassal related all the time
User avatar
tmccarron
 
Posts: 19
Joined: July 17th, 2010, 12:36 pm

Re: Having a Layer Property Follow Map Property

Postby DrNostromo » July 27th, 2010, 3:50 am

One thing I should point out is that the Dynamic Property trait must reside above the Layer trait. I don't know why it works that way but it does. That may be the reason my original suggestion didn't work.
User avatar
DrNostromo
 
Posts: 1064
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Re: Having a Layer Property Follow Map Property

Postby bugstomper » July 27th, 2010, 9:48 am

I tried the DP in both positions, above the Layer and below it.
User avatar
bugstomper
 
Posts: 28
Joined: July 7th, 2010, 4:56 am

Re: Having a Layer Property Follow Map Property

Postby bugstomper » July 27th, 2010, 10:23 am

What's the best way to let you see it.
User avatar
bugstomper
 
Posts: 28
Joined: July 7th, 2010, 4:56 am

Re: [messages] [Module Design] Re: Having a Layer Property F

Postby tmccarron » July 27th, 2010, 10:45 am

You can email me the module if its less than 10mb or host it somewhere on a
file sharing site like www.mediafire.com and send a d/l link

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of bugstomper
Sent: Tuesday, July 27, 2010 5:24 AM
To: messages@vassalengine.org
Subject: [messages] [Module Design] Re: Having a Layer Property Follow Map
Property

What's the best way to let you see it.

_______________________________________________
Read this topic online here:
viewtopic.php?p=18878#p18878
I'm doing something Vassal related all the time
User avatar
tmccarron
 
Posts: 19
Joined: July 17th, 2010, 12:36 pm

Re: Having a Layer Property Follow Map Property

Postby bugstomper » July 28th, 2010, 2:23 am

OK. I got the variables working within the Layer and following the $Wealth$ property. It doesn't seem that I did anything different. I am able to either increment or set values directly using the variable property name. Perhaps it had to do with case sensitive property names that I had wrong by mistake.

Now I have to work thru how to make each Control counter actually update from the wealth property for the zone they are located in. They presently use the $Wealth$ property from the zone where the last counter was selected.

Thanks for the encouragement to keep me plugging away 'til I got it. This is so like writing computer programs, only harder.
User avatar
bugstomper
 
Posts: 28
Joined: July 7th, 2010, 4:56 am

Re: [messages] [Module Design] Re: Having a Layer Property F

Postby tmccarron » July 28th, 2010, 2:34 am

Properties are case/type sensitive.

Continuing your problem, sounds like you will need to use trigger sets
differentiated by the CurrentZone property in the PME field to update
accordingly

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of bugstomper
Sent: Tuesday, July 27, 2010 9:23 PM
To: messages@vassalengine.org
Subject: [messages] [Module Design] Re: Having a Layer Property Follow
MapProperty

OK. I got the variables working within the Layer and following the
$Wealth$ property. It doesn't seem that I did anything different. I am
able to either increment or set values directly using the variable
property name. Perhaps it had to do with case sensitive property names
that I had wrong by mistake.

Now I have to work thru how to make each Control counter actually update
from the wealth property for the zone they are located in. They
presently use the $Wealth$ property from the zone where the last counter
was selected.

Thanks for the encouragement to keep me plugging away 'til I got it.
This is so like writing computer programs, only harder.

_______________________________________________
Read this topic online here:
viewtopic.php?p=18910#p18910
I'm doing something Vassal related all the time
User avatar
tmccarron
 
Posts: 19
Joined: July 17th, 2010, 12:36 pm

Next

Return to Module Design

Who is online

Users browsing this forum: No registered users and 7 guests