[messages] [Module Design] Player name associated with player side

capi3101 capi3101a at netscape.net
Tue Sep 10 11:24:09 MST 2013


Figured out what was wrong with my mod...makes a hell of a difference
when you're wanting to display the value of a Global Property if you've
actually put that bit in correctly...

Okay, so here's what I did:
1) At the module level, I set up three Global Properties, P01, P02 and
P03. I set their values to " " and made sure they were non-numeric.
2) I set up three Global Key Commands at the module level with the names
"I am P1", "I am P2" and "I am P3". These would send the hotkey CTRL-1,
CTRL-2 and CTRL-3 respectively.
3) I added a Toolbar Menu called "Player Select", which includes I am
P1, I am P2 and I am P3; this is why they don't show up directly on the
menu toolbars.
4) I added an At-Start Stack on the main board and added a Single Piece
to it, Msg - here are its traits:
a) Basic Piece: just calls it Msg, no image tiles involved.
b) Does not Stack: Allows it to be selected normally but not moved. Not
sure if it would work if you set it to not select; you might give that a
try.
c) Text Label: The text label in place is <html>P01: $P01$<br/>P02:
$P02$<br/>P03: $P03$<br/>$PlayerId$</html>. The last PlayerId was there
for testing purposes; you can remove that in the final version.
d) Set Global Property - I have three of these, one for each of the
three Global Properties involved. When they are invoked, they set the
value of one of the Global Properties to PlayerId. Now here's the key -
they're activated on ALT-1, ALT-2 and ALT-3.
e) Trigger Action - again, there are three of these. Each one sits and
watches for a specific hotkey combination (CTRL-1, CTRL-2, and CTRL-3)
and triggers ALT-1, ALT-2 or ALT-3 (i.e. these are the triggers for the
Set Global Property traits). These are set up as filters - first, to
make sure that no one has already claimed that particular player spot,
and secondly to make sure that a player does not select more than one
spot for themselves.

So, let's say I'm playing a game with the name "Fubar". I open up the
module and want to play as P02. I go and select "I am P2" under the
Player Section menu button. I am P2 sends out the Global Key Command
CTRL-2, which my Msg piece picks up. CTRL-2 is one of the hotkey
sequences it's watching, so it checks its trigger filters and sees that
P02 is currently empty and Fubar has selected no other player positions,
so it sends the ALT-2 hotkey sequence, which is then picked up by the
Set Global Property command - P02 is then set to "Fubar", which the Text
Label will then automatically display.

Right now, there is no provision in this design for a player to switch
player number if they need to, but that can be added easily by
additional action triggers and Set Global Property commands.

I've gone ahead and attached my text mod for your examination. Hopefully
it'll better illustrate anything I haven't been clear about. And
hopefully it's of some use to you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: player_name_test.zip
Type: application/x-zip-compressed
Size: 2597 bytes
Desc: Display Player Name example
URL: <http://www.vassalengine.org/pipermail/messages/attachments/20130910/d6dc2873/attachment.bin>
-------------- next part --------------

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


More information about the messages mailing list