Tabletop Simulator

Tabletop Simulator

Not enough ratings
Pandemic Legacy Season 2 (Partially Scripted)
   
Award
Favorite
Favorited
Unfavorite
Type: Game
Complexity: Medium Complexity
File Size
Posted
Updated
905.771 KB
22 Sep, 2020 @ 1:50pm
26 Sep, 2020 @ 3:03am
2 Change Notes ( view )

Subscribe to download
Pandemic Legacy Season 2 (Partially Scripted)

Description
Partially scripted version of the mod by Laudani.

Major Additions Include:
- Script for sorting and setting up player cards.
- Script to clean the board after the game
- Script to fetch contents of dossiers/packages
- Script to draw and perform statistics on player deck
- Script to draw and perform statistics on infection deck
- Script to add decals on top of player/infection/character cards
- Added some table space to make storing upgrades/characters/event cards easier.
- Created decals from all initial upgrades/jobs and portraits, however new ones will still need to be created.

All the scripts are self contained and if you prefer using some but not the others all of the should work standalone. You can even delete any Checker next to the buttons in order to get rid of the buttons for given script altogether.

If you have any questions about how scripts work just ask in the comments. If you found any bugs let me know and I will try my best to fix them.

All statistics done on decks simply amount to card counting and are equivalent to writing down starting composition of the deck and subsequently writing down what each player has drawn. It just makes it simpler.

Important Information about Usage and Functionality of the Scripts:
*** DISCLAIMER : I scripted this while trying to learn a bit of lua and have fun, scripts should be functional, but they are written in very hacky way. ***
1. Script to set up cards ( Under red checker in bottom right corner of the main table):
**Important** If you want sorting work on events, which get added in further months you need to change their name to "Event". I will probably patch it for events found in legacy deck, but most likely won't do it for events comings from other places.
Main function is performed after clicking setup cards button. After placing the deck in designated place it will separate epidemics, sort the deck, deal player cards according to number of players set and finally setup the player deck with epidemics and place it in correct location.
Otherwise it is also able to separate specific type of card from the deck (for example with the purpose of changing the events you are using).
Colours of players being dealt cards are hard coded and are White, Blue, Pink, Brown with increasing number of players.


2. Script to clean up the table ( Under white checker placed under the map):
***IMPORTANT*** for this script to work properly you can't get rid of supply cube bag, supply center bags or any subsequent bags with buildings that you get.

This script mainly cleans stockpiles/building/plague cubes and other elements of the map after the game.
It also allows for the setting of supply cube number, where if there is more supply cubes on the board they will
go to the reserve.
In case you want to have a building on the board permanently simply lock it in place by hovering over it and clicking L button. Those building will be ignored during clean up.

3. Script to fetch items from dossiers/packages (black checker next to legacy deck in top right corner of the board):
This script searches folder and finds packets and fetches items from packages.
To use it enter either name of package (for example 61 or F) or in the case of packages enter X followed by
package number into the black box above fetch item button. Afterwards press enter to confirm selection and press fetch item button.
Every subsequent item/(group of items in case of packages) will be placed in next position. After disposing/using all the contents of packages simply click reset position button.

4.Script to draw cards and perform statistics:
Ready deck button counts cards in the deck and saves their number. The same function is automatically called during first draw if the button wasn't clicked before. However if you want to restart statistics or start a second game simply put a deck in player deck area and click "Ready the Deck".
Coloured squares are easy way to deal 2 cards to the person of given colour. If you want statistics to function correctly you have to use them to draw cards.
Enable/Disable statistics button toggles whether or not players can see future cards distribution.
The probability shown for each card is the probability that during next draw at least one card is of that colour. Therefore it is expected that the probabilities don't sum to 1.
Number in the bracket means the number of cards left for the given colour.

5. Decal applying station.
Put one player/infection/character card and put one upgrade token/scar on top of it. Afterwards click add decal button, it should leave decal underneath the upgrade token.
If something didn't work properly you can always click remove decals, which will remove all decals form given card.
Finally because after exposure character card technically becomes different card, if you want to preserve decals from character card simply put character card in decal applying station and click "Add Exposure" button this should change the state of the card as well as preserve all decals.

6. Infection draw script.
The basic function of the script is to simply draw either top or in the case of epidemic bottom card. In addition it can also perform intensify step of epidemic (ie shuffle discard pile and place it on top of deck).
However the most complex function this script performs is card tracking of infection cards. At start of the game click "Setup Statistics" button in order for the script to count cards in the deck. Afterwards similar to player deck only use buttons in order to draw cards. On the table with sign "Infection Statistics" entries corresponding to each city and their count in each group will appear. When drawing top cards, they will always be drawn from "Group 1". When drawing bottom cards however you can be certain that it will be draw from the last existing group. Groups are calculated by keeping track of what cards are shuffled on top of the deck using "Intensify" button, so even if you take some cards out of discard pile using events card stats should still be accurate.

23 Comments
OperatorSkillet 16 Jun @ 7:35pm 
Thank you very much @Rob! I have done your changes and uploaded them here https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3501449155
Rob 15 Jun @ 4:01pm 
I was missing two different table files, but I think I found a solution.
For the first missing model file, change the model like to
https://pastebin.com/raw/JpPS3kqt
The load the model and apply it to the 17 others.
It will say another model is missing, change that model link to
http://pastebin.com/raw/7Y9j1Fz2
and apply it to one other.
All the tables should be loaded correctly. I'm not sure how to make this permanent though.
뜨아거 9 Jun @ 8:28pm 
http://pastebin.com/raw/7Y9j1Fz2

Use this link for modeling @OperatorSkillet
OperatorSkillet 5 May @ 12:50pm 
Models are broke.
douCC_735 27 Dec, 2024 @ 7:13pm 
This is a well-done creation. The partial scripts are super helpful as well as the statistics. Good job jakub530!
ManualRocket 11 Jul, 2023 @ 5:26pm 
Where are the city cards for when you connect cities?
whodack 12 May, 2023 @ 11:06pm 
@ reamonntiu
Use the Attach tool instead of the decal station. It's available on the left nav. Combine->Attach
reamonntiu 9 Aug, 2022 @ 6:11am 
When I put on some of the upgrades using the decal station, they come out sideways. And when I try to do it manually the picture is too small, so when I enlarge it the text is hard to read.
Stoffel 12 Jun, 2021 @ 8:37pm 
Verified problem (pkg 2 spoiler): Tehran is misspelled as "Teheran" in the script . Can fix by editing script, possibly also by editing card to match misspelling.

Hints on how to deal with (July-ish Spoiler) Hollow Men Gather cards in the infection deck:


1. Put Hollow Men Gathers (HMG) cards in the discard area.
2. Shuffle the face-down infection deck.
3. Add HMG to top of infection deck face-down, NOT shuffling it.
4. Click "Setup Statistics". Script now knows about HMG cards.
5. "Draw top card" for each HMG, then draw starting 9 infection cards.


Removing cards from the infection deck for any reason also messes it up; stamp with a temporary decal keep drawing when they come up, then remove them after the game.
whodack 2 Apr, 2021 @ 12:46pm 
For anyone using this, I think I found and fixed a bug in the LUA scripting.

Right click on the checker near infection deck and go to scripting. Click on Checker White. Scroll down to function init_statistics()

Card_Counts[ obj.name ] = Card_Counts[ obj.name ] + 1

should be

Card_Counts[ obj.name ] = (Card_Counts[ obj.name ] or 0) + 1