Betrayal at House on the Hill Tabletop Simulator scripted

Welcome to Gloomhaven - Fantasy Setup 2.0! This mod contains the full game + the Forgotten Circles expansion, it is based on the second printing, ...

동영상

이 동영상에서 중요한 부분 25개

2018. 7. 29.Load the table up by itself and find the button on the left side, toward the far end. You'll have to rotate/zoom around and click "through" the ...

Hey guys, We have basically created the digital version of this awesome game, to enjoy with your friends through the power of internet, in case they are far ...

Simplify the management of your Gloomhaven campaign progress in Tabletop Simulator. ... version of the Gloomhaven Fantasy Setup Mod for Tabletop Simulator.

... level 8 Harrower Plagueherald (Heather) TTS Mod: Gloomhaven - Fantasy Setup (Scripted UI) Watch my How to Play Gloomhaven tutorial video ...

RogueWatson · RogueWatson · 2021. 1. 26.

2020. 3. 18.Det er så her, hvor “TTS Gloomhaven – Fantasy Setup” modet virkelig gør noget godt. For når du har valgt, hvilket scenarie du vil spille, så en ...

Apr 17, 2020 - Steam Workshop: Tabletop Simulator. https://i.imgur.com/83Yutuc.gif Welcome to Gloomhaven - Fantasy Setup 2.0! This mod contains the full ...

Andy Van Zandt

United States
South Ogden
Utah

Betrayal at House on the Hill Tabletop Simulator scripted

TrickOrTreatStudios.com/Games

Betrayal at House on the Hill Tabletop Simulator scripted

TrickOrTreatStudios.com/Games

Betrayal at House on the Hill Tabletop Simulator scripted

Betrayal at House on the Hill Tabletop Simulator scripted
Betrayal at House on the Hill Tabletop Simulator scripted
Betrayal at House on the Hill Tabletop Simulator scripted

Something I've found that makes things easier for me is to use scripting zones to add and remove tags to stuff that moves in and out of it. So for example, I would make a scripting zone by clicking the tool indicated on the left, and clicking on the table and dragging out a small rectangle area:

Betrayal at House on the Hill Tabletop Simulator scripted


After I make the scripting zone, I need to save and load the mod again, because of the quirks of TTS.

Then I right click the scripting zone I just made, choose "scripting", then "scripting editor", and paste this code into the window that pops up:

Quote:

function onObjectEnterScriptingZone(zone, object_entering)
object_entering.addTag("Discards")
end

function onObjectLeaveScriptingZone(zone, object_leaving)
object_leaving.removeTag("Discards")
end

Then I click "save and play".

This adds a tag called "Discards" to any object that touches any scripting zone, and removes it when it stops touching the zone. The tag doesn't need to be "Discards", it could be any word or phrase you want, like "SillyOldBear". And you can have lots of different tags, even on the same object, if you need the tags to do different things. Just copy and paste the above code again, and change "Discards" to whatever you want.

What can I do with this? Well, now I can move everything that has this tag somewhere. For example, If the area I made is the Discard pile for a deck, I could have it move all the things there back to the deck area. I make a second scripting zone where I want the deck to go and save and load the mod. Then I add this script to the second scripting zone by right clicking it, choosing "scripting" and "scripting editor", and pasting this in:

Quote:

function onLoad()
self.createButton({
click_function="click_refillDeck", function_owner=self,
rotation={x=0, y=180, z=0}, position={0,-0.5,0}, height=200, width=500, color={1,1,1,1}, label="Refill"
})

rot_offset = {x=180, y=0, z=0}
end

function click_refillDeck()
local ThingsWithDiscardTag = getObjectsWithTag("Discards")
CardDeckArea = getObjectFromGUID("??????")
DeckPosition = CardDeckArea.getPosition()
local rot = self.getRotation()
rotation = {rot.x+rot_offset.x, rot.y+rot_offset.y, rot.z+rot_offset.z}

for _, obj in ipairs(ThingsWithDiscardTag) do
obj.setPositionSmooth(DeckPosition)
obj.setRotationSmooth(rotation)
end
end

You do need to change one part of this - where it says

Quote:

CardDeckArea = getObjectFromGUID("??????")

You need to change the question marks to the GUID of the second scripting zone you made (the GUID is a six-character-long unique identifier for the scripting zone. Everything on the table has a GUID). Since we're putting this script on the scripting zone this affects, the GUID should conveniently be right at the top of the window you're typing in, after the words "Scripting Trigger -". Just delete the question marks in the code and replace them with that 6-character GUID.

Betrayal at House on the Hill Tabletop Simulator scripted


This script does several things. It creates a button where the second scripting zone is. When the button is clicked, it takes everything with the "Discards" tag, flips it face-down, and moves it on top of the button.

You probably want to shuffle the deck now, right? Just before the last "end" in the code above, paste the following:

Quote:

if #ThingsWithDiscardTag > 0 then

Timer.destroy("BriefPause"..self.getGUID())
Timer.create({
identifier = "BriefPause"..self.getGUID(),
function_name = "ThenShuffle",
function_owner = self,
delay = 2
})
end
end

function ThenShuffle()

CardDeckAreaAgain = getObjectFromGUID('??????')
EverythingOnTheButton = CardDeckAreaAgain.getObjects()

for _, obj in ipairs(EverythingOnTheButton) do
if obj.tag == "Deck" then
obj.shuffle()
end
end

This confirms that at least one thing was moved over, waits briefly for everything to finish moving, checks if there is now a deck on top of the button, and shuffles it if there is. Again, change the ?????? to the GUID in the title of your own scripting window. Click "save and play" to test it out.

Maybe I've got lots of scripting zones for other purposes, and I don't want every scripting zone on the table tagging everything with "Discards"? Change the script on the first zone to this:

Quote:

function onObjectEnterScriptingZone(zone, object_entering)
if zone.getGUID() == "AAAAAA" then
object_entering.addTag("Discards")
end
end

function onObjectLeaveScriptingZone(zone, object_leaving)
if zone.getGUID() == "AAAAAA" then
object_leaving.removeTag("Discards")
end
end

Change the AAAAAA in the code to the GUID of the zone - again, this should just be at the top of the window the script is in. Now it only adds the tag if the object moves into or out of that specific scripting zone.

Maybe you don't want that, though - maybe you've got lots of different spots on the table with cards, and you want the button to grab them ALL and group them back into a single place. Just leave the first code the way it was and make some more scripting zones. The button will grab everything from all of those zones.

Or maybe you've got a scripting zone covering a huge area that includes things other than cards, and you don't want the button to grab things that aren't cards? This script will only tag CARDS that enter the zone with "Discards":

Quote:

function onObjectEnterScriptingZone(zone, object_entering)
if zone.getGUID() == "AAAAAA" and object_entering.tag == "Card" then
object_entering.addTag("Discards")
end
end

function onObjectLeaveScriptingZone(zone, object_leaving)
if zone.getGUID() == "AAAAAA" and object_leaving.tag == "Card" then
object_leaving.removeTag("Discards")
end
end

The scripting zones aren't normally visible unless you are using that tool, or the move/resize gizmo. If it's hard for you to keep track of where things are, before you start you might want to put a card on the table and draw a box around it with the "Draw" tool on the left. Then you can use that box as a reference for making your scripting zone.

The above code all puts the "Refill" button underneath the deck, so you can only click it when it's empty. If you want to be able to click it to move things over even while there are still cards (or whatever) in the space, change this code on the second scripting zone:

Quote:

rotation={x=0, y=180, z=0}, position={0,-0.5,0}, height=200, width=500, color={1,1,1,1}, label="Refill"

in the part that says "position={0,-0.5,0}" change either the first zero or the last zero to a 1 or a -1. This will put the button next to, above, or below the deck area, depending on which zero you change. You can change it to a bigger number to move it further.

---

There are other ways to do this that don't use tags, but I like this method for a couple of reasons. I can check to make sure it's adding and removing the tag by right clicking the objects that go into the zone and clicking "Tags" (If the tag isn't there, I know which part of the code isn't working and why the cards aren't moving). And I can use tags to easily do other things - for example, I might choose to trigger events when I drop a card somewhere... as long as it doesn't have a particular tag. And then at the end of that code, I can add the tag to it so it doesn't happen again if I just move the card slightly. But maybe that card could get discarded and shuffled back into the deck, and then come into play again later? So I could have the discard pile also strip off that tag, so the "when this is dropped" trigger can happen again later. So the tags make it easier for me to mentally group and easily track what's happening.