Tabletop Simulator

Tabletop Simulator

Gloomhaven - Fantasy Setup (Scripted UI)
Bayesianmind Apr 26, 2020 @ 10:24pm
[patch] Draw monster modifier button on Battle Interface
We really love the player draw attack modifier buttons and wanted something for the monsters too.

Add this to the global lua script to get this functionality:
function getPlayArea() local hitlist = Physics.cast({ origin = {0.00, 1.73, - 16.67}, direction = {0, 1, 0}, type = 3, size = {1, 1, 1}, max_distance = 0, debug = false }) for u, v in pairs(hitlist) do if v.hit_object.getName() == "Play Area" then return v.hit_object end end return nil end function MMDraw() local playArea = getPlayArea() if playArea == nil then return end playArea.call("buttonClickedEx", {"AMD"}) end

In the layout global code, find the BattleInterface panel (also modify solo mode version of the panel):
<Button onClick="MMDraw"> <Text>Draw MONSTER modifier</Text> </Button>
Last edited by Bayesianmind; Apr 26, 2020 @ 10:32pm
< >
Showing 1-8 of 8 comments
Kijan  [developer] Apr 27, 2020 @ 12:15am 
didnt you look in the update news?^^
• Scripting Button 3 draws monster attack modifier
CuddlyZombie Apr 27, 2020 @ 12:27am 
I've been using scripting button 3 like mad, and loving it, but It might be nice having it in the Battle Interface as well. At the very least, I'll be using this!
Last edited by CuddlyZombie; Apr 27, 2020 @ 12:27am
Kijan  [developer] Apr 27, 2020 @ 12:30am 
we did not want to overload the whole interface. we have to discuss if we bring one in.
gudy Apr 27, 2020 @ 4:22pm 
Button to draw from monster deck
I like keeping the camera on the battle field as much as possible, so I added a button to draw from the monster deck in the battle interface. If anyone is interested, all you need is to add the following to the Global script :
function getPlayArea() local hitlist = Physics.cast({ origin = {0.00, 1.73, - 16.67}, direction = {0, 1, 0}, type = 3, size = {1, 1, 1}, max_distance = 0, debug = false }) for u, v in pairs(hitlist) do if v.hit_object.getName() == "Play Area" then return v.hit_object end end return nil end function drawMonsterClicked(player, value, id) local playArea = getPlayArea() if playArea ~= nil then playArea.call("buttonClickedEx", {"AMD"}) end end

and this to the global xml:
line 98 replace :
<Image image="BI Text" ignoreLayout="true" width="170" offsetXY="0 105"></Image> <Text></Text> <HorizontalLayout spacing="5">
by :
<Image image="BI Text" ignoreLayout="true" width="170" offsetXY="0 105"></Image> <Text></Text> <Button onClick="drawMonsterClicked"> <Text>Draw Monster Modifier</Text> </Button> <HorizontalLayout spacing="5">
Last edited by gudy; Apr 27, 2020 @ 4:22pm
benji.bugnet Apr 27, 2020 @ 5:59pm 
Did you know you can already do that by pressing 3 on numpad ?
Kijan  [developer] Apr 28, 2020 @ 12:35am 
maybe you look into the discussions before posting. this was allready posted from someone.
https://steamcommunity.com/workshop/filedetails/discussion/1301493206/2259061617890779477/
gudy Apr 28, 2020 @ 6:48am 
Originally posted by benji.bugnet:
Did you know you can already do that by pressing 3 on numpad ?
thanks, I didn't know that. I only updated yesterday after a playing for a month... and I missed that one ;)
XarXar Apr 28, 2020 @ 9:24am 
some players may not have a numpad. for example they are not included in some laptop keyboards configurations.
< >
Showing 1-8 of 8 comments
Per page: 1530 50