View Poll Results: Would you like to see this feature?

Voters
2. You may not vote on this poll
  • Yes, I agree. This feature should be added.

    0 0%
  • No, I disagree. This feature should not be added.

    2 100.00%
Results 1 to 9 of 9

Thread: The Ability to draw a card in a reversed position - Up or Down - 50/50 chance

  1. #1

    Lightbulb The Ability to draw a card in a reversed position - Up or Down - 50/50 chance

    Other than the fact that I'm sure this has been likely suggested before, I'm sure a lot of people will ask, "why don't you just use a coin or two sided dice to decide the direction/orientation of the card?" My answer, is authenticity and simplicity for the user.

    Instead of needing to roll a dice or flip a coin each time I draw a card to decide its direction, it would be nice to simply shuffle (with a random option set to yes) for each card to have a 50/50 chance of being up or down.

    Aside from Tarot, there are other games which could benefit from this feature by essentially allowing a single card to naturally have two meanings. For example, the face of a card could have two symbols (one at the top, and one at the bottom) with each back being the same; this would allow for double probability and more options to include additional content to a game with less cards. Similar games from the 80's used colors on the top and bottom of a card, but I can't remember its name.

    ~Hiram

    If you'd like to see this feature as an integrated game option for cards, which can likely be turned on or off, please consider giving your opinion in the provided poll. Thanks.
    Last edited by Hiram Abiff; 05-08-2017 at 04:10 PM.

  2. #2
    Join Date
    May 2016
    Posts
    1,072
    This might be something that scripting and trickery could manage.

    My idea is this, you make 2 decks. One deck has the standard face-down/face-up sides. For deck 2, you reverse the face-down/face-up. Now you have 2 decks that can stack, half of which will be face up, half of which would be face down. Now you would have too many cards that way, so a script could be used to randomize 1/2 the cards from one deck and 1/2 from the other, put them together, shuffle, and viola. The 2 starter decks could be kept in infinite bags so you could make new decks repeatedly.

    I don't mean to rain on your suggestion, just trying to help.

  3. #3
    Quote Originally Posted by MrStump View Post
    This might be something that scripting and trickery could manage.

    My idea is this, you make 2 decks. One deck has the standard face-down/face-up sides. For deck 2, you reverse the face-down/face-up. Now you have 2 decks that can stack, half of which will be face up, half of which would be face down. Now you would have too many cards that way, so a script could be used to randomize 1/2 the cards from one deck and 1/2 from the other, put them together, shuffle, and viola. The 2 starter decks could be kept in infinite bags so you could make new decks repeatedly.

    I don't mean to rain on your suggestion, just trying to help.
    or if you were to take these two decks and "State" each matched pair together. . . than you'd end up with just the 1 deck. a scripting solution would then just need to randomly assign either state 1 or 2 for each card as its drawn,

  4. #4
    You could use something like this:

    Code:
    function onObjectSpawn(obj)
        if obj.tag == "Card" and math.random(2) == 1 then
            local objRot = obj:getRotation()
            obj:setRotation({objRot.x, objRot.y + 180, objRot.z})
        end
    end

  5. #5
    Join Date
    May 2016
    Posts
    1,072
    ALL THESE SOLUTIONS! lol

  6. #6
    Join Date
    Sep 2016
    Posts
    216
    As was pointed out, there are multiple ways to solve this with scripting.

    On the off-chance that this is implemented anyway (it would be nice), don't forget to support all 4 orientations for tiles.

  7. #7

    Exclamation Update - Script seems to work, but throws error.. suggestions to fix?

    Quote Originally Posted by MrStump View Post
    This might be something that scripting and trickery could manage.

    My idea is this, you make 2 decks. One deck has the standard face-down/face-up sides. For deck 2, you reverse the face-down/face-up. Now you have 2 decks that can stack, half of which will be face up, half of which would be face down. Now you would have too many cards that way, so a script could be used to randomize 1/2 the cards from one deck and 1/2 from the other, put them together, shuffle, and viola. The 2 starter decks could be kept in infinite bags so you could make new decks repeatedly.

    I don't mean to rain on your suggestion, just trying to help.
    Quote Originally Posted by Mark View Post
    You could use something like this:

    Code:
    function onObjectSpawn(obj)
        if obj.tag == "Card" and math.random(2) == 1 then
            local objRot = obj:getRotation()
            obj:setRotation({objRot.x, objRot.y + 180, objRot.z})
        end
    end
    Sorry for taking a while to get back to you guys; been healing from a recent surgery, so all of my projects have been going slow or have been completely put on hold until now; but thank you all for your suggestions.

    I tried creating and testing a script with card states as mentioned, and other than getting a "state" error which displays each time, everything seems to be working the way I initially wanted. Below, I included the script so you guys can see. Please know though, I'm extremely new to scripting and lua; I've read the API, lua site, watched videos and read pages on these forums, but that pretty much concludes my understanding...Writing basic scripts or understanding a lot of stuff is still beyond difficult at the moment; hopefully though with your guy's help, I'll eventually get some kind of foundation. Thank you for your time and all help given.

    Error given in chat - "function <setState>; This state id does not exist."

    Code:
    function onObjectSpawn(obj)
       if obj.tag == "Card" and math.random(2) == 1 then
          obj:setState(2)
          local objRot = obj:getRotation()
          obj:setRotation({objRot.x, objRot.y +180, objRot.z})
          print('You draw a reversed Card.')
       else
          obj:setState(1)
          print('You draw a normal card.')
          end
    end
    After reading more on the API database, it appears that I need to possibly reference the state/s after changing them with setStates()
    Sets the current State for this Object if it has multiple States attached to it and returns a reference to the new State. The old reference will be destroyed, so update your reference to this Object with the return value of the new State. Returns nil if this Object does not have multiple states attached to it.
    If I need to reference the state to solve the error, how exactly would I go about that? I've seen the use of tables to iterate over GUIDs to make reference, but is this practical to do with 76 different states? I feel like I'm missing possibly an easier way of doing this. If anyone has suggestions, then your help would be greatly appreciated. thanks.

    ~Hiram

    Btw; I wanted to throw another big Thank You to Mr.Stump for your lua guides; they were super helpful.
    Last edited by Hiram Abiff; 03-20-2017 at 01:00 PM.

  8. #8
    Don't combine the solutions, use one suggestion or the other. If you're using states, you don't need to do the rotating bit. If you're not, you do.

  9. #9

    Both Methods Yield Errors or Problems - maybe a coroutine needed?

    Quote Originally Posted by Mark View Post
    Don't combine the solutions, use one suggestion or the other. If you're using states, you don't need to do the rotating bit. If you're not, you do.
    I encounter an error using either of the suggestions. If I use just the rotation option, the back of the card rotates on draw, but once flipped leaves the face of the card unaffected. If I use just the states suggestion, the card changes states as it should, but I still get an error saying the state id doesn't exist. Both problems I thought could be attributed to the scripts calling the rotation before the card is fully drawn and initialized.

    I have found info on coroutines and clocks which are to be used for a pause or sleep function until the object is fully loaded, but I have been primarily unsuccessful at using one or incorporating one myself. If an example could be given using onObjectSpawn, I'd appreciate it very much. Btw, despite myself having issues figure this out, your coroutine posts in other threads have been helpful towards my understanding. Thank you.

    ~ Hiram Abiff

    EDIT: Though I cant grab a card in a single click as the flip function interrupts the draw process, adding obj:flip() directly after the rotation allowed for the card to seamlessly flip and rotate without even an animation.. which helps improve the idea that the cards are shuffled up or down and do not visually rotate upon draw. The only real problem now, is when you get down to the last two cards in a deck, or allow two cards to merge into a deck and try to separate them; since both cards essentially spawn at the same time as their own objects, both cards try to flip and rotate and simply stick back together (see the below gif). Of course, you can search the deck and pull a card out away from the other, but its not really preferred. Any and all suggestions are welcome. In tarot, drawing cards till the last one is not typical, but accidentally having two cards merge together and not be able to separate I can see being a difficulty for people later on.

    Code:
    function onObjectSpawn(obj)
        if obj.tag == "Card" and math.random(2) == 1 then
            local objRot = obj:getRotation()
            obj:setRotation({objRot.x, objRot.y +180, objRot.z})
            obj:flip()
            print('You Draw a Reversed Card!')
        else
            local objflip = obj:flip()
            print('You Draw a Normal Card!')
        end
    end
    Last edited by Hiram Abiff; 05-05-2017 at 09:05 AM. Reason: fixed code snippet

Similar Threads

  1. Replies: 3
    Last Post: 10-04-2016, 03:02 PM
  2. [SUGGESTION] Any chance we could get an auto-setup feature?
    By ToterSchaedel in forum Zombicide
    Replies: 0
    Last Post: 06-16-2016, 08:41 PM
  3. Draw Specific Card from Deck
    By Eskander in forum Scripting
    Replies: 10
    Last Post: 05-04-2016, 04:17 PM
  4. Make Custom Token opposite side not reversed.
    By TheRaven81 in forum Suggestions
    Replies: 5
    Last Post: 02-07-2016, 08:03 PM
  5. Replies: 0
    Last Post: 12-26-2014, 10:05 AM

Tags for this Thread

Posting Permissions

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