Create account / Log in

Place marker before send to location

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Place marker before send to location

Postby GJK » October 23rd, 2015, 3:59 am

Probably asked before but I'm not finding quite what I'm looking for in a search.

I have a prototype for my playing pieces. This prototype will place a marker (blood) if the piece is marked as being knocked down on the board. This works (and I'm using map layers to put the marker beneath the piece - works great). The problem: the piece can also be sent off to a dead pile which is another map window. He goes there with a 'send to location' trait in the prototype. I would like for it to also leave a blood marker BEFORE it leaves the main map. No matter what I've tried, it first moves the piece to the other map and then places the blood marker. I've experimented with trait order but no luck.

A quick breakdown:
ctrl+S "stuns" the piece, which knocks it down on the main map and then ctrl-alt-x places the (blood) marker. This works.
shift+k "kills" the piece and the send to location is executed, sending the piece to the kill pile.
My trigger action is watching for both of those keystrokes and if spotted, is to execute the ctrl-alt-x.

What is a the best approach to change this behavior?

Thanks!
"Fat, drunk, and stupid is no way to go through life, son."

-Dean Vernon Wormer
GJK
 
Posts: 41
Joined: December 25th, 2007, 7:53 am

Re: Place marker before send to location

Postby GJK » October 24th, 2015, 3:09 am

I'm convinced that there's no way to place a marker (piece/graphic) in one spot before the master piece is sent off to another location. Perhaps a proper request would be to add a "keyboard command to execute before the move" component to the Send To Location trait.
"Fat, drunk, and stupid is no way to go through life, son."

-Dean Vernon Wormer
GJK
 
Posts: 41
Joined: December 25th, 2007, 7:53 am

Re: Place marker before send to location

Postby Foobarius » October 24th, 2015, 5:53 am

If I understand your problem correctly, I believe what you need is for shift+k to be handled by a single Trigger Action trait, rather than having both a Trigger Action and a Send to Location trait which handle the same keystroke. The new Trigger Action will execute two keystrokes in order, the first to place the blood marker and the second to move the piece to the other map.

That is, you need a new keystroke (not visible to the user, so you can use a 'named keystroke') - let's call it moveKilledPiece. Your Send to Location trait should handle moveKilledPiece rather than shift+k, and your existing Trigger Action also should no longer handle shift+k. Then you add a new Trigger Action which does handle shift+k. This Trigger Action just executes ctrl-alt-x and then moveKilledPiece.
Foobarius
 
Posts: 27
Joined: June 14th, 2015, 5:43 am

Re: Place marker before send to location

Postby JoelCFC25 » October 26th, 2015, 3:47 pm

As a general recommendation, I would strongly discourage the use of "Shift +" keystrokes. I've seen too many occasions where they get inadvertently triggered by typing messages into the chat while a piece is selected.

Using named keystrokes (especially for things that happen behind the scenes that aren't exposed to the end user) will make your life dramatically easier as the number of key commands goes up--you won't have to constantly be reminding yourself whether it's Ctrl+Alt+something or Ctrl+Shift+something that a piece needs to be handling.

And Foobarius is correct with his diagnosis and recommendation--don't use a single Trigger Action to handle multiple keystrokes that do different tasks.
JoelCFC25
 
Posts: 730
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Place marker before send to location

Postby Rindis » October 27th, 2015, 4:12 am

JoelCFC25 wrote:As a general recommendation, I would strongly discourage the use of "Shift +" keystrokes. I've seen too many occasions where they get inadvertently triggered by typing messages into the chat while a piece is selected.

Yeah, I took over maintenance of the Pursuit of Glory module simply because I was eliminating units and the like while chatting during play with a friend.
User avatar
Rindis
 
Posts: 198
Joined: December 22nd, 2007, 12:49 am

Re: Place marker before send to location

Postby GJK » October 28th, 2015, 11:23 pm

Some great points - I've seen that with the shift key in this module. So, named keystrokes...is that the name of the trait as I'm not seeing one by that name? Or is it a sub-trait of another trait? My VASSAL is rusty so please excuse the amateur questions.
"Fat, drunk, and stupid is no way to go through life, son."

-Dean Vernon Wormer
GJK
 
Posts: 41
Joined: December 25th, 2007, 7:53 am

Re: Place marker before send to location

Postby JoelCFC25 » October 29th, 2015, 12:06 am

You just start typing some alphanumeric string in the place where you would normally enter the key command. So for instance the Clone piece trait usually defaults to:

Menu text: Clone
Key command: CTRL+C

One example of a named keystroke equivalent would be:

Menu text: Clone
Key command: CopyPiece

Anything using named keystrokes cannot ever be triggered by the physical keyboard, and it gives you a great deal of flexibility in giving commands that govern the inner workings of a module descriptive names that will help you keep everything straight.
JoelCFC25
 
Posts: 730
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Place marker before send to location

Postby GJK » October 29th, 2015, 3:13 am

Excellent, I never knew about that feature. Thanks Joel.
"Fat, drunk, and stupid is no way to go through life, son."

-Dean Vernon Wormer
GJK
 
Posts: 41
Joined: December 25th, 2007, 7:53 am

Re: Place marker before send to location

Postby GJK » October 31st, 2015, 2:37 am

I just wanted to thank each of you, especially Foobarius. Once I wrapped my head around what you said in your suggestion, it implemented perfectly and works great. I even used the Named Keystroke to have it play a sound when a piece is moved off to the dead pile. This is for the VASSAL Blood Bowl module by the way for those interested (www.garykrockover.com/BB).

Thanks again!
"Fat, drunk, and stupid is no way to go through life, son."

-Dean Vernon Wormer
GJK
 
Posts: 41
Joined: December 25th, 2007, 7:53 am


Return to Module Design

Who is online

Users browsing this forum: No registered users and 6 guests