Create account / Log in

Removing all of a certain marker from the map

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

Removing all of a certain marker from the map

Postby kbernatz » May 20th, 2017, 11:46 am

Hi all,

Still relatively new to Vassal design, though I have a few modules here and can handle the basics of counters,cards, etc. However, for some reason, the entire procedure for global traits and having actions occur due to key commands is eluding my poor, befuddled mind :(.

I have a new development project where all counters are marked with DONE markers after being used in a turn. It would be totally awesome to be able to have a global key stroke to delete these DONE markers, but I am completely baffled on how/what needs to be done. #sigh#

What I have is the following:
1) pieces that are to be affected are given a prototype of, for example, Ger_vehicle
2) in Ger_vehicle, I have the Place Marker command to place a DONE marker using Cntl-A
3) In Ger_vehicle, I have the delete trait using default of Cntl-D
4) the DONE marker (and currently all markers) have the prototype of "Marker"

I get that I will need to make sure any trait is not in the 'Marker' prototype, or all markers will be delete upon the key press. Lets say I want the key press to be Cntl-R.
I get that the trait that needs to be assigned needs to go in the Done marker piece.
What I don't get is what syntax and what trait must be used for all Done markers to be deleted when I press Cntl-R.

Any help would be appreciated...thanks!

-Kevin Bernatz
Doc Beernutz Development (currently developing wargame projects for GMT and Compass Games)
kbernatz
 
Posts: 2
Joined: March 19th, 2016, 12:45 am

Re: Removing all of a certain marker from the map

Postby DrNostromo » May 20th, 2017, 2:52 pm

In your Marker prototype, include the trait

Marker - PieceType = DONE

Also include a delete command that will activate on Shift-R

On your button, include a Global Key Command with the following:

Menu command = Delete DONE Markers
Keyboard command - Ctrl-R
Global Key command - Shift-R
Mathching Properties - CurrentMap = <map name> && PieceType = DONE
Apply to all pieces

Now when you click the button, it will send a Shift-R to all pieces on the map named as CurrentMap and all pieces with the marker PieceType = DONE.
User avatar
DrNostromo
 
Posts: 987
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Re: Removing all of a certain marker from the map

Postby kbernatz » May 20th, 2017, 3:56 pm

Hi DrN,

So for the traits added to the Marker prototype, it goes as follows

add the trait 'Marker'
Property Name = PieceType
Property Value = DONE
add the trait 'Delete'
Keyboard Command = 'Shift-R'

For the button, I use "Add Global Key Command"
Description being "Delete DONE markers"
key command being 'Shift-R'
Matching Properties being exactly the text you entered above: "CurrentMap = <map name> && PieceType = DONE"
Within a Deck being 'Apply to all pieces'
Button text = DONE (or anything descriptive); same for Tooltip text
Hotkey = Ctrl-R

So when the button is pressed (or anyone presses Ctrl-R), all of the DONE markers are deleted. This is what happens..so awesome! Thank you VERY much!

-K
kbernatz
 
Posts: 2
Joined: March 19th, 2016, 12:45 am

Re: Removing all of a certain marker from the map

Postby stevecq » September 16th, 2018, 8:53 pm

Having trouble getting this to work.

Game piece definition
MoveFire
Traits
Delete
Command: Shift R
Clone
Marker
Property Name: PieceType
Property Value: Fire

Global Key Command
Key Comand: Shift R
Match Proerty: CurrentMap = <map name> && PieceType = DONE
Check : Apply to counter on this map only
Witin a deck, Apply to : all pieces
Hotkey: Ctrl R

Qusetion is "<map name> a fixed variable?

In my module you can choose 1 of 2 maps.

Main map: Main Map

Thanks
stevecq
 
Posts: 26
Joined: December 25th, 2007, 5:36 pm

Re: Removing all of a certain marker from the map

Postby stevecq » September 17th, 2018, 12:46 am

Figured it out. Thanks for looking!
stevecq
 
Posts: 26
Joined: December 25th, 2007, 5:36 pm


Return to Module Design

Who is online

Users browsing this forum: No registered users and 1 guest