Tabletop Simulator

Tabletop Simulator

Erik's D&D Tools - Encounter
55 Comments
Kenjamin 9 Jun @ 11:14pm 
I feel so dumb, so let me share for everyone else in case they come across this issue. I had the infection and thought that the clean up cube did its job. It didn't. I tried the deep clean one as well, but it would crash the game after 5 minutes of locking up. I figured the original cube did it's job but there were so many objects nested in bags and such that it didn't search them all. I was able to download a python script from github that cleaned all the files outside of the game and now it loads fine. I had to delete the Encounter object and remake the saved bag, but it loads just fine now.

The link to the python script is https://github.com/khaaarl/tts-save-game-script-cleaner?tab=readme-ov-file

Hopefully Steam doesn't break the url. If it does, look for the user khaaarl on github. The script is there.
Corvalis 19 Mar @ 3:42am 
All Good! Thanks for even replying!! I will try it out.
Mr. Ugly  [author] 17 Mar @ 10:51am 
Hey there, Khano! I honestly don't know; you might just want to try it. : ) I believe I only ever used battle maps at the resolution listed in the description, but it's been a while.
Corvalis 17 Mar @ 10:12am 
Is there a size limitation for the table/3d battle map area 1640x980 for 1 world I think or can you go bigger?
Weirym 26 Jan @ 5:49pm 
It works like a charm!
Weirym 26 Jan @ 5:45pm 
I will test it out and report back! :) Thanks!
Mr. Ugly  [author] 26 Jan @ 4:19pm 
Hey, Weirym! Sounds like an excellent request. I've added a button at the top-right that toggles whether 3D text objects should get saved and cleared by the Save / Clear buttons. Unfortunately, there's no way (that I know of) to mark a text object as intended for saving (analogous to the ~ in GM notes for all other objects). So it's all or nothing: that new button toggles whether *all* text objects will get saved / cleared, or none of them will. I hope that suits, and let me know if you run into trouble!
Weirym 26 Jan @ 3:36am 
Hello! On having a good play around with this, I have noticed that the text areas don't get packed up. Is there a way to include them? My scenario is that I have an over world map, and started to use the TTS text widget to label areas of interest.
Mr. Ugly  [author] 14 Dec, 2024 @ 12:14pm 
Hey, Hotman! As before, I can't really diagnose a problem without more information, so if you want to upload your table and send me a link, I can try to find time to take a look. I strongly suspect it's more of that godawful malware, so if you haven't, try the steps exactly as posted a couple of times in this thread. If you already did (or you try them and they don't work), I can try to help (though, as before, I can't make guarantees).
the_flamiest_hotman 13 Dec, 2024 @ 4:30pm 
its not working for me at all I have several encounters stored using this (my whole campaign) and it refuses to deploy them. I tried the cleaner block and it worked a little bit. i had to save and reload and then maybe it would work but now it doesn't work at all
Mr. Ugly  [author] 20 Oct, 2024 @ 11:47am 
Glad it worked! : ) And real thanks goes to Larrie Corvell for that cleanup mod. :P
Kendero-Pessimisto 20 Oct, 2024 @ 7:04am 
This solution helped me! I don't know how to express my gratitude enough for your help! I didn't even realize it was possible to face such a problem in TTS.....
Mr. Ugly  [author] 20 Oct, 2024 @ 12:08am 
Now for the main part of the fix. This worked for me with your table:

- Subscribe to this mod: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2967684892
- Load your game
- Spawn the cube into your game: click Games, find the CleanerBlock mod under Workshop, click the 3 dots > Search, find the block, drag it into your game
- Let the cube do its thing (wait until the messages stop appearing; ignore the errors)
- Delete the cube
- Save your game as a new version -- e.g., "CP2020 CLEANED"
- Close the game (i.e., go back to the Main Menu)
- Load that new version
- Test to make sure it works as expected
Mr. Ugly  [author] 20 Oct, 2024 @ 12:08am 
Looks like you had the same malware MrMelons did back in July of 2023. If you scroll back through the comments on this mod, you'll see what happened. I swear, I don't know what kind of person enjoys making scripts that ruin peoples' Tabletop Simulator games, but they *really* need to find a better outlet.

Anyway, there are two parts to the fix: one is to clean your game, the other is to patch up any existing encounter bags you already have. MrMelons had to do both, but I think you only have to do the first, at least as far as I can tell. I could be wrong, though: do you have any already-made encounter bags, stored inside a container somewhere?
Kendero-Pessimisto 19 Oct, 2024 @ 5:31pm 
Thank you so much in advance, @Mr. Ugly! I'm attaching the link below:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3351632563
Mr. Ugly  [author] 19 Oct, 2024 @ 11:03am 
Sure!
Kendero-Pessimisto 17 Oct, 2024 @ 6:00am 
I can confirm that I have encountered the same problem. Can someone please tell me how it can be fixed by my own efforts, maybe?
Can you also please tell me, @Mr. Ugly, are you still considering checking saves of other people's games with this bug?
Mr. Ugly  [author] 21 Sep, 2024 @ 12:03pm 
Hey, Rango! At a glance, I don't know either. If you'd like to save one of your games, upload it to the workshop, and point me at it, I can try to load it to debug.
Rango 21 Sep, 2024 @ 3:20am 
i really don't know what's happening, i can save encounters in the bags but i cannot load them again...
[RW]THEBAG 12 Sep, 2024 @ 5:44pm 
Thank you so much. Now everything works as it should
Mr. Ugly  [author] 12 Sep, 2024 @ 10:46am 
I took a look at the code and updated a few spots. (You'll need the latest version.) Three things:

First, I removed a hack that I previously had to add to get around a bug in Tabletop Simulator scripting.

Second, the grid snapping "default" (which is restored after saving or clearing an encounter) is now set to Off -- so, when you click Save or Clear, snapping will be turned off.

And finally, know that the grid snapping setting for an encounter is whatever snapping is set to when the encounter is saved. So if snapping is enabled (Lines, Center, or Both) when you save an encounter, then when you load that encounter, the saved grid snapping setting will be applied. (This is intentional.)

Does that address everything?
[RW]THEBAG 12 Sep, 2024 @ 1:03am 
Okay, I was able to disable snapping when saving, but when loading it remained.
[RW]THEBAG 12 Sep, 2024 @ 12:20am 
Sorry, I didn't express myself correctly. When you press the "save" or "load" button, snapping to the grid is activated. I'd like to turn this off. how can I do this?

It will be inconvenient to use the mod that you advised me, since I use the encounter to automate the process as much as possible

(I apologize for any errors in the text - I use Google translator)
Mr. Ugly  [author] 11 Sep, 2024 @ 11:48pm 
Hey, Thebag! It's been a while since I've touched these, but I don't think this mod automatically turns on the grid. If you're looking for a way to control the grid (other than through the built-in interface), you could try my Settings mod. It'll let you disable projection of the grid on the table (but allow it on other things). Is that what you're looking for?
[RW]THEBAG 11 Sep, 2024 @ 11:14pm 
Is it possible to disable grid activation when using this tool?
Mr. Ugly  [author] 26 May, 2024 @ 12:21pm 
: ) No guarantees, but feel free to post if you think of a feature you'd like to see.
Weirym 19 May, 2024 @ 1:01am 
I have previously stumbled upon only a couple of your Workshop items randomly in the past. I have only just really jumped into your entire vault and am kicking myself I didn't do this sooner. Thank you so much for what you have done, this has quite literally opened up a new run for online DnD for me! I know you have said you have moved on from this, but this stuff is just fantastic. We wouldn't as a community be upset if you came back to developing this more :steamhappy:
MrMelons 9 Oct, 2023 @ 9:39am 
Ah, thanks! You're a lifesaver dude.
Mr. Ugly  [author] 9 Oct, 2023 @ 9:38am 
It was actually the opposite: the bag needed the newline added back in. To do so (after first making a backup copy of all bags), for each bag:

- Pull out the bag
- Save your game (this is necessary because changing scripts reloads the game)
- Right-click the bag
- Go to Scripting > Scripting Editor
- On the right, set the cursor right after "--@@JSONEND@@" (without quotation marks)
- Hit Enter
- Click Save & Play (at the top left)
- Save your game
MrMelons 9 Oct, 2023 @ 6:29am 
Thanks so much, it also now works again on my end. My other bags all work fine as far as I know right now. In the past if they have broken I've reverted the save or deleted them and started over.

I don't want to have to trouble you in future if it happens again with another bag, is getting rid of the "new line" character as simple as opening the bags script editor and deleting it?

Thanks again for the help
Mr. Ugly  [author] 8 Oct, 2023 @ 8:42pm 
OK, I took a look. And it turns out, the problem is much simpler than I feared. Your map is fine, and has no malware. I suspect it did, and the cleaning script just snipped off a little more than it should've. In this case, nothing important, though -- just a "new line" character at the end of the bag's script. So, here's your map, seemingly all set (I tested loading it into the mod you posted): https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3048103819

Are there any other bags similarly affected?
MrMelons 1 Oct, 2023 @ 12:29pm 
I forgot to change the link to unlisted, should be changed now.
Mr. Ugly  [author] 1 Oct, 2023 @ 12:19pm 
Hey, MrMelons! I still have the old script I wrote to try to help clean up the problematic objects. I sat down to take a look at the game you provided, but the link appears to be broken. Did you get this sorted out?
MrMelons 29 Sep, 2023 @ 12:10pm 
I've linked my newest save in case you want to have a look. The troublesome map is "Sanctus Lignum", the little yellow bag. This one was caught alongside the malware, it wont work, but the others ones will, if you take them out the three side bags. I've already tried cleaning it with both the cube and the python program.

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3043186935
MrMelons 29 Sep, 2023 @ 12:10pm 
Hello again, I've been using the fix for a long time now but I still run into hiccups. Specifically because as I mentioned before, when the malware affects a bag out on the table it corrupts it so that it will not spawn anymore, cleaning it with the cube doesn't seem to have an effect. Cleaning will allow bags that haven't been previously tainted to work (Like the ones I stored in bags) but not ones caught when an object with the malware is spawned in, they still refuse to spawn. I have lost maps because I accidentally spawn an item with the malware in without backing up the map/keeping it inside another bag. I used to think it was because the items inside could not be cleaned, but after using a python program to clean the entire save, I've discovered it isn't that, and the malware somehow permanently affects the map save bag. I know it's a long shot to ask but could you take another look? Even if it's just a way to reset the bags and get the items back out of them.
MrMelons 2 Jul, 2023 @ 5:15am 
You sir are a Godsend.

Your fix has worked. With the exception of the two encounters I had already loaded as their own bags. I suspect this has something to do with the fact the cube doesn't affect things inside containers, however my maps in the category bags work, so do ones I spawn in from saved items. So its not a big problem as I have backups of them anyway. Thank you so much for going through the effort to help. You've even made me aware of a malware issue I didn't know could exist! And thank you for going through the effort to make your own script, even if we didn't end up needing it.

Your mod is great by the way, I prefer it to oneworld as it is simpler and I can use it for things on a bigger table plus things like my XP shop.

All the best dude, God bless.
Mr. Ugly  [author] 1 Jul, 2023 @ 5:36pm 
- Subscribe to that mod

- Open your game

- Spawn the cube into your game: click Games, find the CleanerBlock mod under Workshop, click the 3 dots > Search, find the block, drag it into your game

- Let the cube do its thing (wait until the messages stop appearing)

- Delete the cube

- Save your game as a new version -- e.g., "Dark Heresy CLEANED"

- Close the game (I closed TTS entirely)

- Reopen the "cleaned" copy

- Test to make sure it works as expected

- Use the new save going forward (or save over your original -- but do so at your own risk)
Mr. Ugly  [author] 1 Jul, 2023 @ 5:36pm 
Hey Mr. Melons!

There appear to be several broken links to images, but those are relatively minor (and I can't help you there). The main issue is that you had a kind of malware in your game. :0 I spent way too long working out a script to clean it up, only to find that, somebody else beat me to it! There's a fixer-upper mod that will clean up all the malicious, self-replicating script in your game. That cleanup mod is here: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2967684892 . I'll post the steps I followed, after which I could successfully load your encounters (which look fantastic, by the way).

Let me know how it goes!
MrMelons 1 Jul, 2023 @ 4:37am 
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2997227232

Here's a link to the latest version I have, thanks so much for taking a look.
Mr. Ugly  [author] 29 Jun, 2023 @ 3:43pm 
Hey, MrMelons! It's been a while since I touched these mods much, and I can't guarantee that I can fix your game. But I'd like to try. Is there a way you could post it publicly, so that I could load it and try to diagnose the problem?
MrMelons 29 Jun, 2023 @ 2:45pm 
Hi, this might be a long shot. I've been using this mod for about two years but while editing my dark heresy RPG game the encounter token no longer loads things. I have no idea why, its not a mod conflict, deleting everything else doesnt work. Even using a fresh save with the mod, and importing a single item from the RPG save makes it stop working. Save corruption maybe? It's driving me insane.
iCeParadox64 15 Mar, 2023 @ 10:28pm 
@Mr. Ugly Wow, that was fast, and it seems to work perfectly! Thanks so much!
Mr. Ugly  [author] 15 Mar, 2023 @ 8:37pm 
iCeParadox64, sure! It should now be up and running. Let me know if you encounter any problems with it.
iCeParadox64 15 Mar, 2023 @ 12:21am 
This mod is amazing, like all your others!
Do you think you could add an event for Trigger effects, like you have for Looping effects? Ex. ~(!Trigger 1) would activate an object's first Trigger.
Mr. Ugly  [author] 9 May, 2022 @ 9:26am 
The event button is pretty limited, in that it only controls one moment, and the changes it applies are (as far as it's concerned) permanent. It can change lots of different objects, each to the loop effect specified on that object -- so, e.g., pressing Event might change Object A to loop effect 1 and Object B to loop effect 2, if that's what's specified on those two objects. But there's currently no way, e.g., to change Object A's loop effect, then later change Object B's (in two separate events).

Does that answer your question?
K2 Saint 7 May, 2022 @ 5:51am 
Does the event button allow you to be able to do more than one loop effect to switch between them? or does it currently only work for one loop effect?
K2 Saint 3 May, 2022 @ 6:25pm 
I did mean the event button yes! Haha

And they clarified it perfectly! Thanks!

And thanks again for the brilliant mod! :steamhappy:
Mr. Ugly  [author] 3 May, 2022 @ 9:45am 
Hey, K2 Saint! The only "Encounter" button on the panel is the header; clicking it just gives help text.

If by chance you meant the "Event" button (the exclamation point), then yup, it's a bit esoteric. It was originally for encounters where you need a permanent, one-way change to happen part-way through the game. For example, if players are assaulting a castle and you want them to be able to destroy a wall (and then continue the fight), you could flag all the wall objects to be deleted when you hit the Event button. I've also used it as a rough tool for optional models in an encounter. For example, I ran an encounter that was shrouded in fog. The fog looked neat, but I worried that it might be irritating for players. So I flagged it to be deleted by the Event button, so that if any players complained, I could remove just the fog (which was hard to select manually) by clicking the Event button.

Does that help?
K2 Saint 2 May, 2022 @ 7:32am 
I am really loving how easy this is to use and how fast it is even with a lot of models used all at once.

But I can’t seem to wrap my head around the encounter button. I’m not understanding how to use it correctly. Is there a more in depth way you could explain it? :dssmile:
Oldbastage 25 Apr, 2022 @ 7:44pm 
Thank you both.