dynamic property initialization - diff values for pieces

I would like to take copies of the same set of piece traits defined in a prototype and use them for a number of pieces in a piece palette. BUT… I would like to be able to set the initial value of dynamic properties assigned to the pieces so they are different from one another, without actually creating any difference within the common piece definition.

For instance, if I use a marker trait in the single piece definition, and configure the marker to set a value of a dynamic property defined in the common prototype… what happens? Does it override the initialized value of the dynamic property and set it to the value for that piece that I want? Or does it create its own new property value with the same name really messing things up? Or does the initialize value of the dynamic property definition come along and overwrite the value set by the marker anyhow?

I guess one answer would be to try it, and I will. But curious what the underlying reason is for the behavior I might see.

“Common Piece Traits” Prototype Defintion:

  1. Dynamic Property Definition “Test Property” numeric with initializer to 0.
  2. Text Label showing $Test Property$

In the Piece Palette…
Single Piece Definition “A”:

  1. Empty Basic Piece “A”.
  2. “Common Piece Traits” Prototype.
  3. Marker “Test Property” = 1.
    Single Piece Definition “B”:
  4. Empty Basic Piece “B”.
  5. “Common Piece Traits” Prototype.
  6. Marker “Test Property” = 2.

When I load the module what do I see in the piece tray? Two units A and B with Test Property of 0, or one with Test Property 1 and the other with Test Property 2? Or is the Test Property now completely flummoxed with unpredictable results? And I guess another question just in case is… does this change when the piece is dragged onto the map?

looks like it works in one sense… the marker value effectively seems to override the DP definition for just that piece.

however when I hit the key to modify the dp value it tracks and modifies the dp value but has no bearing on the value displayed by the label, or reported in the reports for the piece. those are determined instead by the fixed value of the marker.

so the marker is not a dynamic trait, which is I suppose what the difference is between a marker and a dynamic property.

what happens then if I remove the dp altogether for the items I want essentially fixed once the scenario design is done, just using a marker trait with a list of property key-value pairs? it means I am forcing the scenario design to happen in the module editor. that might be okay in terms of the benefit however. BUT… can I do that or will the system somehow break down and complain that there is no property value defintion at a low enough level? will test.

or… keep the dp’s but remove the dp key commands to change them (and triggers up the line). then they are there to be reference but their values are set by the marker trait for the particular piece instead of by the scenario designer entering a command.

of course, for properties that are meant to be changed during play I would not be using a marker at all.

I’m trying to do a similar thing.

I have 3 units
Ground
Air
Water
All units are based off the same prototype layout, generally only the image is different from one to the next.

I would like to make it so that the first ground unit I drag to the map has a “1” in the top left corner. The second has a “2” etc.
Then the first air unit would again be “1” the second “2”, etc.

Can someone tell me the steps to create this text?

Thanks

Briefly to get you going:

You will need a Global Property for each of Ground, Air, Water that tracks the unit number you are up to. Lets Call the Global_Air, Global_Water, Global_Ground.

Each unit will need a Dynamic Property (say called UnitNumber) that is used to hold the individual Unit Number for this unit.

Display the Unit Number by creating a Text Label whose value is $UnitNumber$

Now, whenever a counter is first placed onto a Map, you need to use Triggers to do the following (say for an Air unit):

  • Increment the appropriate Global_Air variable (Set Global Property trait)
  • Set the local UnitNumber variable to the value of Global_Air (Dynamic Property trait)

You can initiate this using the ‘Apply key after move’ option on the Map component.

B.


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

Post generated using Mail2Forum (mail2forum.com)

You had me up until here. I’ll have to read up on triggers and the apple key option thing.

thanks for your help

You need to read up on two counter traits:

  • Dynamic Property - that maintains a modifiable counter attached to a counter. You cn add commands that allow you to set the Dynamic Property to the value of a Global Property.

  • Set Global Property - that allows a counter to change a Global Property

Regards,
B.


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

Post generated using Mail2Forum (mail2forum.com)

Forgive my being a totally useless newbie, but I can’t for the life of me figure out how to trigger an action when a new piece is dragged to the map.

can anyone help me?

First, add the action to each of the pieces you want to trigger the action for. Make sure you’ve defined a hotkey for the action.

In the editor, click on the map window you want to do the triggering on. Pick Properties.

Down at the bottom, there’s a box that says something like “Perform this action for all units ending movement on this map.” Put the hotkey for the action in here.

Now, when you drag these pieces to the map, it’ll be like you clicked the hotkey on each piece.

Ahhh, I was looking in the wrong place. I was trying to add a key command, then modify it’s properties to apply to each piece entering map.

three questions then:

  1. will this effect happen each time the piece moves on the map? Because technically its ending each turn on the map.

  2. Does every trigger require a key assignment? because eventually wouldn’t one run out of keys in a complex game?

  3. if I were to add this to the box as you say, then want to perform a second command each time a new piece enters the map, do I separate them by commas, semicolons???

Thanks again for your help

  1. Yes, unless you put in a mechanism to prevent that, such as setting a DP on the piece

  2. Yes, but unlikely to run out, and will be a non issue in 3.2 as the number of potential keys will increase dramatically by using named keys

  3. ??

From: Shalbatana messages@forums.vassalengine.org
To: messages@forums.vassalengine.org
Sent: Mon, November 9, 2009 3:36:51 PM
Subject: [Module Design]Re: dynamic property initialization - diff values for pieces

Ahhh, I was looking in the wrong place. I was trying to add a key command, then modify it’s properties to apply to each piece entering map.

three questions then:

  1. will this effect happen each time the piece moves on the map? Because technically its ending each turn on the map.

  2. Does every trigger require a key assignment? because eventually wouldn’t one run out of keys in a complex game?

  3. if I were to add this to the box as you say, then want to perform a second command each time a new piece enters the map, do I separate them by commas, semicolons???

Thanks again for your help


“There’s no time like the future.”


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

Post generated using Mail2Forum (mail2forum.com)

I think the answer to #3 is that if you want multiple actions to take place, you would add a Trigger trait to the piece, which lets you combine multiple actions into a single keystroke. Then the hotkey you put in the Map Properties box would invoke the Trigger action.

Thanks everyone. I’ll see how far I get with all the new info.