Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Convert SPECIFIC cards to SPECIFIC tokens when played?

I run a campaign of Betrayal at House on the Hill, which uses a deck of cards for tiles. However, each back is different as well as each front. I've made a workaround of the current system by giving the deck a generic back, and using the front of the cards as the correct "back". Each of these fronts is numbered and corresponds to a list of tokens, which I then have to manually place for my players. Can someone help me write a script that reads the card ID and places it as the correct token ID?
1402775907
The Aaron
Roll20 Production Team
API Scripter
There was a topic about this a few days ago: <a href="https://app.roll20.net/forum/post/920239/convert-c" rel="nofollow">https://app.roll20.net/forum/post/920239/convert-c</a>... It shouldn't be too difficult to do. Having the graphics resources is really the hard part.
1402776251
The Aaron
Roll20 Production Team
API Scripter
It's been a while since I played BaHotH. Aren't the different levels of the house kept in separate "decks"?
1402779840

Edited 1402779933
Aaron, that's just a scrip that turns the card when placed onto a table to token mode. I need a script that actually replaces the card image with a different token entirely. What I need is essentially, activate on table placement: "If card id = 21, then discard and place token id 21" etc. It uses one deck and you just shuffle through it until you find a usable card. Some cards can only be played in the basement, or some only top/ground floor.. Etc.
1402780374

Edited 1404144232
The Aaron
Roll20 Production Team
API Scripter
Yeah, I was just pointing to it as it discusses catching when a card is played. So, the basic process you are talking about doing is: Players draw a card from the stack of rooms Players see that the card is either a 1st or 2nd floor tile, with the name identifying it as the conservatory or music room or what have you. Players play it on the board where they want it to go and it becomes the correct room graphic Players then rotate it as necessary to line up with the board. Sound right?
1402782261
The Aaron
Roll20 Production Team
API Scripter
Just out of curiosity, could you just annotate on the face of the tile? Either with available floors, or a border (Dashed in colors for the floors it suits, just have to match like to like), or both? That could simplify things to where it really is just converting a card to a graphic. I suppose that wouldn't support the moving off of inappropriate tiles without knowing their contents. How do you handle adding those cards back to the top of the deck?
What I understand is he wants to automate the process of right clicking the card in play and unchecking isdrawing, turning it into a map token.
1402789269

Edited 1402789327
The Aaron
Roll20 Production Team
API Scripter
Not precisely Michael. Keiss' response above points out that is not what he/she wants to do. This is because he/she needs to have the face of the card reflect the category of it (anywhere, basement only, 1st or 2nd floor, etc), and probably doesn't want to review which card it is until they choose to "play it". I almost wonder if it wouldn't be better to not use the cards for this sort of thing since there isn't ever a 'hand', it seems like it would get in the way more than it is helpful, especially with the idea that you're sorting though the deck to find a card that is appropriate (first card in the stack that can be played in the basement). I'd probably have a deck object on the table with token macros to draw for the particular floor. They would then create the correct tile token on top of the deck object, which the players could then move to the right position. Advanced features I would suggest: Only let the player who's turn it is click the buttons Only let the clicking player control the tile Remove the ability to move the tile either when the GM clicks a special macro or runs a particular API command. Switch out the deck image (probably by rotating multiple deck objects to the front) based on the top card's back Snap Tiles to a larger grid (3x3 or 4x4) to allow easy placement Prevent 45º rotation. Might even be able to shift the whole board if playing a tile causes the basement to be adjacent to the 1st floor, or what have you.
1402806390

Edited 1402806744
Wouldn't that way be even more difficult, since you'd probably need roll tables containing each and every possible result for a floor? And if you did use that, how would it know a tile has already been played? The advantage of the deck isn't a player's hand, but the discard pile. It prevents tiles from being used more than the correct number of times. What I like about my current method is that the normal back of the card (which level it can be played on) is actually displayed on the front. This allows a player to draw cards from the deck without putting the card in their hand. It simply cycles the bottom card face-first onto the top of the deck. They can then drag that top card onto the game board itself. I'd simply like to figure out how to, instead of drop the card as a drawing, place the corresponding map tile/token onto the board in token mode. I could then remove the numbers from the cards and not have to keep a randomized list of rooms sorted by floor placement and wouldn't have to cross-reference it each time a tile needs to be placed. I'm not worried about locking the deck or preventing anyone from rotating tiles. I don't play with anyone who I don't trust to be responsible with them.
1402806655
The Aaron
Roll20 Production Team
API Scripter
That would not be a problem. At the start of a game, you would randomize the order of all the tiles in an array in the state object. As you use tiles, you would take them out of that array. If necessary, the array could be reconstructed by building a new array and removing all of the tiles that are currently played on the table, but that should never need to happen.
I edited my above post, Aaron, to reflect a few details I left out. Sorry!
1402807233
The Aaron
Roll20 Production Team
API Scripter
No worries. That sounds pretty straight forward.
Thank you so much, Aaron!