Create account / Log in

Automatically Move Counter to Bottom of Stack

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

Automatically Move Counter to Bottom of Stack

Postby GamesOnTheBrain » March 18th, 2011, 1:54 am

I'd like to be able to drag a counter on to another counter, and have the counter I'm dragging automatically go to the bottom of the stack. I know I can use the down arrow to send it to the bottom, and I imagine I can use a Trigger somehow to do this, but since I want the trigger to activate upon being moved, and not upon a keystroke, I'm not sure how to do it.

Anyone?
User avatar
GamesOnTheBrain
 
Posts: 13
Joined: August 2nd, 2008, 11:21 pm

Re: [messages] [Module Design] Automatically Move Counter to

Postby Tim M » March 18th, 2011, 2:23 am

Use a trigger action combined with the last field in the map dialog window
(called something like "keystroke to apply to all units that end moving on
this map")

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of GamesOnTheBrain
Sent: Thursday, March 17, 2011 8:55 PM
To: messages@vassalengine.org
Subject: [messages] [Module Design] Automatically Move Counter to Bottom
ofStack

I'd like to be able to drag a counter on to another counter, and have
the counter I'm dragging _automatically_ go to the bottom of the stack.
I know I can use the down arrow to send it to the bottom, and I imagine
I can use a Trigger somehow to do this, but since I want the trigger to
activate upon being moved, and not upon a keystroke, I'm not sure how to
do it.

Anyone?

_______________________________________________
Read this topic online here:
viewtopic.php?p=22232#p22232
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: [messages] [Module Design] Automatically Move Counter to

Postby tar » March 18th, 2011, 5:59 pm

On Mar 17, 2011, at 6:54 PM, GamesOnTheBrain wrote:

> I'd like to be able to drag a counter on to another counter, and have
> the counter I'm dragging _automatically_ go to the bottom of the stack.
> I know I can use the down arrow to send it to the bottom, and I imagine
> I can use a Trigger somehow to do this, but since I want the trigger to
> activate upon being moved, and not upon a keystroke, I'm not sure how to
> do it.

I can think of two ways to interpret what you want:

(a) Every counter that you drag onto a stack should end up at the bottom rather than the top of the stack. The player can later move that counter up if they want to. If that is what you want, Tim McCarron gives you a way to do that.

(b) Like a, but only for certain counters. You should be able to do this with a variant of what Tim suggested, where you check a property before moving the counter to the bottom.

(c) Certain counters are always supposed to be on the bottom of stacks. Players would not be moving them up at all. If this is what you want, then you should look at "Game Piece Layers"
User avatar
tar
 
Posts: 772
Joined: January 2nd, 2008, 6:53 pm
Location: Los Angeles area

Re: Automatically Move Counter to Bottom of Stack

Postby GamesOnTheBrain » March 18th, 2011, 6:12 pm

(A) is what I want.

I'll report back as soon as I get a chance to work on it. Thanks!
User avatar
GamesOnTheBrain
 
Posts: 13
Joined: August 2nd, 2008, 11:21 pm

Re: [messages] [Module Design] Automatically Move Counter to

Postby Tim M » March 18th, 2011, 7:25 pm

tar wrote:I can think of two ways to interpret what you want:

(a) Every counter that you drag onto a stack should end up at the bottom rather than the top of the stack. The player can later move that counter up if they want to. If that is what you want, Tim McCarron gives you a way to do that.

(b) Like a, but only for certain counters. You should be able to do this with a variant of what Tim suggested, where you check a property before moving the counter to the bottom.

(c) Certain counters are always supposed to be on the bottom of stacks. Players would not be moving them up at all. If this is what you want, then you should look at "Game Piece Layers"


I was thinking of method B myself which is why I mentioned using a trigger. You can bypass the trigger altogether with method A and just match the key in the Map dialog field
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: Automatically Move Counter to Bottom of Stack

Postby GamesOnTheBrain » March 18th, 2011, 8:08 pm

OK, I have no idea what I'm doing. I'm fairly new to this so I'm not sure what you mean when you say match the key in the map dialog field. I think I know how to trigger it when another command is pressed, but I want it to trigger when the counter is dragged with a mouse onto another counter of the same type.

Note the these counters should always go to the bottom of a stack automatically.
User avatar
GamesOnTheBrain
 
Posts: 13
Joined: August 2nd, 2008, 11:21 pm

Re: Automatically Move Counter to Bottom of Stack

Postby Tim M » March 18th, 2011, 8:19 pm

All you should need to do is this (per method A). see pic

Down.png
Down.png (138.3 KiB) Viewed 4241 times
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: Automatically Move Counter to Bottom of Stack

Postby GamesOnTheBrain » March 18th, 2011, 8:31 pm

I love you. =P

THANKS!!!!

While I have your attention, two more questions (one of which is related):

1) I have two types of pieces on the map. Ideally, the command would only be applied to one of them (the other is rarely stacked though so it won't matter too much).

2) Is there a way to make a type of piece stackable on one map and not on another?
User avatar
GamesOnTheBrain
 
Posts: 13
Joined: August 2nd, 2008, 11:21 pm

Re: Automatically Move Counter to Bottom of Stack

Postby Tim M » March 18th, 2011, 8:34 pm

For the one that you do not want to be stackable give it a Does Not Stack trait.

If you want it to always be on top (or bottom) you will have to use the Game piece layers Module component and assign Marker traits to put pieces on different layers
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: Automatically Move Counter to Bottom of Stack

Postby GamesOnTheBrain » March 18th, 2011, 8:36 pm

What if I want that piece to be stackable on another map?
User avatar
GamesOnTheBrain
 
Posts: 13
Joined: August 2nd, 2008, 11:21 pm

Re: Automatically Move Counter to Bottom of Stack

Postby Tim M » March 18th, 2011, 8:46 pm

Then you need to use method B (dont use the DNS trait) and put a trigger on your pieces that will use a property match expression to control when they activate the behavior.

So in your Map(s) field you might put "Ctrl Down" and on your game pieces you would put a Trigger Action trait that uses the key command "Ctrl Down" and executes the key "Down". In the property expression field of the Trigger Action we would put the expression "CurrentMap = NameOfTheMapThisWillWorkWith" and so on...
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: Automatically Move Counter to Bottom of Stack

Postby GamesOnTheBrain » March 18th, 2011, 8:49 pm

OK, I think I got it.

Thank you VERY much ! As a game-designer and small publisher, I hope to create Vassal mods for playtesting and playing my games. I also plan to create mods for some other games as well. Your support really helps!
User avatar
GamesOnTheBrain
 
Posts: 13
Joined: August 2nd, 2008, 11:21 pm


Return to Module Design

Who is online

Users browsing this forum: No registered users and 1 guest

cron