Tabletop Simulator

Tabletop Simulator

View Stats:
Is there a way to stop cards from forming decks when placed together?
I'm designing a mod and am having some trouble with cards fusing together when I don't want them to.

To get around the limited board size (if you can force boards to be bigger and I'm just being dumb telling me that will fix this problem) I've used cards spread out and locked into posistion in order to create my board. The problem with this is that when you play another card on top of those "board cards" the form a deck and unlock the board portion.

Is there a way to prevent cards from fusing to locked cards?
Last edited by Papa Jacque; Jun 6, 2014 @ 8:17am
< >
Showing 1-12 of 12 comments
Rice Jun 6, 2014 @ 9:09am 
Have them different sizes/ Though they will still merge to the deck if you place them exactly in the center. If you have a deck of 2 or larger then they don't get unlocked when the cards are merged.
Papa Jacque Jun 6, 2014 @ 9:22am 
Originally posted by RiceKun:
Have them different sizes/ Though they will still merge to the deck if you place them exactly in the center. If you have a deck of 2 or larger then they don't get unlocked when the cards are merged.

I'll do some fiddling with card sizes then. The problem was probably that I was essentially using a card upscaled slightly and locked in place to denote where you can put other cards. I'll try grouping a bunch of spaces together, in a way that they will be significantly bigger and that you won't be placing other cards in the middle of.

Cheers for the help.
Scrub Jun 6, 2014 @ 9:27am 
If you're playing cards on top of cards then right now that's something that cannot be easily done. Cards of differing sizes still will "stack".

edit: as func_door has pointed out this is widely regarded as a bug.
Last edited by Scrub; Jun 6, 2014 @ 9:30am
func_door Jun 6, 2014 @ 9:28am 
Cards of different sizes shouldn't merge, I consider this a bug
Face-up cards won't stack with face-down cards, so if you have cards specifically designated as boards or placement pieces, import the back as the front and the front as the back.
Rice Jun 6, 2014 @ 9:45am 
Completely forgot about that as well. Good suggestion. Although I wouldn't recommend importing back as front and front as back.
Last edited by Rice; Jun 6, 2014 @ 9:45am
Esper_lvl4 Feb 9, 2023 @ 2:50am 
So I had the same problem and tryed other way to deal with it - thats what helped me solve the problem:

function tryObjectEnterContainer(_, object)
return object.type != 'Card'
end

This is a global event (you can read docs about it), but in short it can prevent any object from entering any container. Deck is considered a container, so with this code I could prevent any Card from entering any container. You could also use the first variable of this function to prevent them from entering decks specifically - I just didnt need it. Peace.
CelesticLeo Apr 7, 2024 @ 12:58pm 
Originally posted by Esper_lvl4:
So I had the same problem and tryed other way to deal with it - thats what helped me solve the problem:

function tryObjectEnterContainer(_, object)
return object.type != 'Card'
end

This is a global event (you can read docs about it), but in short it can prevent any object from entering any container. Deck is considered a container, so with this code I could prevent any Card from entering any container. You could also use the first variable of this function to prevent them from entering decks specifically - I just didnt need it. Peace.


Sorry to ping you so far into the future but I was going to ask if you had any resources to learn more about this.

I'm currently scripting a game where cards get laid on top of one another ( Gloom ). I need them to not merge into a deck. I thought that maybe I could use your code somehow with scripting zones to achieve this. ( Very new to all of this. )
Bone White Apr 7, 2024 @ 2:24pm 
function tryObjectEnterContainer(_, obj) for _,zone in ipairs(obj.getZones()) do if zone == self then return obj.type ~= "Card" end end end

^ put this on the scripting zone itself

Scripting questions are much easier answered on the official Discord server, there are dedicated channels for answering #scripting questions
CelesticLeo Apr 8, 2024 @ 12:49pm 
Originally posted by Bone White:
function tryObjectEnterContainer(_, obj) for _,zone in ipairs(obj.getZones()) do if zone == self then return obj.type ~= "Card" end end end

^ put this on the scripting zone itself

Scripting questions are much easier answered on the official Discord server, there are dedicated channels for answering #scripting questions

Is there a link to the discord by chance?
Bone White Apr 8, 2024 @ 1:57pm 
After you load up TTS there's a load of links in the top left - the bottom one is the Discord link.
Hey, i tried this however, i am getting issues where the cards wont return into bags anymore

Originally posted by CelesticLeo:
Originally posted by Esper_lvl4:
So
function tryObjectEnterContainer(_, object)
return object.type != 'Card'
end

Last edited by SirReasoner; Apr 5 @ 3:19am
< >
Showing 1-12 of 12 comments
Per page: 1530 50