Results 1 to 3 of 3

Thread: Trying to copy and clone cards from one deck into another deck

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Cool [SOLVED] Trying to copy and clone cards from one deck into another deck

    Thank you for taking the time to read my post.

    I am trying to copy and clone (custom) cards from one deck into another deck.

    The two decks are of the same kind. Doing it "by hand" works.

    Here is my code:

    UI: <Button rectAlignment="UpperRight" height="20" width="100" offsetXY="0 -120" onClick="initialize" >Initialize</Button>

    Code:
    function initialize()
        print("Initializing cards.")
    
        deck_randomunits = getObjectFromGUID('2690ab')
        deck_basicunits = getObjectFromGUID('f292b1')
    
        deck_randomunits.shuffle()
        for i = 1, 8 do
            card = deck_randomunits.takeObject({smooth=false})
            deck_basicunits.putObject(card)
            --deck_basicunits.putObject(card)
            deck_basicunits.putObject(card.clone({position=deck_basicunits.getPosition()}))
        end
        deck_basicunits.clone()
        deck_randomunits.destruct()
    
    
        --print(#deck_randomunits.getObjects())
    end
    The problem is that white zombie cards appear.
    If I take out the line cloning the cards it seems to work but I need two of each random card in the target deck.

    Any and all help would be very much appreciated.

    Last edited by paranoidray; 05-05-2019 at 01:37 AM.

Similar Threads

  1. Replies: 2
    Last Post: 12-05-2017, 11:26 AM
  2. Replies: 1
    Last Post: 11-10-2016, 06:05 PM
  3. Replies: 2
    Last Post: 07-07-2016, 05:15 PM
  4. Ungrouping a Deck of Cards
    By Eric in forum General Discussion
    Replies: 1
    Last Post: 11-16-2015, 01:14 PM
  5. Replies: 3
    Last Post: 06-02-2015, 07:57 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
  •