Custom classes

OK, since the lockability seems to be taken care of, I still have one other class I’d like to put together to be able to have a card added/removed to/from a deck based on a selection in preferences (check-box). So, I ask again, does anyone know a good place to learn about these classes and how to make them, or where I can find the source to one that already exists (are there some in the svn source?) so that I can start the process of making my own? Thanks.

You shouldn’t need a custom class to do this.
If you have built your deck pieces properly, i.e use markers, you can use
properties/filters with GKC’s to affect the going on’s of a deck as well as
various other features such as Deck GKC’s, Deck property filters and so on.

The base engine has some very powerful features when you start linking the
traits together interactively with each other. Just need to use a little
imagination/experimentation to figure out what works for what you need to
do.

Your preferewnce/check box could be a At start stack with an action button
than turns on/off the check mark(layer - 2 levels). It in turns begins a
routine to do “whatever” via a trigger/gkc, such as return something to deck
or draw from deck based on property filters you specify

That should give you an idea of what you can do by linking things. The
reference manual explains the traits in more detail to help you put together
what you need

Post generated using Mail2Forum (mail2forum.com)

Where do I find more information on this “filters” idea you put out there? I can’t find anything like it in any of the context menus or in the reference manual. And also, wouldn’t the filter work by reading Markers on the cards? If that’s the case, is it OK, even though I get an error about it, to mark each card from a certain expansion as the same thing?

I’m still not seeing how using the current functions would be easier than writing my own class(es) for these things. There are just some functions that would be best served as their own thing.

you may want to look at the Clash of Monarchs module from the GMT website.
it has a feature where you can select certain cards to draw from the deck by card number, or you can draw X number of cards at once.

that is not exactly what you want but might be something close to what you are looking for… close enough to give you an example to work from.

For the previous Q about filters.

Filters is just short for Property filters which you can apply to traits that use them

Properties come in 2 types:

System Inherited and User defined.

The system inherited properties can be found in the ref manual. These include engine defined variables such as CurrentMap, LocationName, ObscuredToOthers, Selected, PlayerSide etc…

User defined properties are those which you would create and add to the module using either the Marker, Properties, or Dynamic Property trait or by adding Global Properties in the module tree

When you use the filters in triggers or GKC’s the property match expression (PME) used is “variable name = value”

as an example if you wanted to check that a card be deleted with a trigger if it is located on the main map you might use the PME : CurrentMap = Main Map

PME’s can be further extended using basic operators such as && (and), || (or), > (greater than) etc…

This allows you to build more complex PME filters such as :

CurrentMap = Main Map && Card = blue && ObscuredToOthers = true || CurrentMap != Main Map && ObscuredToOthers = false

This PME is 2 part because of the || (or) operator. In order for the piece to pass the PME it must meet the criteria of either:

a) is on the Main Map, designated as a card with the value blue and masked from other players(unrevealed)

b) It is not on the Main Map and is revealed for all to see

— On Tue, 11/11/08, IrishBouzouki messages@forums.vassalengine.org wrote:

Post generated using Mail2Forum (mail2forum.com)

I suspect you don’t need to write a custom class to do what you want, but just to answer your question:

The only documentation on how to write custom components is the online tutorial at http://www.vassalengine.org/wiki/doku.php?id=programming You can look at the source for any of the existing GamePiece traits at http://vassalengine.svn.sourceforge.net/viewvc/vassalengine/VASSAL-src/trunk/src/VASSAL/counters/

rk

Post generated using Mail2Forum (mail2forum.com)

What is exposed when a card is drug off the deck? I would like cards marked with a marker to automatically flip/revealed but with a trigger to do this it needs to listen for a keystroke in order to check the card for the marker. Well when you pull a card you do it with the mouse not a key.

Edit: i figured that since they will be drawing face down i would just trigger it off the peek command so …

All pieces/cards will respond to a key trigger when they are moved on a board. Go to the Map properties and set a trigger for movement to/within this map.

  • M.

2008/12/23 JMOxx75 <messages@forums.vassalengine.org (messages@forums.vassalengine.org)>

Post generated using Mail2Forum (mail2forum.com)

Why do you assume to pull a card you must use the mouse? You could have action buttons to draw the cards to their specific spot, or setup a automated dealer etc… regardless the trick you are specifically looking for is described in the How To section of the vassal wiki

From: JMOxx75 messages@forums.vassalengine.org
To: messages@forums.vassalengine.org
Sent: Tuesday, December 23, 2008 5:23:35 PM
Subject: [Module Design]Re: Custom classes

What is exposed when a card is drug off the deck? I would like cards marked with a marker to automatically flip/revealed but with a trigger to do this it needs to listen for a keystroke in order to check the card for the marker. Well when you pull a card you do it with the mouse not a key.


Messages mailing list
Messages@forums.vassalengine.org (Messages@forums.vassalengine.org)
http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org

Post generated using Mail2Forum (mail2forum.com)