Tabletop Simulator

Tabletop Simulator

Gloomhaven - TTS Enhanced v1.2
Sebästschjin  [developer] 11 May, 2022 @ 12:12am
Repack Behaviour
In response to the latest discussion about the repack behavior, I want to summarize and elaborate on in a bit. Since the limmit on comments is only 1000 characters, I'll do it in a topic.


How does it work
When you pack up a character, the mod tries to figure out what each object in a player's zone is supposed to be. If it can do this, it saves the information about it, but not the object itself, just what it thinks it needs. E.g. it stores that a character has an item named "Poison Dagger", or an ability named "Trample" in it's hand, but there's no reference to the actual object that is present on the table.
When this character than is unpacked again, this information is read and the relevant real objects are retrieved from wherever they typically are can be found. This also means a fresh character box is pulled from the class box and the actual character box that is unpacked is pretty much ignored.
All other objects are deleted and they are not put into the packed up character box. The only objects that are put into the box (in addition to saving it's information), are items and personal quests. The reasons is that those are limited by the game rules. So when you pack up lots of characters with items you lose access to those items untill the characters sell them.

Why is it this way
Mostly due to technical simplicity. The process described above, is the same mechanisms that is used to save a character, when you use the Campaign Manager to transfer a campaign between different versions of the mod. Since the Campaign Manager also can transfer packed up characters there needed to be a mechanisms to save those, too (assuming the pack up mechanisms stayed the same from FS). So instead of writing a custom script to do that, it just reuses the same mechanisms as saving a regular character, because it seemed to do all things that are relevant. Considering all customization wasn't done at this point.

Advantages
The new mechanisms has advantages over one from FS:

  • When you pack up the character, all it's enhancements are also applied on the class box. So when you then pull a fresh character, it also has the enhancements of the packed character applied. This mimics the behavior of enhancements from the physical game.
  • Items are equipped as they were, when packing up.
  • The current ability deck for a character is restored and only abilities that where previously in the hand are placed in the hand again. All other abilities move to the second hand.
  • Perks and max HP are automatically applied. E.g. you could tick a perk box, pack and unpack the character, and the perk will be applied and the max HP will be set according the character leve. This isn't an explicit develped feature, but more a byproduct of reusing the mechanism of the Campaign Manager.

Disadvantages

  • Curses, blesses or other modifications to the attack modifier deck are lost.
  • Any custom objects in a player zone are lost, because they get deleted.

How to mitigate the disadvantages

  • If you only rarely pack up, you can move all custom objects out of the player zone somewhere else and store it separately.
  • If you have changes that are permanent (e.g. a custom model for the character, changed attacked modfiiers, etc.), the best is to simply replace the default character. Grab a fresh character from the class box, modify it to your liking and right-click on the class box to use the "Reset" command. Then place your modified character box into the class box. From now on every fresh character will be the modified one, which also applies to repacking a packed up character.
  • You can use this mod: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2805867168. This will restore the old behavior know from FS, but you will lose all the advantages listed above. If you go this route, please check on every update of the mod, if this is still relevant, because otherwise you might lose on newer features.

Custom additions
One of the custom additions mentioned, that is lost with the current method is using custom summons. When the next version (1.3) is released, there will be an easier way to add/replace summons to you liking, while also having the benefit of using the summon buttons on summon cards.

For 1.2 you can do this, too but it's a bit more work.

First paste the following code into the chat window:
/execute for _, bag in ipairs(getObjectsWithTag("Bag of Summons")) do bag.setPosition({0, 3, 0}) bag.interactable = true bag.setLock(false) end

This will spawn a bag in the middle of the table.
Draw an object from the bag. This bag then contains all summons in the game (be aware of spoilers).
Search for the one you want to replace and pull it from the bag. The summon itself is actually a bag again. Right-click it and use the "Reset" command. Then place in your custom summon. It doesn't matter that the bag still looks like the old one, what's important is it's content.
Put that modified summon bag back into the bag with all summons.
Then right-click the big bag that spawned in the middle and use "Reset" on it.
Put the bag with all summons in there and you are done.
Keep this bag save somewhere and don't delete it.

Replacing the figure of a character with a custom one, is also possible.

First create the figure the way you want. Then right-click it and use the menu "Scripting -> GUID" to copy it's ID to your clipboard. In the two scripts below, replace "new" with this copied ID. Do the same for the original figure and replace "orig" in the scripts below.

Then copy this script and paste it into the chat window of the game.
/execute local s = getObjectFromGUID("orig") local d = getObjectFromGUID("new") d.setName(s.getName()) d.setDescription(s.getDescription()) d.script_code = s.script_code d.script_state = s.script_state

Afterwards do the same with this script.
/execute local s = getObjectFromGUID("orig") local o = getObjectFromGUID("new") local d = o.getData() d.XmlUI = s.UI.getXml() o.destruct() spawnObjectData({data=d})

Now the adjusted figure is the same as the original (in terms that the mod cares about), e.g. it uses the same script and UI. So you can now use it to your liking and maybe replace it in the original class box with the method mentioned above.
< >
Showing 1-2 of 2 comments
Noka 29 May, 2022 @ 12:07am 
"The only objects that are put into the box (in addition to saving it's information), are items *and personal quests.*"

I just want to reiterate since I don't see it mentioned - placing the Personal Goal into the temporary box post-deployment for safekeeping (a common thing in my friend circle) will result in the goal getting dumped out into the goal deck. Really hoping that gets fixed in 1.3 so the goals stick with the characters - or at least pop into hidden zones to prevent other players from potentially peeking!
Sebästschjin  [developer] 30 May, 2022 @ 9:52am 
Yeah that's fixed in 1.3.
However, using a hidden zone seems a bit overkill. Don't know why anyone would want to peek at your PQ. ^^"
< >
Showing 1-2 of 2 comments
Per page: 1530 50