• Welcome to the Heroscapers 2.0 site! We've still got some dust to clear and adjustments to make, including launching a new front page, but we hope you enjoy the improvements to the site. Please post your feedback and any issues you encounter in this thread.

Tabletop Simulator - Heroscape Adding Maps to A3n's script

A3n

"Let's Nut this Unit Out!"
Site Supporter
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.
  • 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.
NewMap_01.jpg


2/. Next choose Grid from the Options menu.
NewMap_02.jpg


3/. Check Show Lines.
NewMap_03.jpg


4/. Build your map. Uncheck Show Lines. Then take a screen capture of the map.
NewMap_04.jpg


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.
NewMap_05.jpg


6/. Back in TTS, on the end of the table again, hit the Copy Map Setup button.
NewMap_06.jpg


7/. Open the Notebook from the menu. Got to the new note page labelled Capture Map_0. Copy all the text from this tab.
NewMap_07.jpg


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.
NewMap_08.jpg

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.
NewMap_09.jpg


10/. From the Modding menu choose Scripting.
NewMap_10.jpg


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.
NewMap_11.jpg


12/. In the Create Asset window enter a name for the image. To keep to my naming convention use IMG_Map_mapname.
NewMap_12.jpg


13/. Hit the Folder icon of the image line. Choose Cloud when prompted. Then press Import.
NewMap_13.jpg


--no longer required to complete:
Spoiler Alert!


17/. From the Packages menu, in the Tabletop Simulator sub-menu, choose Save and Play.
NewMap_16a.jpg


18/. Back in Tabletop Simulator, from the Games menu, choose Save and Load. Save the new version of the mod.
NewMap_17.jpg




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:
Atom_TTS_Settings.png

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:
Atom_include_file.png

Then the statement in the referring script will look like:
Atom_include_statement.png

But what is uploaded to TTS actually looks like:
Atom_include_coded.png


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:
Atom_TTS_Settings_02.png

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​

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:
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.

Well it is only a few threads under this one, if we are talking about the same thing. :)
Right here.
 
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.

Well it is only a few threads under this one, if we are talking about the same thing. :)
Right here.

I looked at that post in the TTS Workshop forums & the picture didn't look like the Kraken Table. But if it is any of them (Dissonance and jawa64) then all props to them. Thank you guys.
 
I followed all the steps but I am missing the Map_List.ttslua file in my project.
 
I only have the "Tabletop Simulator Lua" folder. No HS_maps folder.
 
I only have the "Tabletop Simulator Lua" folder. No HS_maps folder.

ok. how about in your My Documents folder is there a Tabletop Simulator folder? And does it have any other folders or files in it?
 
I have a My Games folder in my Documents folder and in there is Tabletop Simulator. Inside that are: DLC, Mods, Saves, and Screenshots.
 
Ok, I think I know what is happening now but I am not sure how to proceed further at this point as my PC started playing up this weekend. :(

So from my understanding the Atom editor is doing the work of ingesting all the #include files into the single script where the statement is. When you download the file though I don't know what it is doing in the reverse of this if you don't have the files already saved. From what I have read the #include statement is put back the text that would normally be in the included file is removed. But it must reside somewhere.

Anyway the thing I was going to try, is that in the TTS plugin settings in Atom there is an option to turn of the #include. This apparently puts the script from the file back in the global script with remarks beginning & end to indicate that it is supposed to be a file. Anyway my thought was to turn the option off grab the script & save it in a file of the correct name. then set the option back close Atom & restart it & see if it works using that file.

I do believe you are IT savvy enough to try this if you like Q.
 
If you have any links, I'd appreciate them. I'm not seeing an y option to turn off #include.

Also, if you could zip up the files and upload them, I could download them and try again.
 
Sadly, that gives me nothing to go on. Let me know if you can send the files my way.
 
Ok so I have now had the experience of getting this up & going without having the setup of the creator (me) as I have since swapped out hard drives & reinstalled a fresh Windows 10.

Anyway, you need to create a folder (usually) in your documents folder. The path to which is specified in the Atom Settings:
Atom_TTS_Settings.png

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\.

Now I don't know if this is totally necessary for you to add new content (I did it anyway), but 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:
Atom_include_file.png

Then the statement in the referring script will look like:
Atom_include_statement.png

But what is uploaded to TTS actually looks like:
Atom_include_coded.png


So now back to the OP, when you do step 8 "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:
Atom_TTS_Settings_02.png

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 need the files but don't have them already 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​

Now I don't know if you need all files to make the changes to include new maps as I already had all the files. It is my assumption that you would only need the Map_List.ttslua file to add your included map file. Then of course make all the other changes outlined in the OP.

Cheers
 
Last edited by a moderator:
Hello,

I have done a little update to the script of this TTS Mod. I have passed it on to @IAmBatman who will pass it to Japes to update the Workshop version.

With this update I have simplified the adding of maps to the menu system. As such I updated the instructions in the OP to include:
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.

This has made steps 14-16 (inclusive) redundant now.

Also with this update I added 3 boards Space, Sky & Asphalt. Select these from the C3G Casual Maps menu & it should place them on the table with the hexes aligned to the grid. then you can add terrain & create a whole new map that will include the board as per the OP instructions.

I have also added mats that are for the @Cavalier City Mats (version 1 & 2), @A3n Cosmic Mat, & the Astral Plane. These may require alignment to grid when designing your map but once positioned & saved as a map (as per the OP instructions) they should work fine.

Cheers
 
Hello,

I have done a little update to the script of this TTS Mod. I have passed it on to @IAmBatman who will pass it to Japes to update the Workshop version.

With this update I have simplified the adding of maps to the menu system. As such I updated the instructions in the OP to include:
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.

This has made steps 14-16 (inclusive) redundant now.

Also with this update I added 3 boards Space, Sky & Asphalt. Select these from the C3G Casual Maps menu & it should place them on the table with the hexes aligned to the grid. then you can add terrain & create a whole new map that will include the board as per the OP instructions.

I have also added mats that are for the @Cavalier City Mats (version 1 & 2), @A3n Cosmic Mat, & the Astral Plane. These may require alignment to grid when designing your map but once positioned & saved as a map (as per the OP instructions) they should work fine.

Cheers

:bump: for @japes
 
Back
Top