View Single Post
  #1  
Old May 2nd, 2021, 09:16 AM
A3n's Avatar
A3n A3n is offline
"Let's Nut this Unit Out!"
 
Join Date: April 10, 2008
Location: Australia - Queensland - Nth Rockhampton
Posts: 20,032
Images: 59
A3n is a man of the cloth A3n is a man of the cloth A3n is a man of the cloth A3n is a man of the cloth A3n is a man of the cloth A3n is a man of the cloth A3n is a man of the cloth A3n is a man of the cloth A3n is a man of the cloth A3n is a man of the cloth A3n is a man of the cloth A3n is a man of the cloth A3n is a man of the cloth A3n is a man of the cloth A3n is a man of the cloth
Tabletop Simulator - Heroscape Adding Maps to A3n's script

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:

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.


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.


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.


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.


Done!


This script may not be the most elegant of solutions & if you think of a better way please let me know.

Last edited by A3n; May 3rd, 2021 at 01:18 AM.
Reply With Quote