Results 1 to 10 of 10

Thread: Can't get deck spawning or custom properties setting to work

  1. #1

    Can't get deck spawning or custom properties setting to work

    I anyone actually able to provide a working snippet of spwaning a deck and setting its custom properties? Or changing custom props of an existing deck? Or an existing single card? Anything? Can't get none of these to work.

  2. #2
    Join Date
    May 2016
    Posts
    1,072
    It isn't just you, I'm using this as a test:

    Code:
    function makeDeck()
        local deckData = {
            face = "http://cloud-3.steamusercontent.com/ugc/943937964026166578/AD3B50BA00F044D3A6D54AD37FE46EB0E689E38F/",
            unique_back = false,
            back = "http://cloud-3.steamusercontent.com/ugc/943937964026168029/9D68CA4E7342F10C3CAF7CA529D8D7AB9A5CDFA7/",
            width = 10,
            height = 7,
            number = 52,
            sideways = false,
            back_is_hidden = false,
        }
    
        local newDeck = spawnObject({ type="DeckCustom", position={0,5,5} })
        print(newDeck)
        newDeck.setCustomObject(deckData)
    end
    It creates a deck object (the print confirms that) but setCustomObject doesn't finish its creation, you just get the popup to manually enter info.

  3. #3
    since when can you spawn decks?

  4. #4
    @Tragic
    Since last update according to patch notes: [url]http://www.berserk-games.com/forums/showthread.php?4975-Update-v10-3-New-DLC-Pillars-of-Eternity-LotER-Discord-Integration-amp-Improvements&p=21740#post21740[/url]

    But it doesn't work.

  5. #5
    Join Date
    May 2016
    Posts
    1,072
    For now consider it a bug, I believe it will be addressed in a future update.

  6. #6
    Has there been any progress made on this getting fixed?... Like, is there an updated method to get it to work, or is it still considered bugged?

  7. #7
    @Hiram
    AFAIK the only way to spawn a deck now is to do obj.getJSON() on an existing deck, figure out its format inspecting returned string (it does mostly make sense barring some mysterious IDs but generally trial and error will work), construct your own string with data for your deck (or edit the thing you got) and use spawnObjectJSON(data).

  8. #8
    Quote Originally Posted by dzikakulka View Post
    @Hiram
    AFAIK the only way to spawn a deck now is to do obj.getJSON() on an existing deck, figure out its format inspecting returned string (it does mostly make sense barring some mysterious IDs but generally trial and error will work), construct your own string with data for your deck (or edit the thing you got) and use spawnObjectJSON(data).
    Admittedly, I'm a bit out of my depth when working with JSON. Other than using the spawnObjectJSON as described on the API which uses json as a parameter for obj.getJSON(), I haven't actually spawned something with JSON manually... Do I write it like its shown, such as "Locked": false, or do I write it like the example is shown on the API like locked = false? Sorry if this is a noob question, I just wanted to make sure before I start trying copy stuff... Btw another noob question for you; is there any way to easily copy text from the chat or log? I really haven't needed it until now...

    EDIT: Well, I figured out how to copy text from the chatbox... its as simple as using Atom's developer tools and viewing the console window. My hotkeys aren't set up for the normal ctrl+alt+i, and instead they were set to ctrl+shift+i. For anyone just getting to use atom, this feature can also be found at the top menu bar View>Developer>Toggle Developer Tools. And here I was typing out these huge strings... Still not entirely sure about how to get the string to function properly though.
    Last edited by Hiram Abiff; 08-04-2018 at 03:29 AM.

  9. #9
    Got fed up (what, 5 months?), made this:
    [url]http://www.berserk-games.com/forums/showthread.php?5356-Decker-lib-for-declaring-and-spawning-custom-cards-and-decks-from-scripting[/url]

  10. #10
    Quote Originally Posted by MrStump View Post
    It isn't just you, I'm using this as a test:

    Code:
    function makeDeck()
        local deckData = {
            face = "http://cloud-3.steamusercontent.com/ugc/943937964026166578/AD3B50BA00F044D3A6D54AD37FE46EB0E689E38F/",
            unique_back = false,
            back = "http://cloud-3.steamusercontent.com/ugc/943937964026168029/9D68CA4E7342F10C3CAF7CA529D8D7AB9A5CDFA7/",
            width = 10,
            height = 7,
            number = 52,
            sideways = false,
            back_is_hidden = false,
        }
    
        local newDeck = spawnObject({ type="DeckCustom", position={0,5,5} })
        print(newDeck)
        newDeck.setCustomObject(deckData)
    end
    It creates a deck object (the print confirms that) but setCustomObject doesn't finish its creation, you just get the popup to manually enter info.
    Apparently, as of update 10.9, this method now works 100%! Just got done testing, and it spawns the deck exactly as we would hope.

Similar Threads

  1. [SUPPORT] Custom Deck will not work
    By Kelragian in forum Technical Support
    Replies: 1
    Last Post: 11-21-2017, 08:33 PM
  2. Spawning a single card for an updated deck?
    By MarcusRaven in forum General Discussion
    Replies: 0
    Last Post: 07-02-2017, 07:45 AM
  3. Spawning a Custom Figurine?
    By Brennall in forum Scripting
    Replies: 2
    Last Post: 04-15-2017, 03:28 PM
  4. Spawning 3DText and setting rotation
    By Skorpion9x in forum Scripting
    Replies: 3
    Last Post: 01-14-2017, 07:29 PM
  5. Same properties for custom tokens as custom models?
    By FORCEFIELDS in forum Suggestions
    Replies: 0
    Last Post: 08-27-2015, 09:40 AM

Posting Permissions

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