Tabletop Simulator

Tabletop Simulator

Scripted Tarot Cards and Table
 This topic has been pinned, so it's probably important
Hiram Abiff  [developer] 3 Apr, 2019 @ 1:23am
General Discussion - Anything and everything about Tarot, or This mod
As the title says, here you can ask or talk about anything pertaining to this mod and or Tarot.

Sample topics...
- Tell us about your first Tarot deck and when and where you acquired it.
- Do you have a favorite Tarot Deck? If so, why is it your favorite deck?
- When did you get into Tarot? was it years ago? Or, are are you just learning?
- If you learned to read tarot somewhere besides this mod, explain how or from who you learned.
- Do you own any physical decks; if so, which one/s? Tell us about your collection.
- Discuss recent deck purchases, or simply talk about the next deck you want to buy.
- This is also good place to discuss possible changes to this mod without formally making a suggestion. If you are serious about a specific suggestion and think it good enough to be added to the next update, I recommend posting it on the "Suggestions" page found Here.

The suggested topics above are only samples; please feel free to discuss anything Tarot related in this Discussion.

It is worth noting that the comments section on the workshop page has a character limit of 1000, this means it can be extremely difficult to explain or discuss things in detail; which is why I created this discussion.
Last edited by Hiram Abiff; 3 Apr, 2019 @ 1:31am
< >
Showing 1-10 of 10 comments
Hiram Abiff  [developer] 6 Apr, 2019 @ 4:12am 
Originally posted by Arcturus Asriv:
Amazing resource. Great job!

Question, though...
Is there a way to resize the cards and not have the script resize them back to .89 when it links to them?
I prefer 1.2 width/height on the cards, but I can't figure out how to make them stay that size when using the script.

Hello Arcturus Asriv, I am happy to hear that you enjoy the mod. To answer your question,

Aside from resizing the deck so that cards best fit the style of the layouts and help beginners by having layouts closely resemble the images on the help tablet, the script resizes to ensure that larger decks can be placed without cards falling off the table or overlapping.

When developing this script before releasing it, I chose not to have any cards overlap due to a physics bug that seemed at the time related to moving and placing cards via scripting; if a card was placed on top of another card to create a fan, the top card would float through the bottom card and both cards would lay flat on the table, their faces were glitched until the player picked them up and separated them. I avoided this completely by forcing a deck scale, which also solved larger decks from having cards fall off the table when using layouts with more cards.

I can confirm that the updated version of this mod will have a fix for this to allow custom deck sizes and disable the script from auto scaling. This issue has been acknowledged and has been added to the suggestions thread found Here.

As of late, I have been working diligently creating the atmosphere to replace the current stars, cloud and background. Texturing each object of the new space and preparing them in Unity has taken a lot longer than I hoped. Every day I am a step closer to finishing the room and will be back to scripting and completing the custom UI.

I hope this answered your question. If you have any further questions or suggestions, please feel free to let me know.

~ Hiram
Arcturus Asriv 6 Apr, 2019 @ 1:48pm 
Thanks for the reply.
I understand now why they autoscale.
I do look forward to the update, though, so I can get them to 1.2.

BTW...
I would suggest looking through the 3d assets of some terrain and mapmaking mods on TTS.
I've been working on decorating my little area by taking some of the high detail items and increasing their size.

And if you grab one of the Ravenloft mods, it has a table set up in the middle of a room. The walls are just tiles locked on their sides and increased in size, then plastered with an image for the wallpaper.
I recommend checking it out for inspiration.

Here's a pic of my current set up. It's not much, though, as I've been busy with other projects.

https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1705333321

The door will be upgraded, as it's a bit low quality. It's just a place-holder.
And I plan to put pots at the bottom of the plants so they aren't growing out of the floor.
Last edited by Arcturus Asriv; 6 Apr, 2019 @ 1:57pm
Hiram Abiff  [developer] 17 Feb, 2021 @ 4:50pm 
Originally posted by Africa by Toto Fan:
Hey! Sorry to post here but I'm not able to comment on the other decks. Are you interested in adding more decks? I have pictures of the Animal Totem Tarot, and could send them over if you want them! :csdsmile:

Sorry Africa that I didn't respond to you a long time ago and you since deleted your reply; I took a break from the workshop and focused on my CG work. After seeing your reply, I did want to say thank you but I'm good on decks. I have almost 200+ tarot decks that I would love to post to the workshop, but I wanted to wait until I finished and released a newer version of my tarot mod to share more of them.

The updated mod will include a custom UI which offers a deck spawner, so I won't need to post decks anymore and people won't need to download them individually. Eventually it'll be one mod for everything. After posting almost 30 decks on the workshop, I understand that there is no way I could go posting another 30+ decks the way I was doing it before, mainly because it leaves more for me to manage, it swamps the workshop and clutters my private workshop. This is why I have completely opted for a deck spawner because it simplifies the process for me and for the end user.

Even though its been years since my last update, I'm still in the process of working on this mod and have spent so much time and effort towards its construction. The quality of the mod has now reached a point that I never expected, and the results are beautiful. I honestly think its reached DLC status where the mod looks and feels like its own game separate of TTS.

Because I'm the sole developer working on this project, it has proven to be the largest feat I've ever tackled. Slowly but surely, things are coming together though.

Thanks again for your offer. I'll reply back to this thread announcing the release of the updated mod as soon as its out.

~ Hiram
Hiram Abiff  [developer] 19 Feb, 2021 @ 1:21am 
Originally posted by JonTheCelt:
Hi, Hiram.

I just found your Tarot set for TTS on the workshop, and I was wondering if you could help me.

I'm trying to set up a deck of cards which have different parts to them at opposite ends of the card, and I'd really like it if the cards could be randomly reversed or remain upright when shuffled (or prior to being drawn). Obviously, this is something you've managed to achieve with your Tarot mod, and I was wondering if you could help me with the coding - I'm a complete newb at the whole lua thing, sadly.

If you are able to help me, I would be massively grateful.

Many thanks,

jonthecelt

Hello Jon, I'd be happy to help.

From the sounds of it, you have a deck of cards where each card has a face consisting of two halves and you'd like to pull a card with a random rotation.

Here are few important things to remember when scripting decks and cards...

  1. Decks do not store rotation data for cards. After storing a card in a deck, it will use the default rotation of the deck itself, which is the rotation of the first card that made the deck.
  2. Cards do not exist in the game/engine until they are drawn from deck. This means you cant change or edit a cards details until after its been removed/pulled from the deck.
  3. If all cards are removed from a deck until the deck is gone, then any references to that deck in script become invalid. If a new deck is created with the old cards, the new deck would have a different GUID and it would need to be updated in script. This can be done using one of several options. I included a demonstration below with instructions showing one of these methods.



Demo:
  1. Load a save, preferable a new save to test things out. Spawn the deck you want to test.
  2. Create a scripting zone on the table about the size of your deck but a bit bigger and then immediately save your game overwriting your save with the deck and the new scripting zone. After its saved, load the save again by clicking on it.
  3. Open the scripting editor and copy and past the below code into Global. Once its pasted, without closing the window, left click the scripting zone to copy its GUID and past it at the top of the script replacing the old zone GUID. Then click Save & Play. If you don't see the scripting zone anymore to copy its GUID, make sure you are in the zone editing option on the left side of the screen, third option down. Zone>Scripting
  4. Once everything reloads, makes sure you aren't in the zone editing mode anymore and place the deck inside the scripting zone, then try removing cards to see if you get the desired result.

    function onLoad() zone = "d87ca5" -- GUID of your zone, acquire this by left clicking your scripted zone after you create one. drawFaceUp = false -- choose whether cards are drawn face up or face down. end function onUpdate() end function onObjectLeaveContainer(deck, obj) -- This function is only called when a card leaves a deck. local zoneObjects = getAllObjects(zone) -- Get references to all objects located in the zone and store them in a lua table. if drawFaceUp == true then -- These parameters are used to rotate the card up or down using setRotation below. rot1Params = {0,180,0} rot2Params = {0,0,0} else rot1Params = {0,180,180} rot2Params = {0,0,180} end for index, cardObject in ipairs(zoneObjects) do -- Use a for loop to iterate over zone objects. if cardObject.tag == "Card" and cardObject == obj then -- Check if the object in the zone is a card and whether it matches the card pulled from the deck. if math.random (2) == 1 then -- This uses a random math of 1/2 or 50/50 choice. If math == 1 then don't rotate. cardObject.setRotation(rot1Params) else -- If math == 2, then rotate cardObject.setRotation(rot2Params) end end end end

    The above example is is just one using a scripting zone, but there are several alternate methods depending on what you need specifically. I do hope you found this information helpful Jon, if you need further help, feel free to ask.

    If you'd like to show support to me and my projects, please consider following my workshop to be notified of my future workshop releases.

    ~ Hiram

    Some useful links in case you haven't visited these sites.

    http://berserk-games.com/knowledgebase/atom-editor-plugin/
    https://kb.tabletopsimulator.com/
Last edited by Hiram Abiff; 19 Feb, 2021 @ 7:58pm
JonTheCelt 19 Feb, 2021 @ 11:08am 
That worked exactly as I hoped - thank you very much!
Hiram Abiff  [developer] 19 Feb, 2021 @ 7:50pm 
Originally posted by JonTheCelt:
That worked exactly as I hoped - thank you very much!
No problem Jon, happy to help. Btw, If you don't mind me asking, what kind of game are you working on?
JonTheCelt 20 Feb, 2021 @ 7:24am 
It's a Games Master Emulator for solo RPG playing, called Mythic - the original system was dice-based, but they released a deck to replace the dice, and I thought I'd save on printing costs and make myself a digital version of the deck to use when my wife and i play Changeling - The Lost together. :)

Not sure i'm going to publish it, but I'll keep it in mind if I am happy with the finished results.
Dhanen 24 May, 2023 @ 7:31am 
Sorry asking here and for the reflood but I am trying to make a tarot game in Unity, but I am not sure of how to store card info as there are lot of long descriptions that would be long strings and I don't want to "hardcode" them as it seems to be (at least in this case) an Scriptable object. What do you suggest me? Thanks and sorry for the inconveniences.
Hiram Abiff  [developer] 28 May, 2023 @ 2:26pm 
Hello Dhanen,

I'm sorry I can't really help you on that subject; I'm still generally a novice myself when it comes to Unity coding.

Because I'm primarily a 3D artist, what knowledge I have concerning Unity is heavily invested into asset creation; modeling, texturing, particle effects ect. I also switched most of my development over to Unreal Engine, so now I work with Unity even less.

I'm just guessing here, but maybe you can use an external script or something that might be able to hold all of your data, and then update the scripted object from it.
Dhanen 29 May, 2023 @ 4:38am 
Originally posted by Hiram Abiff:
Hello Dhanen,

I'm sorry I can't really help you on that subject; I'm still generally a novice myself when it comes to Unity coding.

Because I'm primarily a 3D artist, what knowledge I have concerning Unity is heavily invested into asset creation; modeling, texturing, particle effects ect. I also switched most of my development over to Unreal Engine, so now I work with Unity even less.

I'm just guessing here, but maybe you can use an external script or something that might be able to hold all of your data, and then update the scripted object from it.

Totally understandable, nothing to sorry about! :gk_smile:
I'll try what you suggest. Thanks so much for answering!
Last edited by Dhanen; 29 May, 2023 @ 4:39am
< >
Showing 1-10 of 10 comments
Per page: 1530 50