Automatically Rotate Card onto Deck

I want to have card rotate 90 degrees when when it is Drag n Dropped onto a deck, which is already rotated 90 degrees from the vertical. I then want it to return to the vertical “0” degree position when it is dragged from the Deck. I have the card rotating manually when I have it on the game board, so it has a Rotate & Trigger in it’s properties that is working when I type Ctrl-T. Is it a GKC I assign to the Deck or the card or even the Zone that will activate the Trigger to do it when its placed on the Deck?
And a question that just occurred to me - can Decks be even rotated? Do they function as a deck on the horizontal as they do vertically orientated? Thx. CC

I just asked this same question today in the Discord channel.
The answer is very easy if you know what you are doing. I didn’t, so it took some explaining from @Benkyo, so all the credit goes to him.

As I just learned today how to do this, I may make some mistakes in my explanation, but I feel like I should give back to the community, so here we go:

First I need to understand why you are trying to do things. A deck does not have traits (not that I know of), so you cannot tweak their Can Rotate trait. However, I don’t see a particular reason for a deck to be rotated horizontally other than for aesthetical reasons. Luckily, you can auto-rotate cards coming out of that deck. If your module can work with a deck that is vertical, then we should be good, otherwise, I don’t know if we will have to make many tweaks and changes to make it work.

As I don’t fully understand what you are trying to achieve, I will tell you what I did to get mine working, with screenshots, so that it makes it easy to understand how it works and then you can translate that to your situation.

First of all we need to add the Can Rotate trait to all of your cards that need rotating. I changed the number of facings to 4. You will have to give a name to your Rotator property so that you can call it later (I called it RotateCard).

Then you want it to trigger when pieces move (in your case cards). So you need to give a name to the Named Command in the Main Map (or the map or area that you will be moving/rotating those cards). You can see that the last line in the image below has a Key command for anything ending their movement on this map and I gave it the name MovedOnMap.

Now you need to go back to all the cards that need rotating and you need to create a Trigger Action.
See in the image below how to set it up: first you need to set up the trigger: I set it up as {(ObscuredToOthers==false)&&(RotateCard_Facing != 2)} . This ensures that when the card is face up (not obscured or masked) and when the rotator is not at facing 2 (90 degrees), it will trigger.
I added the MovedOnMap as another key command to keep an eye on (every time that a card moves).
Then I set up that the key command that gets executed is the rotate clockwise command, in my case it is the Ctrl+] shortcut. Now, you don’t want it to just rotate once, you want it to rotate to your favourite facing (in my case it was facing 2 (90 degrees)). You achieve this by doing a loop. Check the repeat key commands in a loop option and select Repeat until condition is true (type of loop). Finally, set up your condition to {RotateCard_Facing==2}, so that it will stop once it reaches that facing.

Don’t forget to save your changes! Don’t forget to apply these traits to all the cards and decks that you may have in place. I have a deckbuilder utility where you can draw fresh cards to make your own deck. Those cards will need these traits too (in my case, only the resource cards need rotating horizontally).

I hope this helps you find your own answer. Fire up any follow up comments and questions in here and I’ll see if I can help.

Oh, and super important if you are new, these changes will only apply to new cards. If you already have cards in place when testing the changes, you will have to save your changes, and close and open a new game so that the changes apply to any new cards.

Of course, you can always download my Volition CCG module to copy and paste things or to play around.

Carlos

1 Like

Specifically regarding decks, I believe you can use DeckName== or CurrentZone== (if you define a zone) for your trigger condition.

2 Likes

If you put all the traits for your cards in one or more Prototype Definitions, updates to the prototype definitions transfer to all the cards using those definitions. Since I learned this, I avoid putting traits directly into pieces. I put them in Prototype Definitions which I then put into pieces. When I make a change and save the module, most changes are reflected without having to close and re-open the module.

Thx sprocket314. I didn’t see the Trigger cmd in your resource cards. I didn’t quite get the looping until I stared at you mod for a bit ( i.e. “2” = 2nd of 4 facings). I think what I want is that Key Command on the Deck I’m placing the cards onto rather than on the whole map since you can only use that particular Key cmd once on the Main Map & I’d also like it localized to the Deck or if I have to - the zone where the Deck resides. Thx again.

I do use Prototype Conditions…in fact its one of the first things I enter into a mod even if I don’t use all of them. What happens to me is I forget sometimes & double up some basic traits and suddenly find I have pieces stuck in loops. Still, I always end up having a combination of nested Prototype definitions and traits specific to the piece or piece type. Thx CC

1 Like

also, in your Pieces properties image - doesn’t your Trigger Action trait need to be below the Can Rotate trait in order to get the Can Rotate to trigger?

Two points:

  1. The map level key command is the only way to activate a trigger on a drag movement. You tailor it to specific locations by using CurrentZone or DeckName as part of your Trigger condition. Use a string rather than a key press, so the the only time it is relevant is when you want to activate specific triggers. Only having one key command for the whole map is not really a limitation.

  2. Triggers activate from top to bottom, unlike other traits that depend from bottom to top. This appears to be unfortunate inconsistency that couldn’t be changed by the time it was noticed, because there were already hundreds of modules that relied on this order. So, you might have a list of traits that goes trigger1, trigger2, trigger3, traitD, traitC, traitB, traitA, where triggers activate in the order 1 to 3, and trait D depends on traits C through A, etc. In other words, triggers from first to last, and most essential traits from last to first and you won’t go wrong, but triggers are independent of trait order except with respect to other triggers.

1 Like

Thanks. I guess I knew the order of the Trigger trait through making it work on other mods - and not really questioning why it worked while not following the order hierarchy.
“Only having one key command for the whole map is not really a limitation” - except when I want to have the card return to its vertical orientation when pulled from the deck (in its horizontal orientation) & presented on the main board.
I am trying your suggestions but haven’t got it to work yet.

You only have one key command, but the number of different triggers you can implement based on that key command is unlimited. One trigger to rotate when moved to deck, another rotate to a different facing when moved out, another to do something else, etc.

Well I got the card to rotate when placed onto the horizontal deck. I just can’t get it to return to its vertical orientation when the card is drawn from that deck onto the main map board.

What is the problem?

Solved: OldZone== “[Zone Name]” condition.
When the card was pulled from the Deck it would either not rotate back to its original vertical orientation ( it also has to unmask itself) or would rotate back to the horizontal when it was sent to the Discarded or Played Decks (not wanted as they are vertically oriented. Don’t ask me what conditions I had that did that - can’t remember now).
I finally added an "OldZone==“TribalReserve” condition to the CCW Rotation trait (the zone where the deck sits) and it seems to work. Thx for the help. CC

1 Like

For future reference for people with a similar issue, would you mind posting screenshots of your config, so that people can replicate the issue and the solution? I think this problem you just solved is super common and useful.
I myself have resources going to the discard pile horizontally, despite the discard pile being vertical, so I might use your trick to rotate them back to vertical when in the discard pile, but I do not 100% understand how you solved it.
Thanks in advance.

The cards are hand-drawn from the Draw Deck to a Tribal Reserve Deck. Then, based on a game criteria, a number of cards are hand drawn from the Tribal Reserve Deck to the game board for all to view. There is nothing extra in the Deck itself. Everything is accomplished by the Main Map Key command: “RotateCard,” the Rotate & Trigger commands on the cards ( one for each direction/orientation) and the Properties of those Triggers restricting the first to the Deck and the other to the “OldZone” where the Deck resides.
Based on another operation I needed to occur at the module level (specific card played draws a # of specific counters from the game’s counter tray window), I might have rather chosen to use some Triggers (with property controls like “selected” or “moved”) -Global Hotkeys- Global Key Command (at the module level) to accomplish the same thing. I was forced to do this for the 2nd operation I mentioned because the one Main Map Key Cmd (“RotateCard”) was used (for this operation) and didn’t make lexical sense to use it again for an operation drawing counters to the board (i.e. not rotating cards). I guess I could have used Key cmds instead of “RotateCard” but whateva! It works. Time to tackle the next issue.

1 Like

The OldZone property is a neat trick!
And yes, it would had made more sense to call the Main Map Key “WhenMoved” or something like that :slight_smile:

Thanks for sharing, this is super useful.

I’m not sure if OldZone as used here is flawed or not. Is it possible that a card moved from and to the Tribal Reserve Deck will trigger? i.e., does a short drag cause both the OldZone and the CurrentZone to become TribalReserve?

Even if not, these kind of things are worth bearing in mind. Make sure you set up your trigger conditions to match exactly what you need, not an approximation of what you need.