I’m working on my first vassal mod and having some problems with deleting all my fired markers placed on units at the end of the turn. I have nested menu of 9 distinct counters for fire - primary fire, secondary fire, fire complete etc. I want to be able to delete all these markers without having to go and delete them one at a time. For some reason the keystrokes aren’t functioning when I place them but I can do it with the mouse and the nested menus 3 submenus returning 3 fire options each work fine.
I’ve set the type of marker to fire using the type=fire trait. I’m not sure where I should be setting up the trigger action to delete the markers which I assume is what the Global key command needs to call. I think that the fact that the key shortcuts for placing the counters isn’t functioning is one reason why I can’t get the global key command to work. The key shortcuts for each of the fire markers are different.
All I want to do is make the fire counters disappear. Does anyone have any idea how to do this? I know that layers can be used but I have 9 separate distinct counters that I want selectable from nested menus so I don’t think layers will work.
All the pieces you wish to delete should be given a Delete trait that is bound to the same keystroke. Leave the menu text of this trait blank so it isn’t exposed to the user. I recommend using named keystrokes for this.
If you want to accept the default settings for the Delete trait (Ctrl-D with menu text “Delete”) on these pieces, and there are other pieces using Ctrl-D that you don’t want deleted by your end of turn cleanup, put a Marker trait on all the pieces to be deleted. Give the Marker trait a property name and value pair–e.g., “EndOfTurnDelete” with a value of “Y”. This way you can identify these specific pieces in the property match expression of your Global Key Command so you don’t indiscriminately apply Ctrl-D to everything. The expression would be: “EndOfTurnDelete = Y”.
You don’t need to use the Trigger trait at all for this functionality.
I’ll try that and let you know how it goes. I’m a little stumped that the keyboard shortcuts for placing the fire markers on the counters don’t appear to be working.
Yes I did have the piece selected when I wasn’t able to get the keystroke working. Somewhat surprisingly I also wasn’t able to get a keystroke to function for something else that I’m pretty sure was functioning before (a different counter). I’m at work now so I’ll try later on your suggestion and see whether I can figure out what is going on with the keystroke by examining another module I based this one on.
Unfortunately I still can’t get the delete fired markers button to work. Nothing at all seems to happen. I’ve got some links to screenshots where you can see the unit with the fired primary marker, then the traits of the marker, and finally the global key command that I was hoping would delete the fired counters. Not sure what I’m doing wrong but I tried adding the name and value trait to the marker and then deleting on that value in the global key command.
Here’s a link to the marker traits and the global key command.
Remove the Ctrl-D from the Hotkey portion of the Global Key Command–you don’t want that filled in (and even if you do, it shouldn’t be the same keystroke as the top portion).
Unfortunately I can’t comment further unless I can see the properties of the Delete trait, or if you can tell me what keystroke it’s set to use. I assume it’s Ctrl-D, but maybe not.
Try using the Snipping Tool, which is built into Windows–it’s a lot easier than capturing your entire screen.
No joy with deleting the hotkey - still has no effect on the fired counter. Frustrating as I think it might be something relatively simple but no idea what that might be.
Hard for me to say at this point. Are you sure you aren’t using Ctrl-D as a keystroke on any other trait bound to these pieces? Failing that, I can almost certainly diagnose it if you are able to post the module somehow (e.g., Dropbox). Even uploading it to this site’s wiki would work.
Tried pretty much everything, including creating another marker and using trigger actions and delete command. Wasn’t able to get anything to work and ended up having a global key for the replacements map showing up on my German units. No idea how that happened but fortunately I had a backup of the mod so just deleted the screwed up version and went back to the backup. Bit worrying how easy it is to have menu items appear like that on counters. Yikes!
One solution I found is to give both the key command for the Global and the key command for the DELETE for Fire Pri something obscure that nothing else uses. Remove entirely the marker Firedturn=Y from both the Global and the FiredPri marker (it is no longer needed).
I tested it and this did remove the Fire Primary marker.
Just make to pick a Key command that nothing else uses and you are all set…
Did manage it finally for the fire pri counter but tried it with fired comp and it isnt working. So at least Ive got one fired counter type deleting but not the second or subsequent types. I`ll try again tomorrow.
So I setup the Firepri fired counter to delete on the global key command ctrl d and it works. I setup the firedcomp marker precisely the same way and it doesn’t work. Is there a bug in vassal that is preventing the two types of fired counters from deleting on the ctrl d command? They’re both defined as fired prototypes so I cannot understand why one deletes and the other doesn’t. I’ve tried a number of different key stroke activations for the firedcomp marker and it still fails to delete.
I’d love to automate the deletion of the fired markers but what the heck in vassal is preventing me from doing this?
Description - Fired
Key Command - CNTRL D
apply to all counters on this map only checked
Suppress individual reports checked.
It looks to me like all the fired counters of the Fired prototype should be deleted but it’s only happening with the Fired Primary counters and not with the Fired Complete counters. No idea why both are responding differently when the traits are setup the same. By the way when I right click on the counter and delete the firepri there is no short cut keyboard listed on the menu but when I do the same for the fired complete I get the options for the general markrer - delete and clone.
Is it the order that I’m building the mod? Should I create the counter in the counter palette and then put the selection sub menu followed by the place marker command? should I create the fired counter prototype first? I’m about ready to abandon the idea of automating and just going with dragging counters out of the selection box. For some reason after trying to get Firedcomp to delete properly it’s now showing up outside the fired menu option. just no end of frustration with this!
Ok think I’ve figured it out. For some reason I just had to retype delete cntrl d in the marker trait even when it was already there. That must force an update that otherwise doesn’t happen. That was pretty tricky. I’ve got 4 counters working properly now!
As a general rule, I would strongly discourage using Shift- keystrokes for anything. These can sometimes be triggered accidentally by messages players type in the chat window.