Tabletop Simulator

Tabletop Simulator

Character Sheet Template - Improved
21 Comments
Aristocrat Apr 9 @ 1:55pm 
@K3 Hey sorry, I never saw your reply. I'm actually still working on some sheets. Could I trouble you to write a very quick example of how you'd go about referencing an ID when defining a child function? I'm clueless when it comes to lua. Also, would it be possible to call upon integer values from multiple text-boxes? Thanks! :KneelingBow:
Witch Hunter Siegfried Feb 7 @ 9:29pm 
Could you make the position tracker be set to the smaller reference sheet rather then the COC one by default?
K3  [author] Nov 20, 2024 @ 5:21pm 
@Aristocrat It's a bit complicated due to the dynamic nature of the sheet, but you should be able to designate one standalone text box, then one set of parent child boxes. Generate the entire sheet layout before defining the child function. Once you have a finished sheet, go down the list of the generated text-boxes and count out the number associated with the entry. It may take a bit of trial and error to get the right id. From there, you can go to the child function table and define the child function to add the parent to the standalone using the reference id.
Aristocrat Nov 18, 2024 @ 9:45am 
This might seem like a silly question but is there any way to add two children together and have the script autofill the result as the value of the parent?
exhausted Jul 23, 2024 @ 11:39pm 
Thank you so much for your time, I will definitely take these points into consideration. Sorry you had so much to type out, but my dumba** appreciates your detail and effort. I will try again with what you have shared, hopefully it helps someone else, too!
K3  [author] Jul 23, 2024 @ 6:11pm 
@exhausted
Now, assuming all of that is sorted and you're still having trouble, I'd recommend checking two things. The first is at the top of the sheet, there is a save toggle. The sheet must have saving disabled to edit its contents. Once you're done with a sheet, enable the setting and the sheet will retain values between reloads. If you find you can't modify anything from this point, you'll want to ensure the edit lock is disabled. Once you're satisfied with the sheet's functionality, fill out any default entries or leave everything blank and save it to your object library.

If there's any more specific issues you're having, I'll see what I can do, but this hopefully covers the bulk of sticking points.
K3  [author] Jul 23, 2024 @ 6:11pm 
@exhausted
Finally, position is another potential point of confusion. The small red ring on the table will tell you its coordinates relative to the center sheet. Place this marker where you want the text to originate, then copy the result from the notes section into the sheet. It should be of the format {x, y, z} If your sheet is grid like, you can just get the initial and adjacent positions to derive the rest of the positions and save time. Its notable that if you change the sheet, the position tracker will still work, but if you spawn in a new sheet, you'll need to change the tracker's entity id field to that of the entity you want to track.
K3  [author] Jul 23, 2024 @ 6:10pm 
@exhausted It can be a bit complex to explain without any experience in dealing with code, but effectively, you're making a specially formatted nested list. If you follow the syntax of the list, then you'll get the result you're after. The small sheet to the right of the main one has a reference to this format as well as the datatypes required.

One point of potential confusion is with title vs value. Title is what text should be displayed when there is no value. If left blank, then the text box will be blank when the text inside is deleted. Value is the actual entered text that can be freely modified.

Validation is another potential point of confusion. That one will reject a change that does not follow the setting. Ex. You set validation to 2 (Integer) and try to type out a word. The change is rejected and the box reverts to its previous entry.
exhausted Jul 21, 2024 @ 6:02pm 
This is a very great template! However, I am dumb, know nothing about LUA, and happen to be struggling greatly with getting the text boxes to work. Particularly, I know I'm supposed to replace certain things with my values, but I'm not sure which ones require what. I am very sorry to bother, but would you be willing to explain it like I'm five? lol.
Mr. Von Grimmsy Jun 30, 2024 @ 3:58am 
@K3 Thanks a lot for the explanation, I'll dig around and see what I can do! :steamthumbsup:
K3  [author] Jun 30, 2024 @ 12:46am 
@Vlnr
I could potentially add a type of counter like that, but it does create its own issues as far as editing the counter number outside of single increments. I'll investigate it

@Mr. Von Grimmsy
To set up autofilled textboxes, you need to establish a parent that governs the values of its children. Within the parent properties, define children as needed. The childType property of the children refers to the childNumFunctions and childStringFunctions tables to determine what logic to apply to the parent to fill in the child.

You can add any custom logic as an additional entry to the child tables and then reference the new entry via the childType property. It's worth noting that there's currently no support for children with multiple parents.

The DataType Reference table on the side sheet will tell you how to format your blocks of data. You can copy the parts you need directly into your editor and replace the placeholder text with real values.
Mr. Von Grimmsy Jun 14, 2024 @ 11:03am 
I came across this after messing w/ Mr. Stump's version a bit, and it seems to have addressed a function that I was interested in (autofilling sheets) - but now I'm kind of at a loss on how to set up the derived values...

I looked through the script, but couldn't make heads or tails of it. :stimulation:
vlnr May 30, 2024 @ 4:17am 
Thanks for making this!
Is there a chance to add the same type of counters as in Mr.Stump's version? The ones where you can click on the number to increment it, and no + and - buttons.
K3  [author] Sep 24, 2023 @ 3:41pm 
I've added a simple demo sheet with a data reference attached that should help alleviate any confusion.
Inspector de Patas Sep 12, 2023 @ 6:01pm 
Could you kindly make a clean template like the one of Mr.Stump that only had like 1 text box, 1 counter and 1 checkbox so we can easily undestand how your code works and how to edit this?
Tourfaint Apr 7, 2023 @ 8:30am 
Sorry my bad, the character was U+10008, not 4, i just such at typing, but yeah, the stylized X works fine everywhere else on my pc but doesn't show up in tabletop sim. Not sure how to even start to figure out why. I blame proton because it's a convenient thing to blame. I just changed it to the dot character and it works perfectly.
thanks for helping me and sorry for being dumb <3
K3  [author] Apr 6, 2023 @ 8:09pm 
That is quite odd indeed. It should be U+10008. Not sure why that would change on your end. U+100004 is in the private namespace so it only works if you have it defined. This is the symbol in question to check if it renders on your machine: ✘(Should be a stylized X.)
Tourfaint Apr 5, 2023 @ 8:02pm 
Sorry again i was not messing with the code and i fixed the error!
It was probably my system's fault.
The code that toggles the checkbox sets the label to "=string.char(10004)". For some reason the character number 10004 doesn't show as anything for me.
I'm guessing it's due to some Proton/linux font related shenanigans that i don't know how to fix.

changing the code into "string.char(120)" to make it a simple lower case x makes it work properly.

Sorry for bothering you and thank you for the response. Without it i would have just given up instead of combing the code line by line.
Tourfaint Apr 5, 2023 @ 7:47pm 
Thank you very much for bothering to help with my presumed idiocy
By "not work" i mean they highlight when moused over, make a clicky noise when clicked, but don't change apperance. I assume the checkboxes should look different after toggling them.
Checkboxes don't work, neither on the sample sheet, a new sheet i made, or new checkboxes i made on the sample sheet.
I also tried setting the default state to true to see if the checkbox would look different, but they look the same regardless of the state variable.
Both the plus/minus toggles and text boxes work perfectly.

Edit toggle looks like it works properly. When the edit lock is on i the buttons don't highlight when moused over and don't make the clicking noise when clicked.
Thank you for trying to help with my ineptitude. I'll try to badger a friend to run the sheet to see if it isn't somehow related to my pc somehow, but if you have any ideas i'll be grateful.
K3  [author] Apr 5, 2023 @ 7:09pm 
That is rather strange. A few troubleshooting questions for you.
Do the checkboxes work on the sample sheet?

Do other UI elements work within the sheet?

Is the edit toggle on or off?
(If your sheet doesn't include an edit toggle then the canEdit variable must be set to true in the default table.)
Tourfaint Apr 4, 2023 @ 7:45pm 
checkboxes don't work for me, and they don't in the original mr. stump's version, any ideas for the cause?