Create account / Log in

Enchance Obscurable to allow masked at start

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

Moderators: uckelman, Tim M

Enchance Obscurable to allow masked at start

Postby morvael » January 9th, 2010, 5:14 pm

I have made an experiment by editing the build file and altering state information that normally is not accessible and managed to get pieces with Mask trait to become masked at the moment of creation.

Simply, if the Ed (Editor) for Obscurable would let configure what it returns in it's getState method (line 693) instead of always returning "null", then a piece could be created masked at start.

It's a very simple change.

The downside is that pieces are drawn masked in Game Piece Palette but I don't think it's a problem.

Alternatively please add Map Window option that all pieces created in this map are created masked by the creating player, this should also be simple although I don't know where to implement that change.
User avatar
morvael
 
Posts: 84
Joined: July 22nd, 2008, 7:50 pm
Location: Otwock, Poland

Enchance Obscurable to allow masked at start

Postby Tim M » January 9th, 2010, 6:22 pm

Your alternative idea might clash if the map option is on but a piece has a
trigger to reveal when drawn/moved to the map - something wont work as
intended thus making your first idea the better option imo unless your going
to make exceptions for specific cases

Post generated using Mail2Forum (http://www.mail2forum.com)
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1816
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Postby morvael » January 9th, 2010, 6:39 pm

I would assume the map option in the second case would be off by default and not conflicting with existing modules, while new module designer would choose either method and it would work.

I'm for the first option too, except it would be good to see the piece unmasked in game piece palette - actually it's name in the palette list is not masked, only the image is :)
User avatar
morvael
 
Posts: 84
Joined: July 22nd, 2008, 7:50 pm
Location: Otwock, Poland

Enchance Obscurable to allow masked at start

Postby Tim M » January 9th, 2010, 7:24 pm

After a little playing around, it can be done already although it is not an
obvious how to do it - have pieces mask upon creation and keep unmasked in
piece palette. Just tested and works perfect.

If your doing a lot of pieces it is probably best to proto this method.

1. Add the mask to the piece, piece is not masked at this time in palette
which reveals on KEY A (whatever)

2. Add a restrict command trait that restricts (hide option) the mask key
(KEY A) and add filters CurrentMap != WhateverMapItCanMaskOn

3. In WhateverMapItCanMaskOn map dialog window add Key command to apply all
units ending movement on map KEY B

Add an executor and controller:

4. Add passive trigger to piece KEY B executes KEY C then KEY A with filter
InitialPlacement = true

5. Add a DP to piece named InitialPlacement with initial value set to true
and give it KEY C to set value to false

All done.

This is a onetime use routine for placement of pieces that are unmasked in
Palette and are automatically masked upon placement on map. We insure this
by using the on/off type DP switch combined with the trigger PME failing the
check on any subsequent movement by the piece but still have access to the
mask should you need it on the map from then on

Post generated using Mail2Forum (http://www.mail2forum.com)
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1816
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Postby morvael » January 9th, 2010, 7:31 pm

Great combo, will test it soon. Thanks!

On the other hand I prefer methods that are easier to understand and don't require many traits to construct, so you may consider enchancing the Obscurable trait.
User avatar
morvael
 
Posts: 84
Joined: July 22nd, 2008, 7:50 pm
Location: Otwock, Poland

Enchance Obscurable to allow masked at start

Postby Brent Easton » January 9th, 2010, 11:59 pm

Dominik,

Could you please explain to me the utility of having pieces drawn from the Game Palette automatically become masked?

In my modules, I try and avoid having players draw pieces from the Game Palette at all once a game is in progress. I am interested in what you are doing that requires this behavior.

Rgds,
Brent.

*********** REPLY SEPARATOR ***********

On 9/01/2010 at 9:14 AM morvael wrote:

I have made an experiment by editing the build file and altering state
information that normally is not accessible and managed to get pieces with
Mask trait to become masked at the moment of creation.

Simply, if the Ed (Editor) for Obscurable would let configure what it
returns in it's getState method (line 693) instead of always returning
"null", then a piece could be created masked at start.

It's a very simple change.

The downside is that pieces are drawn masked in Game Piece Palette but I
don't think it's a problem.

Alternatively please add Map Window option that all pieces created in this
map are created masked by the creating player, this should also be simple
although I don't know where to implement that change.





_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
Brent Easton
 
Posts: 3198
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Postby morvael » January 10th, 2010, 8:45 am

This feature would be great in a module where players need to secretly select a battle type by placing a chit on the map to be later revealed and deleted when the battle is over. I thought it would be easier for them to create it each time from palette and delete afterwards instead of having two chits in private window and dragging it back and forth and looking for it each time. Also there may be cases where there is more than one battle to be decided in the same time and more chits would be needed. The way using palette is great except that without masked at start the players would have more steps to do. first drawing the chit from palette to private window, then masking it and then dragging to the map. I thought this could be shortened by 2/3.
User avatar
morvael
 
Posts: 84
Joined: July 22nd, 2008, 7:50 pm
Location: Otwock, Poland


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 2 guests