Results 1 to 6 of 6

Thread: Mass Import of Images for TOKENS, TILES and other things... (scripting maybe?)

  1. #1

    Mass Import of Images for TOKENS, TILES and other things... (scripting maybe?)

    I've spent about 2 days and hours and hours importing one image at a time for over 395 tokens used in my new mod.... we badly need a way to mass import tokens. Maybe even using a sheet like how the cards work.

    I was thinking that maybe it could be done with scripting using the "spawn object" command?...
    Last edited by Tragic; 10-30-2017 at 09:22 PM.
    My Boardgame uTube chan - Tragic's Table Top
    BGG Guild of BoardGame uTubers - Tube Tables

  2. #2
    Something along these lines should do
    Code:
    -- List of token images
    local tokenImages = {
        'http://qwerty/link1.jpg',
        'http://qwerty/link3.jpg',
        'http://qwerty/link2.jpg',
        -- ...
    }
    
    -- Common token parameters
    local tokenParam = {
        thickness = 0.2,
        merge_distance = 15,
        stackable = false
    }
    
    -- Frame delay between every spawn, adjust if neccesary
    frameDelay = 5
    
    function SpawnTokens(bag)
        -- To avoid spawning shitton of tokens in the open, we'll immediately put them in a bag
        bag = bag or spawnObject({type = 'Bag'})
        bag.lock()
    
        function SpawnTokensCoroutine()
            for k,image in ipairs(tokenImages) do
                local custom = tokenParam
                custom.image = image
                local newToken = spawnObject({type = 'Custom_Token'})
                newToken.setCustomObject(custom)
                bag.putObject(newToken)
    
                for i=1,frameDelay do
                    coroutine.yield(0)
                end
            end
            bag.highlightOn({0, 1, 0}, 10)
        end
        startLuaCoroutine(self, 'SpawnTokensCoroutine')
    end

  3. #3
    Thanks!

    used your code as inspiration for this quick and dirty tool!
    http://www.berserk-games.com/forums/...0734#post20734
    Last edited by Tragic; 11-02-2017 at 01:37 AM.
    My Boardgame uTube chan - Tragic's Table Top
    BGG Guild of BoardGame uTubers - Tube Tables

  4. #4
    The fact that you have to use scripting for this is frustrating, this really should be a thing in the actual creating custom objects process. I complained about this same thing a while back and still nothing was done with it. Surely it wouldnt be that difficult to simply add a "Batch Create Objects" option

  5. #5
    Your tool is great Tragic

    used it to make this guide https://steamcommunity.com/sharedfil...?id=1275938711

  6. #6
    cool!
    My Boardgame uTube chan - Tragic's Table Top
    BGG Guild of BoardGame uTubers - Tube Tables

Similar Threads

  1. Automated Batch-Import of Custom Tiles
    By Davrial in forum Suggestions
    Replies: 1
    Last Post: 06-21-2017, 10:38 AM
  2. [SUPPORT] custom tiles/tokens sinking into the table
    By bbacher in forum Technical Support
    Replies: 2
    Last Post: 06-10-2017, 06:09 AM
  3. Custom tokens/tiles that behave like figurines
    By Drummyralf in forum Suggestions
    Replies: 4
    Last Post: 06-17-2016, 03:11 AM
  4. Replies: 0
    Last Post: 02-04-2016, 05:39 PM
  5. Merging Tiles and tokens plus image sets for tiles
    By Unreal_Ed in forum Suggestions
    Replies: 0
    Last Post: 12-27-2015, 05:44 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
  •