Create account / Log in

Message trait - Macro for Piece to Piece communication

Suggestions for additional features for the module editor and Vassal engine.

Moderators: uckelman, Tim M

Message trait - Macro for Piece to Piece communication

Postby dcholtx » September 26th, 2010, 11:10 am

When I want to send information from one piece to another, it would be nice to have a way to modify 2 pieces at once. This is a function I use over and over again. It would be nice to have a "message" editor. (I already use prototypes, one in the source piece and one in the destination piece.)

Consider:
A "source" piece with 3 properties or dynamic properties - parameter1, parameter2, parameter3
3 global variables
A destination piece with corresponding DPs.

To transfer information the source piece has 3 set global variable traits, all triggered by the same key command.
It also has a global key command (with trait order important) that the destination piece will catch, but triggered in the source piece by the same key command that sets the global variables.

The destination piece would have 3 DP's each triggered tby the global key command. The DP's catch the global key command and take the value from the global variable to set the value of the DP.

The interface would contain inputs for:
trigger command/menu item
select destination piece (like replacement now does)
a list add (like DP's settings or Layer images - a NEW button)
Four inputs in each row of the list: Source property, global property, location of the global property(map,module), Destination DP.

A "Message" trait would be added to a source piece, so it would known which piece was the source. (It should also be able to determine the property list of the source piece, so the items in column one of the list could be a selection also.) If the global variable in columns 2 & 3 already exists, then the piece should use that global variable. If not, it should create it automatically. The global variable would be set to value of the property in column 1 of the list. The source piece will also have a global key command added. (I think Vassal 3.2 has named key commands, so reserving a few of these for this macro should not be difficult.)

In the destination piece:
The destination DP, if it does not exist should be create:
A new command added to the DP to set it to the global variable from columns 2 & 3.
dcholtx
 
Posts: 59
Joined: January 11th, 2008, 2:29 pm
Location: North Carolina, USA

Re: Message trait - Macro for Piece to Piece communication

Postby uckelman » May 25th, 2012, 1:19 am

Thus spake dcholtx:
> When I want to send information from one piece to another, it would be
> nice to have a way to modify 2 pieces at once. This is a function I use
> over and over again. It would be nice to have a "message" editor. (I
> already use prototypes, one in the source piece and one in the
> destination piece.)
>
> Consider:
> A "source" piece with 3 properties or dynamic properties - parameter1,
> parameter2, parameter3
> 3 global variables
> A destination piece with corresponding DPs.
>
> To transfer information the source piece has 3 set global variable
> traits, all triggered by the same key command.
> It also has a global key command (with trait order important) that the
> destination piece will catch, but triggered in the source piece by the
> same key command that sets the global variables.
>
> The destination piece would have 3 DP's each triggered tby the global
> key command. The DP's catch the global key command and take the value
> from the global variable to set the value of the DP.
>
> The interface would contain inputs for:
> trigger command/menu item
> select destination piece (like replacement now does)
> a list add (like DP's settings or Layer images - a NEW button)
> Four inputs in each row of the list: Source property, global property,
> location of the global property(map,module), Destination DP.
>
> A "Message" trait would be added to a source piece, so it would known
> which piece was the source. (It should also be able to determine the
> property list of the source piece, so the items in column one of the
> list could be a selection also.) If the global variable in columns 2 & 3
> already exists, then the piece should use that global variable. If not,
> it should create it automatically. The global variable would be set to
> value of the property in column 1 of the list. The source piece will
> also have a global key command added. (I think Vassal 3.2 has named key
> commands, so reserving a few of these for this macro should not be
> difficult.)
>
> In the destination piece:
> The destination DP, if it does not exist should be create:
> A new command added to the DP to set it to the global variable from
> columns 2 & 3.
>

This is something which should be easy to do with scripting in VASSAL 4.
It might be a little while, but stay tuned.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8961
Joined: December 10th, 2007, 9:48 am
Location: Durham, England


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 2 guests

cron