Create account / Log in

How do I get a HOTKEY to trigger a counter?

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

How do I get a HOTKEY to trigger a counter?

Postby starfish » March 6th, 2015, 4:04 pm

I am trying to understand how to use a Action Button to trigger action for a specific counter. When I add the button, I have the option to send a Hotkey, and chose "CTRL R" as the action to send. I know this is being sent as I also have a die (Add Dice Button) and when I have this triggered by CTRL R, the die rolls. Great. But what I want to do, is have a counter on my map called "Rolls Remaining" to "run". By run, I mean I want the TRIGGER command (currently set to CTRL R) to trip and it to do its thing, one of which is to set the global property of the value Rolls_Left to -1.

I am thinking that the issue is that the counter is not "SELECTED" and thus is not getting the CTRL R. If I hit CTRL R on my keyboard, nothing happens.

I know that I can get this to work by building a "ROLL" counter and putting it on the map, but I kinda was hoping to do this via the menu bar.
starfish
 
Posts: 26
Joined: April 13th, 2013, 6:25 pm

Re: How do I get a HOTKEY to trigger a counter?

Postby Tim M » March 6th, 2015, 5:41 pm

Instead of trying to make your "Rolls remaining" counter to run why dont you just add a Change Property directly to the Global property that fires on the CTRL R hotkey (note the Change Property function has a hotkey field) reducing it by one directly. Your "Rolls Remaining" counter should be displaying the value of the Global property only is all it needs to do
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: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: How do I get a HOTKEY to trigger a counter?

Postby starfish » March 9th, 2015, 2:55 pm

Hmmmm. Had not thought of that. Sounds like a better plan. Thanks!
starfish
 
Posts: 26
Joined: April 13th, 2013, 6:25 pm


Return to Module Design

Who is online

Users browsing this forum: No registered users and 1 guest