Tabletop Simulator

Tabletop Simulator

36 ratings
Updated GRID Table Remote
   
Award
Favorite
Favorited
Unfavorite
Assets: Scripting
Tags: Misc
File Size
Posted
Updated
18.623 KB
Feb 10, 2019 @ 5:12am
Feb 11, 2019 @ 8:14pm
4 Change Notes ( view )

Subscribe to download
Updated GRID Table Remote

Description
Remote for CHRY's GRID table updated to allow dropped tiles to update the table image.

Make a custom tile with your desired table surface image and simply drop it on the GRID Remote to update the table with the tile image. Flip the tile to use the back image too. Any tiles you already have for Skytools or any other purpose will work as well.

All functionality of the original GRID Remote are unchanged.

For those unfamiliar with Custom Tiles or editing them, refer the following link. As described, you can create new tiles with nothing but an image (start from top of guide), or edit an existing custom tile such as the sample ones in this mod (see last item in guide for how to begin). Feel free to post further questions in the comments or discussions here.
http://berserk-games.com/knowledgebase/custom-tiles/

A note about the video above: clicking the remote buttons at times is only meant to show that those buttons still work as usual, and that tiles can be used at any time. There's no need to press buttons at all between dropping tiles.

Also included is a minor fix to prevent multiple surface images from appearing if pressing "Apply Custom Image" without clearing the current one first (per the instructions).
v1.1 - Further updated to allow saving with a custom surface image applied, which then can later be removed normally.

You can save/copy the remote from this table into an existing mod using the GRID table. Not likely, but if needed you can link the remote to the new table just by updating the table GUID near the top of the script:
function onload() surface_spawned = 0 custom_image = 0 custom_surface_guid = "0" -- ** REPLACE FOLLOWING NUMBER WITH TABLE GUID ** table = getObjectFromGUID("0605eb")

You can also update an existing GRID Remote by adding the following code to the remote object script. If you don't know what to do with this, just copy the remote from the table:
function onCollisionEnter(info) if info.collision_object.tag == "Tile" then local o = info.collision_object local img if o.is_face_down then img = o.getCustomObject().image_bottom else img = o.getCustomObject().image end if img == self.getDescription() then return else if getObjectFromGUID(custom_surface_guid) ~= nil then getObjectFromGUID(custom_surface_guid).destruct() end self.setDescription(img) retractForCustomSurface() end end end

* v1.1 - update to allow saving and reloading with custom surface image applied
For this you need the following minor changes/additions to the remote object script:
-- line 1, change from: function onLoad() -- to: function onLoad(saved_data) -- anywhere within the onLoad() function, add: if saved_data ~= "" and saved_data ~= nil then custom_surface_guid = JSON.decode(saved_data) end
-- after the onLoad() function, add: function onSave() if custom_surface_guid ~= "" then return JSON.encode(custom_surface_guid) end end

---------------

For convenience, here is the UV template for the GRID table surface (from GRID - Customizable Table):
http://chry.me/up/custom_table_surface_template.png

You can resize and overlay the template on your table image to see where it may be cropped (ex. before[storage.googleapis.com] after[storage.googleapis.com]). Ideally make a custom table image in the aspect of the template rectangle (4096x1820, 2048x910, etc), then fill out the top & bottom with solid black or white to make the image square. Use powers of 2[www.katsbits.com] if you don't want professionals to laugh at you.

Also check filesize difference between the image saved as .png and .jpg - there may be a significant difference, enough to have a small, but noticeable impact on loading (and it's good practice to use the appropriate format). Images with mostly areas of solid color are better suited for png format, both for filesize and image quality. Images like photographs, gradients, small details, and few solid colors are better for jpg, for filesize, and any image degradation or artifacts are usually barely or not noticeable (opposed to solid color shapes where artifacts can be very noticeable especially on edges). (png should always have no artifacts, except from resizing, but filesize can be much greater depending on image.)

Resize the image and compare at different resolutions (4096x4096, 2048x2048, maybe 1024x1024 or smaller depending on image and use). Compare filesizes and image quality and decide if a higher resolution is needed or worth the difference. Test in-game to compare looks at the distances the image is likely to be viewed.

If you want a gold star for being extra efficient, you can use the empty space at the top and bottom of these images to place textures for any custom models you may be using in the same mod. (This, like all the tips here, will have little to no perceptable impact on performance on the scale of a TTS mod. Such optimizations can have a significant impact on larger 3D games where there may be tens or hundreds of textured objects loading at any given time. While it may make no difference here, it's still good practice when you can, and when it's little more work to do.)

================

The GRID table included in this Workshop item is for demonstration purposes only. Nothing is changed from the original. All credits to CHRY for this beautiful animated, customizable table.

If you use it, visit and rate it here:
https://steamcommunity.com/sharedfiles/filedetails/?id=1332172749

Remote asset and design also by CHRY. Nothing is changed but for the script code above.

================

*Soon to be added: A companion remote allowing the use of multiple tiles to create a list of table images, which you can cycle through.
Popular Discussions View All (1)
2
Feb 10, 2019 @ 6:55pm
Updated GRID Remote - Change Notes
HugePinball
17 Comments
Everwho Jan 18, 2023 @ 10:01pm 
Link to template is 404'd. Would love to have that. Otherwise, the table and remote update is fantastic. Thanks!
Prypjat Oct 18, 2022 @ 3:04am 
The Size from the image total is 2048x2048 (with black borders).
Without black borders 2048x910px
OalejandroH Feb 22, 2022 @ 10:11pm 
What is the size of the image that fits the table? I would love to make some maps for my DnD campaigns here
Zep Aug 12, 2021 @ 1:11pm 
Is there a way I can resize the images to be square instead of cropped into being rectangular? Or change the default image? I don't know anything about coding tbh so any help would be greatly appreciated
ImaTarget Mar 30, 2020 @ 12:27pm 
This little change is so neat and useful. Thanks for sharing it!
Destrais Nov 17, 2019 @ 7:49am 
I might have problem with the table. For me, its invisible unless i choose black color. same for some of my friends, do you know how to solve this?
Snem Feb 21, 2019 @ 2:13am 
The remote and the cips with the images on them are not affected, that's a good thing, I tried to use the " Ignore me" token for about an hour with no avail sadly .

Maybe it has to do with the collision box of the table ? ( I'm guessing if the table was more easy to select, maybe it could work with the token )
HugePinball  [author] Feb 21, 2019 @ 1:52am 
Would you use that "ignore me" token that the stage tool has? I played with that for like 10 minutes some time ago so I'm not sure of the details. If that's not working I can try to see if there's an easy way for it to ignore the table, but it would likely be on the skytools end.

Does it pack the remote too, I assume?
Snem Feb 20, 2019 @ 2:31pm 
Unpacking map (DnD related with a hundreds of tiles ) is done really nicely on this table, I'm glad of that, but it seems, when packing back it packs the table and the mat that was on it in the same bag my assets were.
I'm guessing the problem might be something different. Haven't fully tested it yet with One World, ( although I like your simpler approach to how GRID can change maps ).
HugePinball  [author] Feb 20, 2019 @ 11:55am 
Actually, I did this by request for someone who wanted just that. I didn't even bother looking at the skytools stage code beyond a glance, since I knew how the image swap could be done like that, so I just added the same functionality to the GRID remote (plus ability to use both sides of tile - though I don't know, does the stage do that?) And I think the multiple image feature will be nice when I have time to add it.

But any tiles you have for Skytools will work with this (I meant to mention that above). Any tiles will. Was there some other functionality you were looking for beyond that?