Create account / Log in

Send to deck based on user_name

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Send to deck based on user_name

Postby doitgames » December 24th, 2020, 1:12 pm

Hi,

There is one common deck where everyplayer draws cards, and every player have his own discard deck. Every player must discard to his own discard deck. So I would need a "Send to Deck" trait but target desk must be based on that atribute.

Many thanks in advance
doitgames
 
Posts: 1
Joined: December 24th, 2020, 1:09 pm

Re: Send to deck based on user_name

Postby jrwatts » December 24th, 2020, 2:04 pm

Unfortunately, I don't think the Return to Deck trait lets you use a property to vary the deck you're returning to, so you would need to add multiple Trigger Actions to trigger different Return to Deck commands based on the current player. For example, if your sides are "Red", "Green", and "Blue", and the discard decks are called "RedDiscard", "GreenDiscard", and "BlueDiscard", you would need 3 Trigger Actions; the first would trigger when PlayerSide="Red" (or {PlayerSide=="Red"}, if you prefer Beanshell syntax), and would trigger a Return to Deck trait that sends to the RedDiscard deck. Green and Blue would be similar.
jrwatts
 
Posts: 224
Joined: April 29th, 2020, 10:30 pm

Re: Send to deck based on user_name

Postby shilinski » December 24th, 2020, 2:26 pm

Funny that you asked because I had the same problem. Return-to-deck doesn't work because you can't dynamically select a deck.

Instead, use send-to-location. Set the pixel coordinates for send-to-location as exactly that of the deck's pixel coordinates. In my case, each deck had the same location in each map window, so all I had to do was dynamically determine to which map window it had to go.

BTW, don't send-to-region. That won't work even if the region is identical to the deck's pixel coordinates.
shilinski
 
Posts: 224
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: Send to deck based on user_name

Postby marktb1961 » December 24th, 2020, 7:11 pm

shilinski wrote:That won't work even if the region is identical to the deck's pixel coordinates.


That's interesting because I found out today that when you report by gridLocation, a region defined on a deck's pixel coordinates is indeed ignored and instead LocationName reports as the Deck Name. Tying these two pieces of info together, I wonder what would happen if you tried to do a Send to Location using the deck name as the region name ? I assume that you'd need to have a zone around the deck that reported as $gridLocation$.

Mark
Platform: Vassal 3.5.3, MacOS Big Sur on iMac (27", mid-2020)
User avatar
marktb1961
 
Posts: 445
Joined: October 4th, 2018, 2:36 pm
Location: Liverpool, England

Re: Send to deck based on user_name

Postby shilinski » December 24th, 2020, 7:53 pm

I tested sending a card to a region, which was also a deck location. The card appeared with the deck but not in the deck. It was sort of like the movie "The Fly," where a person was part human and part fly. I considered the region/deck (a reck) to be an abomination and quickly exited. But the deck name did not replace the region name. It still knew about the region.

Sending to a deck via send-to-location makes me uncomfortable though because it's a trap. A year from now I might want to "move the furniture around," and if I move the deck, everything will go to hell. To quell my concern, I added markers to the card prototype call "deckX" and "deckY" and sent to those coordinates instead. That's to remind the older me that those send-to coordinates are not just pulled out of air. They MEAN something.

I'm going to derail this thread a tad to say I wish Vassal had a "comment" trait whose only purpose would be to let me write explanations to myself so the older me in the future, when looking at this stuff say: "what were you thinking, dumb ass?", I will have an answer.
shilinski
 
Posts: 224
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland


Return to Module Design

Who is online

Users browsing this forum: No registered users and 3 guests

cron