[messages] Edit: [Module Design] Re: Report Action problem

JustaBill martinson2005 at netscape.net
Tue Nov 15 17:52:06 MST 2011


[This message has been edited.]

The problem is that no single piece will really know the names of both
pieces.  The old piece knows its name, and the new piece knows its name.
 This means you're probably going to need _both_ pieces to contribute
some effort to the goal, by giving your first piece's Replace with Other
trait a __Keystroke to Apply After Placement__ attribute so it can tell
the second piece to finish the job.

I can think of two solutions that don't involve hardcoding:

  1. Have the old piece report the first half of the message, and the
new piece report the second half.  This means your report will take two
lines in the chat window.  Something like this:


Player (Side) flipped __Roman PC__ to ...
... __Carthaginian PC__ in location.


  2. Have the old piece save its name to a generic, re-usable Global
Property, then have the new piece deliver the entire message and use the
GP to fill in the old piece's name.  This will require the first piece
to use a Trigger which first generates the keystroke to load the GP and
then generates the keystroke to perform the Replace with Other.  The
Replace with Other trait's __Keystroke to Apply After Placement__ would
cause the second piece to deliver the report, in which the Global
Property provides the old piece's name and the new piece provides its
own name.



_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=27332#p27332


More information about the messages mailing list