Tabletop Simulator

Tabletop Simulator

Conditions & Ruler for D&D 5e (+ Pathfinder)
kimrel  [developer] 16 Apr, 2020 @ 2:51am
Making your own custom lists of commands
First of all, please don't upload your own workshop entries with this content. It would just get confusing what to use. I'd be happy to include everything you make in this project, so just answer this thread. Don't shy away from that though.

it's not that easy to make the changes since the objects are activated through animations and then the animations are referenced in the tts api script. it's not complicated, just a lot of work so I made a custom script that instantiates everything.

Here's the unity package: http://goodwolf-studio.com/Mods/TTS/RPGBase/customBase.unitypackage

You need a Unity version 2019.1.14f1! Import this, then put the MiniBaseCustom Prefab into your scene and unpack it. Under no circumstances should you continue inside the prefab viewer! (http://goodwolf-studio.com/Mods/TTS/RPGBase/tutorial01.JPG)

There's an object inside called fx with the fxcontroller script. That script will help you instantiate all your buffs. (http://goodwolf-studio.com/Mods/TTS/RPGBase/tutorial02.JPG)

Open the list "Buffs To Instantiate" and add as many buffs as you want. The TTS API has a maximum of 99 entries it can handle.

Name: Name to display in the list view Text: Text to display on the mini. It should be longer than 10 characters. For spaces, I always use six whitespaces. Spell School: There's a list called "Schools" on the same object. It contains default values for Text Material and Background Color. You can change that list or use what already is there and enter the name of the school here. Background Color: If no spell school was used, this background color will be used. Text Color: If no spell school was used, this text color will be used. can only be "black" or "white".

Finally, hit the checkbox next to "Instantiate List Buffs Now". Note that it will immediately uncheck itself, which is as intended. (http://goodwolf-studio.com/Mods/TTS/RPGBase/tutorial03.JPG)

The script should now have done several things. a) created the objects with the visuals. You have to manually deactivate them now. (http://goodwolf-studio.com/Mods/TTS/RPGBase/tutorial04.JPG) b) created animations that toggle the visual objects on and added them to the base animator (http://goodwolf-studio.com/Mods/TTS/RPGBase/tutorial05.JPG) c) added the object turning off in the "Reset" animation d) added the animations to the trigger list of

If there are a lot of buffs you try to instantiate at the same time, you may have to manually deactivate some of the objects and reactivate them to trigger their scripts once. If the items are out of order there is a button to "Sort Trigger List Now" on the fxcontroller in the fx object.

The last step is to export the new object as an assetbundle to use in TTS. Make a prefab out of the object and in the preview window in the dropdown select "New". In my case, I always have to do this twice since the input field won't respond the first time I hit "New". (http://goodwolf-studio.com/Mods/TTS/RPGBase/tutorial06.JPG) Enter a name and then right-click on your prefab and hit "Build AssetBundles".

Now you can import your AssetBundle in TTS.
Last edited by kimrel; 18 Apr, 2020 @ 1:07am
< >
Showing 1-15 of 22 comments
TfreeJ 16 Apr, 2020 @ 11:49am 
@retraffic Thanks for hearing your fellow hobbyists and taking the time to help the community with this. Really appreciate you taking the time to help. I will do my homework and see if I can figure this out and submit to to you Pathfinder 2e conditions. I don't think I will be including list of spells, as I think this would likely be redundant as buffs/debuffs typically bestow conditions with a numerical value.
TfreeJ 17 Apr, 2020 @ 4:19pm 
I am striking out hard... never used unity before, so likely just my ignorance of the tool. I totally don't expect you to teach me unity... but maybe i am missing something easy to fix/obvious?

I am following your steps above, and here is where I think I am seeing my first divergence from your steps: When it comes time to click "Instantiate List Buffs" it does not bring up the animations ( don't see any of the buff animations I had instantiated), but does add each buff to the left in the scene under fx (anim is within each buff). The boxes "Join" and "Link" are both checked (i uncheck them, per your pic)... i did see one buff that has destroy checked at one point, but that is not the norm.

I did make an asset bundle and imported into TTS just to see what would happen. The two test buffs were in the states (repeated across multiple state #s), but no animation if clicked. No Buttons for measurement tool or buffs on the base.

A few other notes:
  • I am on version 2019.1.0f2 Personal
  • Working on a Mac
  • When i import your package I am seeing 2 alerts on the console:

1)
version.txt could not be found! Something is wrong with the project. Did you open the project you downloaded from GitHub with Unity?
UnityEngine.Debug:LogError(Object)
<>c__DisplayClass3_0:<.cctor>b__1() (at Assets/Editor/TTSCheckVersionNumber.cs:56)
ContinuationManager:Update() (at Assets/Editor/ContinuationManager.cs:34)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

2)
Assets/fxcontroller.cs(20,16): warning CS0649: Field 'fxcontroller.spellSourcecode' is never assigned to, and will always have its default value null

Steps I have been taking:
- right click in project bin below and click import package -> custom package... and select your file (brings in a lot of assets, 3d shader, ACondition, Anim, canvascamera, editor file etc etc etc.)
- I drag and drop from Models ->PC-> MiniBaseCustom up into my scene/viewer
- From the Scene tab on the left, I right click MiniBaseCustom in and select Unpack (i have tried both 'Unpack Prefab' and 'Unpack Prefab Completely')
- I then click Fx and under buffs to instantiate try 1 or 2 in size and fill out a couple test buffs (always includng name, text and a spell school)
-Click instantiate list buffs per above, don't see the animations in viewer. When clicking on FX-->Test Buff I see that Join and Link are selected ( i uncheck them).

This may be over my head, but I tend to have success figuring these things out, especially with your step by step directions provided, I thought I could bullrush through it!

Appreciate any input, if there is something i am missing. Otherwise, I may need to back away slowly and hope another PF2 minded person who knows unity can step in and be the hero we need.

Thanks for your time and mod!
kimrel  [developer] 18 Apr, 2020 @ 1:07am 
hmm try working with the same Unity version as me, which is 2019.1.14f1
TfreeJ 18 Apr, 2020 @ 10:18am 
hah, yeah, being on the proper version like you said would help, derp.

Will let you know how it goes.
kimrel  [developer] 18 Apr, 2020 @ 10:24am 
i edited the post above so new people can see the correct version immediately so not your fault. had just specified 2019.1 before as tabletop simulator folks do. probably needs to be more specific though.
TfreeJ 18 Apr, 2020 @ 12:02pm 
Working in 2019.1.14f1 now. Trying to instantiate List Buffs (just one Test Buff named "Blinded") and getting a few alerts in console. No animations being built in viewer, no animations added in base animator etc.

Here are alerts (they repeat/occur 68 times):

Parent directory must exist before creating asset at Assets/Animations/Blinded.anim.
UnityEditor.AssetDatabase:CreateAsset(Object, String)
fxcontroller:createAnimationForGameObject(GameObject) (at Assets/fxcontroller.cs:141)
TextAroundPlayer:Update() (at Assets/TextAroundPlayer.cs:31)

and

UnityException: Creating asset at path Assets/Animations/Blinded.anim failed.
fxcontroller.createAnimationForGameObject (UnityEngine.GameObject x) (at Assets/fxcontroller.cs:141)
TextAroundPlayer.Update () (at Assets/TextAroundPlayer.cs:31)

I also get an alert when I open a project:

version.txt could not be found! Something is wrong with the project. Did you open the project you downloaded from GitHub with Unity?
UnityEngine.Debug:LogError(Object)
<>c__DisplayClass3_0:<.cctor>b__1() (at Assets/Editor/TTSCheckVersionNumber.cs:56)
ContinuationManager:Update() (at Assets/Editor/ContinuationManager.cs:34)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
kimrel  [developer] 18 Apr, 2020 @ 12:35pm 
ok that makes sense. the folder Assets/Animations has to be created.
TfreeJ 19 Apr, 2020 @ 1:03pm 
Alright! Progress is being made! I was able to import my single buff test into TTS and it worked! (No buttons for the measurement tool or conditions list... but was able to reset and activate animations in states).

Just made a new project and tried my mega list of 99 buffs and here is where I am at:
  • When I hit instantiate list buffs I am missing my last 31 buffs.
  • Deafened appears twice in the fx folder, in its alphabetical spot and at end of list.
  • Deafened is the only one shown animating when i hit the play button to see animation, which is bad I think.... meaning i think the others are in proper working order and I need to manually deactiveate this buff? Can you elaborate on how to do that? I believe I have to get into the code to do this?...

Question: I should still be seeing a number of the buff objects around the base in scene correct? If not, I am clearly not understanding how to remove those/deactivate those if they need to be.

Thanks!
kimrel  [developer] 20 Apr, 2020 @ 9:38am 
When using the checkmark fields Unity basically allows for one frame of calculations to be run. If the workload is too much for one frame, then the rest will be executed later and then it can get messy. So it's best to keep your lists not at maximum capacity and only instantiate like a third of what you need to instaniate right now. then refill the list with more conditions. they'll be added at the end then. You can also create those items manually in the fx objekt by just copying and pasing, changing all values and the objectname and then hitting join and link, but it'll get more complicated then

to start over with your base you'll also have to remove all animations from the animator on the base object and remove all triggers from the trigger list in the tts system script.
TfreeJ 23 Apr, 2020 @ 2:32pm 
Alrighty, we have a working Pathfinder 2e base for conditions.

I had to simplify my original list (which included variables/numbers for each condition that required a variable), so unfortunately will need to sort out another solution for tracking those modifiers each round, maybe a dice or counter can be utilized separately... or my preferred fallback... pencil and paper. Not elegant, but it works!

I was unable to get the assigned color backgrounds and text fonts to work properly... Looks great in unity, but when i bring into TTS it seems to default to white background and black or white text. Not a deal breaker for me, still functions well.

How can I get the base to you to include with your workshop entry? And would you be able to include the measurement tool and conditions button? I presume this is some LUA script that can be added?

And lastly, thanks for hanging with me and so promptly getting back to my questions. Appreciate it. Was fun to dip a toe in Unity.
kimrel  [developer] 24 Apr, 2020 @ 2:41am 
great to hear. you can send me a link to your assetbundle for example on Wetransfer.com
kimrel  [developer] 24 Apr, 2020 @ 2:43am 
also.. does pathfinder need the "double every second diagonal to 10ft" rule?
TfreeJ 24 Apr, 2020 @ 10:51am 
Yes, pathfinder uses that same diagonal movement rule. 5 then 10 then 5 then 10.

Drop box link to asset bundle:

https://www.dropbox.com/s/l45p06c4lkn6v6z/retraffics%20minicustombase%20pf2%20basic%20conditions%202.unity3d?dl=0
kimrel  [developer] 25 Apr, 2020 @ 2:50am 
hmm that base is not working for me. the letters are not showing. could you send me your unity project? you can just zip the whole folder.
TfreeJ 25 Apr, 2020 @ 10:23am 
Strange... when i brought into TTS I was able to see white background and black letters on all conditions. For some reason it didn't apply the school colors I had assigned, but was still legible/functional. Here is zip to the whole everything.

https://www.dropbox.com/s/i99133oc50ec26p/Retraffic%20CustomMiniBase%20PF2e%20basic%20conditions.zipx?dl=0
< >
Showing 1-15 of 22 comments
Per page: 1530 50