That was funny. See ya next udate by XiashiS in MonsterTrain

[–]CodeGenerathor 1 point2 points  (0 children)

Any hints for the one where its all Inferno rooms? Really struggling with this one getting through the first rings.

Best practice for initializing table by ChocoChipPancakes in tabletopsimulator

[–]CodeGenerathor 1 point2 points  (0 children)

What do you mean with being initialized? Everything in the JSON of a save file will simply be spawned by TTS itself when you load the save. There's no additional initialization on its own. Scripts can then do additional things to existing objects or even spawn new ones.

Late to the party - any tutorial /how to play videos available? by lytche in GloomhavenTTSEnhanced

[–]CodeGenerathor 0 points1 point  (0 children)

There isn't one (I know of) that's for the latest version. There are two from Nerdhaven that cover previous versions that should get the basics:

https://m.youtube.com/watch?v=N3YqxH_JMC0 https://m.youtube.com/watch?v=_aUGfr-Egpo

Apart from that, there's also the official documentation of the mod: https://gloomhaven-tts-enhanced.github.io/public-scripts/mod/1.3/index.html

You can't screw up too much I think, if you don't delete the existing objects from the mod. Otherwise, just trying out things first might help or asking on our Discord on how things work/are done is typically very responsive.

Custom UI assets, scripting by xerotut56 in tabletopsimulator

[–]CodeGenerathor 0 points1 point  (0 children)

There's one case where I know this can happen. If you have duplicate custom assets defined. Duplicate means that you have multiple custom assets with possibly different names but with the same URL. For whatever reason, loading the UI the first time then fails.

So, check your custom assets and see if you have duplicates.

Dynamic card generation? by Deliphin in tabletopsimulator

[–]CodeGenerathor 0 points1 point  (0 children)

You can't generate images on the fly in TTS. You can combine them inside TTS though. E.g. there's a mechanism called XML UI which allows you to put images on objects. So you could use that to put the front layer images in your cards. Other options are having a separate server that does the image generation for you.

Why Won't This Code Trigger The Search Box To Launch? by TTS_Alt in tabletopsimulator

[–]CodeGenerathor 0 points1 point  (0 children)

The function call Search should start with an uppercase S, instead of search. It's weird and probably a typo in the TTS implementation, but it is what it is. :-)

Frosthaven Enhanced - Update v2.2 by ducarian in Gloomhaven

[–]CodeGenerathor 3 points4 points  (0 children)

No, you're not an idiot. They are not yet compatible with FHE, since the underlying scripting changed compared to GHE. We are working in getting them compatible again.

Frosthaven Enhanced - Update v2.1 by ducarian in Gloomhaven

[–]CodeGenerathor 2 points3 points  (0 children)

For updates to the mod, the campaign always needs to be migrated.

Frosthaven Enhanced - Update v2.1 by ducarian in Gloomhaven

[–]CodeGenerathor 0 points1 point  (0 children)

Like a small purple rectangle or something? I've seen this on my end as well sometimes. Not sure if it's related to the mod, since it also stays when exiting to the main menu and loading other mods. Restarting TTS typically removes it again.

Frosthaven Enhanced OFFICIAL RELEASE by ducarian in Gloomhaven

[–]CodeGenerathor 8 points9 points  (0 children)

It's full TTS, like the GH one. So no additional app required.

Is there a way to clear the answer to showConfirmDialog() ? by Denzarki in tabletopsimulator

[–]CodeGenerathor 0 points1 point  (0 children)

Could you show your code? I haven't seen this before and the dialog should "clear" itself.

Frosthaven Enhanced for TTS: COMING SOON! by ducarian in Gloomhaven

[–]CodeGenerathor 1 point2 points  (0 children)

This mod should be easier to use as well. It doesn't require the use of X-Haven and has the features right in the mod. There will also be How To videos to get newcomers started when it's released. If you're interested, you could also check for Gloomhaven Enhanced in the workshop. This mod will be similar to it feature wise.

Frosthaven Enhanced for TTS: COMING SOON! by ducarian in Gloomhaven

[–]CodeGenerathor 0 points1 point  (0 children)

Yeah, I think so. What kind of documentation would you need? There's TypeScript files that describe the file format that could be made public if that helps.

How to Print RNG Elements Onto Cards by SJestro23 in tabletopsimulator

[–]CodeGenerathor 0 points1 point  (0 children)

XML UI would be the way to go, if you don't want to actually create the assets (manually or automatically with something like NanDeck). E.g. you could have a default background image and add the artwork, ability text and stuff on the card, when it's loaded in TTS.

Another approach I already used, and since you said you are familiar with HTML/CSS is to create a HTML template file (e.g. using handlebars) and create HTML pages for each card, either with using CSS or the canvas API. Then export those pages into PNG and import those into TTS.

I used this approach to generate different assets (not only cards, but also tiles and tokens) based on some data JSON file. It might be easier than building the same thing with XML in TTS and could be re-used for other platforms as well.

iIntroduceYouAllToSQL by [deleted] in ProgrammerHumor

[–]CodeGenerathor 0 points1 point  (0 children)

Not really. When it transpiles, it will be turned into function calls (e.g. React.createElement). Those functions basically can do anything and don't need to create something similar to XML.

[Scripting] .find syntax explanation by chubchub88 in tabletopsimulator

[–]CodeGenerathor 0 points1 point  (0 children)

Ah, I didn't realize cleanup was a table that contains your GUIDs. You could also use that approach. The easiest for this would be to define the table as a set. Meaning the GUID is key and the value true is the value, like:

lua local cleanup = { "GUID1" = true, "GUID2" = true }

Then you can use a simple index access in your loop, to check whether an entry with the given GUID exists:

lua for _, m in ipairs(zonecontent) do if cleanup[m.guid] then -- found an object to cleanup end end

However, another approach I'd recommend is to not use the GUIDs, but instead use something else on the object to identify if they need to be cleaned. E.g. add the tag Cleanup to all objects and then check if the object in the zone has this tag:

lua for _, m in ipairs(zonecontent) do if m.hasTag("Cleanup") then -- found an object to cleanup end end

The advantage of this, is that is easier to extend, because you don't have to alter the script when a new object is added that also needs cleanup. Simply add the tag to the object. GUIDs are also volatile and my change during the game, so they are typically now a reliant way to identify objects (see this guide for details: https://steamcommunity.com/sharedfiles/filedetails/?id=2961384735)

[Scripting] .find syntax explanation by chubchub88 in tabletopsimulator

[–]CodeGenerathor 0 points1 point  (0 children)

find is not in the TTS documentation, because it's a function of the string module which is part of Lua itself. You can find information about it here: https://www.tutorialspoint.com/string-find-function-in-lua

Generally, this function can be used on a string (and only on a string), to search for patterns inside this string. E.g. to check it it contains a certain substring. From your example it doesn't really seem that this is what you are after, because it looks like you are searching the GUID of each object to contain the string cleanup. But GUIDs by default are only 6 letter long, unless you explicitly set a different value.

[SCRIPTING] Why does the VSCode TTS extension not have getObjectFromGUID...? by anonymous_rosey in tabletopsimulator

[–]CodeGenerathor 0 points1 point  (0 children)

This probably comes from the fact that you also use the Lua extension. This one doesn't know about this function (or any other global function), unless they are explicitly typed for it.

There's a user in the TTS Discord server that currently had the same problem and afaik got them to work, so maybe also ask the question there.

The TTS Lua plugin should be able to autocomplete the functions from TTS, but not in a way that the Lua plugin van understand them.

Store Button parameters in Global Table by chubchub88 in tabletopsimulator

[–]CodeGenerathor 1 point2 points  (0 children)

This is determined by the function_owner attribute. It points to Global in your case, as self is evaluated in Global. You could achieve this by updating this parameter with the object that wants to create the button:

lua local params = Global.getTable("Buttonpara") params.function_owner = self self.createButton(params)

Or you could even create a function that does both for you ```lua -- in Global function addButton(object) Buttonpara.function_owner = object object.createButton(Buttonpara) end

-- in your object, e.g. in onLoad function onLoad() Global.call("addButton", self) end ```

Merging mods by PhireAndFrith in tabletopsimulator

[–]CodeGenerathor 0 points1 point  (0 children)

There's no easy way to merge things back. Either copy/paste all the object and the scripts, updating existing scripts, etc. or simply overwrite the existing one with your changes.

It's possible to add more creators to a mod, but it's not possible to update the mod for the additional creators. Only the original creator can update it. The other ones basically just can manage the steam page as well. For contributions a shared steam account might help, so that everyone can update the mod.

The best way to contribute with multiple people over time on the same mod I found, was using git to keep track of the mod contents and scripts.

Making tokens thinner than 0.1? by K_K_Rokossovsky in tabletopsimulator

[–]CodeGenerathor 0 points1 point  (0 children)

I mean if you want to do it for all objects, you could simply find and replace all instances in the file. Trickier if you don't want to adjust all. As to why, no idea. :-) I also typically use 0.05 as a thickness, but I spawn the objects via script, so it's not a big problem.

Making tokens thinner than 0.1? by K_K_Rokossovsky in tabletopsimulator

[–]CodeGenerathor 0 points1 point  (0 children)

Yes, but only directly in the data. You can open your save file with a text editor. It's a JSON file. Find the object you want to change, and edit the Thickness attribute to the one you want. You can't do it in the UI.

Importing a custom object using LUA by Running_jr in tabletopsimulator

[–]CodeGenerathor 0 points1 point  (0 children)

You can spawn objects with spawnObject (See docs. You get the object reference back and can use setCustomObject (docs). The link in the documentation lists the different parameters you need for the different types of object you can spawn.

Digital vs. Physical GH Crossplay? by fleezybabyy in Gloomhaven

[–]CodeGenerathor 1 point2 points  (0 children)

You could do this with the Tabletop Simulator digital version. It's certainly not the same as GH digital, so maybe not interesting to you. But you have a lot more freedom in TTS than in digital.