Hello fellow 'scapers.
Somebody (awesome) created this a brilliant Heroscape mod for Tabletop Simulator. I only know it as the Kraken Table. I don't know who did it but a lot of time & effort was put into it. Thank you whoever it was for all your efforts.
I have spent a bit of time adding a few scripts to this mod.
For the Map Menu, currently there are numerous C3G maps already added. This thread is a tutorial on how to add another map to the mod that has my script. Hit me up sometime for the latest version. Or one of the C3G heroes should have a fairly recent version if not the latest.
So let's get into it:
What you will need:
1/. At the end of the table, hit the Customize Board button.
2/. Next choose Grid from the Options menu.
3/. Check Show Lines.
4/. Build your map. Uncheck Show Lines. Then take a screen capture of the map.
5/. Paste the screen capture into Photoshop (or other editing app). Remove the background & make it a presentable picture that is about 200 x 144 pixels. I have a Photoshop template here that you can use. Save this image for later.
6/. Back in TTS, on the end of the table again, hit the Copy Map Setup button.
7/. Open the Notebook from the menu. Got to the new note page labelled Capture Map_0. Copy all the text from this tab.
8/. In Atom from the Packages menu, in the Tabletop Simulator sub-menu, choose Get Lua Scripts. Then open a new file & paste the text. From the Find menu choose Replace in Buffer. In the "find" value enter map_name. In the "replace" value enter the name of your map. Press Replace All.
8a/. In the 2nd & 3rd line change the words "map_type" to one of: "mapsC3Gcomp" (C3G Competitive map), "mapsC3Gcasual" (C3G Casual map), "mapsWoS" (Wargrounds of Scape map), "mapsWF" (C3G Worlds Finest map) or "mapsFFU" (C3G Fantastic Forces Unite).
8b/. In the 3rd line change the words "IMG_Map_map_name" to be without spaces or punctuation for the "map_name" as per step 12.
9/. Save this map file. You should have a Tabletop Simulator folder in your My Documents folder. Save the file here with the extension .ttslua.
10/. From the Modding menu choose Scripting.
11/. From this scripting window, press the Custom UI Assets tool button in the top-right corner. From the next pop-up window press the largish "+" button.
12/. In the Create Asset window enter a name for the image. To keep to my naming convention use IMG_Map_mapname.
13/. Hit the Folder icon of the image line. Choose Cloud when prompted. Then press Import.
--no longer required to complete:
17/. From the Packages menu, in the Tabletop Simulator sub-menu, choose Save and Play.
18/. Back in Tabletop Simulator, from the Games menu, choose Save and Load. Save the new version of the mod.
FURTHER INFORMATION:
Ok so it appears that if you don't have the files already you cannot (obviously) add to them. So you need to take further steps to initially set it up.
You need to create a folder (usually) in your documents folder. The path to which is specified in the Atom Settings:
If it doesn't already exist create the "Tabletop Simulator" folder then create a sub-folder "HS_Maps". For me the folder structure looks like: C:\Users\amaxs\Documents\Tabletop Simulator\HS_Maps\.
If you can get the files from somebody else (even if it's not the most up-to-date) it may save you a lot of effort. Put the map files you get into this folder.
Next I will explain my understanding of how Atom & TTS scripting interact. So to make things modular & a little easier to understand, Atom allows you to include other files in your script by using the #include <folder/filename> statement. What Atom does when exporting back to TTS is whenever it comes across a #include statement it opens the file, from your folder set above, & copies all the text from it & inserts it into the the uploaded script at the place where the statement occurred. It also precedes & follows the inserted text with "----#include <folder/filename>". For example:
So now back to step 8 above: "8/. In Atom from the Packages menu, in the Tabletop Simulator sub-menu, choose Get Lua Scripts. Then open a new file & paste the text." you are going to either see just the #include statement or the commented statement with the script from the file included already. In the settings you can change what you actually get in Atom. By default Atom is set to show the #include statement but it won't download the associated files. You can change the settings to download the full script:
Don't forget to get the script again after changing the settings so you can see the changed script.
What you can do if you don't have the files is: from the full script copy the script between the two commented statements & paste into a new file with the same name as used in the #include statement with an extension of ".ttslua".
Just remember some will be nested. E.g. The Global.ttslua has #include HS_maps/Map_List then the Map_List.ttslua file has #include Map_Grundys_Grave. So the full script will look like :
You don't necessarily need all files to make the changes to include new maps. However you will continue to receive missing file errors without them. I believe the minimum you would need is the Map_List.ttslua file to add your included map file.
This script may not be the most elegant of solutions & if you think of a better way please let me know.
Somebody (awesome) created this a brilliant Heroscape mod for Tabletop Simulator. I only know it as the Kraken Table. I don't know who did it but a lot of time & effort was put into it. Thank you whoever it was for all your efforts.
I have spent a bit of time adding a few scripts to this mod.
- Map Menu - that allows for loading a range of maps.
- Map Capture - for the Map Menu. This uses a lot of code from the GIT GUID Tool by Felixinius.
- Dice Tray Dice Roller - I used the Apocalypse Dice Tray by Shoebaca & have added a menu to select number of dice to roll.
- Playtest Note Taker - Using the Dice Roller & chat commands to record what is happening in the game.
For the Map Menu, currently there are numerous C3G maps already added. This thread is a tutorial on how to add another map to the mod that has my script. Hit me up sometime for the latest version. Or one of the C3G heroes should have a fairly recent version if not the latest.
So let's get into it:
What you will need:
- Photoshop or other image editing app.
- Atom https://atom.io/ (I just read, today 16/2/22, that MS Visual Studio Code works as well - but I haven't tried it so you are on your own with it.)
- The Tabletop Simulator Lua Atom package https://atom.io/packages/tabletopsimulator-lua.
- Of course Tabletop Simulator
- And The Kraken Table mod with my script in it.
1/. At the end of the table, hit the Customize Board button.
2/. Next choose Grid from the Options menu.
3/. Check Show Lines.
4/. Build your map. Uncheck Show Lines. Then take a screen capture of the map.
5/. Paste the screen capture into Photoshop (or other editing app). Remove the background & make it a presentable picture that is about 200 x 144 pixels. I have a Photoshop template here that you can use. Save this image for later.
6/. Back in TTS, on the end of the table again, hit the Copy Map Setup button.
7/. Open the Notebook from the menu. Got to the new note page labelled Capture Map_0. Copy all the text from this tab.
8/. In Atom from the Packages menu, in the Tabletop Simulator sub-menu, choose Get Lua Scripts. Then open a new file & paste the text. From the Find menu choose Replace in Buffer. In the "find" value enter map_name. In the "replace" value enter the name of your map. Press Replace All.
8a/. In the 2nd & 3rd line change the words "map_type" to one of: "mapsC3Gcomp" (C3G Competitive map), "mapsC3Gcasual" (C3G Casual map), "mapsWoS" (Wargrounds of Scape map), "mapsWF" (C3G Worlds Finest map) or "mapsFFU" (C3G Fantastic Forces Unite).
8b/. In the 3rd line change the words "IMG_Map_map_name" to be without spaces or punctuation for the "map_name" as per step 12.
9/. Save this map file. You should have a Tabletop Simulator folder in your My Documents folder. Save the file here with the extension .ttslua.
10/. From the Modding menu choose Scripting.
11/. From this scripting window, press the Custom UI Assets tool button in the top-right corner. From the next pop-up window press the largish "+" button.
12/. In the Create Asset window enter a name for the image. To keep to my naming convention use IMG_Map_mapname.
13/. Hit the Folder icon of the image line. Choose Cloud when prompted. Then press Import.
--no longer required to complete:
Spoiler Alert!
14/. In Atom, from the Project section select the Global.-1.xml. Find the section that has the table that is the menu. It will be a set of "<row>" tags that will have 1-4 "<cell>" sets of tags. Copy one of the "<cell>" sections & paste it further down but before the section that is the divider. It looks like this:
<Row preferredHeight="40">
<Cell columnSpan="4">
<text></text>
</Cell>
</Row>
15/. Change the ID & TEXT to the map name in this cell you have pasted in. Change the IMAGE to be the name you entered in step 12.
16/. From the Project section select the Map_List.ttslua file. Add a new line "#include " with the map name you saved at step 9, but without the .ttslua extension.
<Row preferredHeight="40">
<Cell columnSpan="4">
<text></text>
</Cell>
</Row>
15/. Change the ID & TEXT to the map name in this cell you have pasted in. Change the IMAGE to be the name you entered in step 12.
16/. From the Project section select the Map_List.ttslua file. Add a new line "#include " with the map name you saved at step 9, but without the .ttslua extension.
17/. From the Packages menu, in the Tabletop Simulator sub-menu, choose Save and Play.
18/. Back in Tabletop Simulator, from the Games menu, choose Save and Load. Save the new version of the mod.
FURTHER INFORMATION:
Ok so it appears that if you don't have the files already you cannot (obviously) add to them. So you need to take further steps to initially set it up.
You need to create a folder (usually) in your documents folder. The path to which is specified in the Atom Settings:
If it doesn't already exist create the "Tabletop Simulator" folder then create a sub-folder "HS_Maps". For me the folder structure looks like: C:\Users\amaxs\Documents\Tabletop Simulator\HS_Maps\.
If you can get the files from somebody else (even if it's not the most up-to-date) it may save you a lot of effort. Put the map files you get into this folder.
Next I will explain my understanding of how Atom & TTS scripting interact. So to make things modular & a little easier to understand, Atom allows you to include other files in your script by using the #include <folder/filename> statement. What Atom does when exporting back to TTS is whenever it comes across a #include statement it opens the file, from your folder set above, & copies all the text from it & inserts it into the the uploaded script at the place where the statement occurred. It also precedes & follows the inserted text with "----#include <folder/filename>". For example:
If you have a file like:
Then the statement in the referring script will look like:
But what is uploaded to TTS actually looks like:
Then the statement in the referring script will look like:
But what is uploaded to TTS actually looks like:
So now back to step 8 above: "8/. In Atom from the Packages menu, in the Tabletop Simulator sub-menu, choose Get Lua Scripts. Then open a new file & paste the text." you are going to either see just the #include statement or the commented statement with the script from the file included already. In the settings you can change what you actually get in Atom. By default Atom is set to show the #include statement but it won't download the associated files. You can change the settings to download the full script:
Don't forget to get the script again after changing the settings so you can see the changed script.
What you can do if you don't have the files is: from the full script copy the script between the two commented statements & paste into a new file with the same name as used in the #include statement with an extension of ".ttslua".
Just remember some will be nested. E.g. The Global.ttslua has #include HS_maps/Map_List then the Map_List.ttslua file has #include Map_Grundys_Grave. So the full script will look like :
----#include HS_maps/Map_List
----#include Map_Grundys_Grave
... the script ...
----#include Map_Grundys_Grave
----#include HS_maps/Map_List
----#include Map_Grundys_Grave
... the script ...
----#include Map_Grundys_Grave
----#include HS_maps/Map_List
You don't necessarily need all files to make the changes to include new maps. However you will continue to receive missing file errors without them. I believe the minimum you would need is the Map_List.ttslua file to add your included map file.
This script may not be the most elegant of solutions & if you think of a better way please let me know.
Last edited: