Results 1 to 10 of 10

Thread: Deck to Self Shuffle when placed on Draw Deck placement

  1. #1

    Deck to Self Shuffle when placed on Draw Deck placement

    I am working on a game where depending on the number of players you have different types and numbers of cards in the deck. To get around this I have created three different decks to be used depending on the number of players. The idea is that the players grab the deck they need and place it on the Draw Deck "card" to start the game. I do not know how to get the deck to self shuffle when placed on this place. I have tried using the GUID of the "card" I am using for the draw pile and telling it to self shuffle when something collides with it, but placing the deck on that spot doesn't seem to count as colliding. I have tried creating a scripting zone and telling it to shuffle when entering the zone, but that does not seem to work either. Unless I am doing something wrong. Any help with what command I should be using will be greatly appreciated, onObjectEnterScriptingZone and onCollisionEnter do not seem to be giving the desired result.

  2. #2
    I do something similar in a version of Bohnanza I just wrote ( search for "Bohnanza" in the Steam workshop and subscribe to the one written by "groovyclam" ).

    You can pick apart the script in it.

    I have the onload function work out how many players are seated and then pick one of three decks automatically as the deck to play with ( but you could do something like put a button on each of your decks and have the players click the button of the deck they want ).

    I then say this deck is the "deck_draw" i.e. deck_draw = deck_the_players_clicked ( or in my case which the onLoad function worked out )

    Then do deck_draw.shuffle()

    Then do deck_draw.setPosition(x,y,z) to where you want it to be on the table.

    You can get rid of the start card if it doesn't really serve a purpose ( i.e. include it in the decks the players choose from, OR add it to deck_draw after positioning the deck_draw deck ).

    Do deck_others_not_needed.destruct() for the decks the players don't need.

  3. #3
    Blimey - I've realised you are PsychoSpaniard - we are probably talking about the same game!

    I used your graphics in my Bohnanaza mod !

  4. #4
    Hi groovyclam, yes, I am PsychoSpaniard. Those are high quality graphics you got there ;-)

    Thanks for the heads up on your scripting. I am not very good at that side of the things. I have bugged my husband before to help (see script on Catan Histories: Struggle for Rome, that's mostly his work), but I am having trouble sorting this one out and he's quite busy with work. I will have a look at your code. I suppose that your way is quite neat as it will automatically pick the right deck to play with.

    Cheers

  5. #5
    If you have any questions just ask, but the variables have sensible names and I have put comments in the code.

    The main problem I had to get around was working out when deck_draw was empty. TSS needs there to be 2 cards stacked together for there to be a "deck" so when the second-to-last card leaves the deck the deck no longer exists! Even though there is still one card left to use up.

    I got around that by testing:
    if ( deck_draw == nil or deck_draw == null ) i.e. if it no longer exists then check for any objects in the deck_draw_zone ( a scripting zone I had set up where the draw deck lives )

    If there ARE objects there, then they must be the last draw card, so use that up before replenishing the deck from the discard pile.

    The call to test to replenish the deck is done whenever any object leaves the deck_draw_zone ( which should only be a draw card, or possibly the whole deck_draw if a player picks it up by mistake ) with an onObjectLeaveScriptingZone trigger.

    The rest is understandable I think.

    I'm pretty new to this myself - there are so many properties and functions I feel like I'm only scraping the surface.

  6. #6
    Quote Originally Posted by PsychoSpaniard View Post
    Those are high quality graphics you got there ;-)
    They are indeed - especially the player mats - well done.

  7. #7
    Quote Originally Posted by groovyclam View Post
    They are indeed - especially the player mats - well done.
    And I have just realised that the hard work for the playmats was done by someone else and I hand't credited them for that, so it's a good thing that you mentioned it. I like to credit everyone whose work I have used, and I had obviously forgotten that one. I was going to make my own, but they had done sterling work with that playmat.

  8. #8
    Well, your card scans are the nicest I found too

  9. #9
    Quote Originally Posted by groovyclam View Post
    Well, your card scans are the nicest I found too
    Originals scanned at 600dpi then trimmed and the more obvious blemishes removed before combining into a single file for uploading as a deck. Decks of cards are easy, it's when scanning full boards that is a pain, cos I do not have a scanner big enough to contain the whole board in one scan, so it's all a jigsaw. Still, I enjoy doing the scans and the putting together of the images. It's the coding I keep stumbling on. I suppose I just have to persevere and it will all eventually make sense.

  10. #10
    Quote Originally Posted by PsychoSpaniard View Post
    Originals scanned at 600dpi then trimmed and the more obvious blemishes removed before combining into a single file for uploading as a deck. Decks of cards are easy, it's when scanning full boards that is a pain, cos I do not have a scanner big enough to contain the whole board in one scan, so it's all a jigsaw. Still, I enjoy doing the scans and the putting together of the images. It's the coding I keep stumbling on. I suppose I just have to persevere and it will all eventually make sense.
    The card scans are lovely - I like the fact you can see the texture on them.

    I had to scan a board for a version of "San Marco" I made for VASSAL - I had the same problems you had. It made me investigate A3 scanners and printers but they are way too expensive.

    VASSAL and TTS are amazing products for boardgame fans. I've probably played more games under Covid lockdown than I would normally.

Similar Threads

  1. Deck shuffle when loading game
    By mamba94 in forum Suggestions
    Replies: 1
    Last Post: 05-27-2017, 11:43 AM
  2. Replies: 4
    Last Post: 05-18-2017, 07:47 PM
  3. dealToColor issue based on deck placement
    By Zero3ffect in forum Scripting
    Replies: 2
    Last Post: 05-05-2016, 06:21 PM
  4. Draw Specific Card from Deck
    By Eskander in forum Scripting
    Replies: 10
    Last Post: 05-04-2016, 04:17 PM
  5. Custom Hand Placement deck searching?
    By Jabrwock in forum General Discussion
    Replies: 2
    Last Post: 11-22-2015, 03:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •