Tabletop Simulator

Tabletop Simulator

Universal Counter Tokens
50 条留言
iMaxed0ut 1 月 8 日 上午 9:16 
This is an amazing counter token! If there a way to have a second counter on the back side of the token? I have a game where the unit can be upgraded and that is indicated by flipping the token over. I'd like to be able to flip the token, then continue to track health without having a set of base tokens on one bag then upgraded tokens in another. I thought maybe I could repeat the code and then edit the positions, but I'm not knowledgeable enough in LUA coding to know how to do that...
Sean2111 2023 年 12 月 15 日 上午 12:28 
This is great.
I used my own image and saved to the cloud ,thought maybe for the best.
Then I made this counter really small.
Then I attached a Miniature Model (W40k infantry) to the counter.
Put the counter to rear of model.

Now I can still use the buttons ,and at present using for range. So I know this particular infantry man can shoot so far for example.

Works good.
Iron-Claw 2023 年 7 月 6 日 下午 3:05 
Yes, same here. So far it has always worked fine for the host, but sometimes the client players report that the numbers overlap for them and/or the buttons don‘t work. When this happens, saving and reloading the game seems to fix it. Also, rewinding time also fixed it at least in one case. Strange… not sure whether this behaviour is caused by a TTS bug or a mod bug (or both :).
Minesteper 2022 年 2 月 25 日 上午 11:01 
does anyone else have any problems with the counters it seems fine to me but my players say the the numbers overalap on top of each other
MarcusRaven 2021 年 7 月 5 日 上午 10:25 
Is it possible to have two counters on the same token?
BeautifulMountAiryLodge 2021 年 3 月 6 日 下午 12:11 
This is fantastic! Thanks!
Becbunzen 2021 年 1 月 30 日 上午 10:42 
The counters seem broken with the update to TTS yesterday. Are you getting errors too?
Nogge 2020 年 12 月 27 日 上午 11:41 
These counters are exactly what I was looking for, for a mod I'm putting together of a dying game.

Would it be alright if I use these in it, giving credit and linking here of course?
rULmismo 2020 年 11 月 7 日 上午 2:43 
Thanks four your guides and assets. I am trying to use your counter in a script, but when access the getvalue() or increment() methods I always get a NIL result error.
It puzzles me that it works right if I use an standard TTS counter, but not with custom counters I tried. Any suggestion what I am doing worng?
Keanu Weebs 2020 年 7 月 13 日 上午 2:36 
Any thoughts on how to add multiple counters to a single image? I am trying to edit a counter for armor and structure for a battletech game.
Professor Ramsay Dax 2020 年 7 月 2 日 上午 7:23 
Thank You Mr Stumps. I'm going to be uploading two verisons of a steam punk engine deck builder named Widget Ridge and just wanted to make sure it is ok with you that your counters will be in it.
gravem 2020 年 5 月 2 日 下午 1:07 
Thank you for this. It would be great if these also could do negative numbers.
Brodieman 2020 年 4 月 21 日 下午 6:06 
Thanks for making this! When I right click to save to chest, as stated, I do not have that option?
sequeira.pedro.rc 2020 年 4 月 21 日 下午 2:46 
I'm trying to change one of these to write the changes in the console for everyone to see. it could be useful in spotting mistakes. I've seen it first in TFMars, but the counter there only has the +-1 button
Jboy11 2020 年 4 月 17 日 下午 2:46 
i made some modifications to make a damage counter for pokemon tcg, can i upload in the workshop? since i havent saw none
giving all the credits to you of course
Becbunzen 2020 年 4 月 15 日 上午 10:47 
Thank you, this works great!

On my wishlist would be to allow increasing/decreasing by 1 at a time, by scrolling up/down with the mousewheel while holding down LMB over the middle counter for example. Then I would not need to zoom in to be able to hit the small buttons if there is just a small change. I have multiple counters per players (tracking resources), so each counter has to be kind of small to fit on screen.
Sirzento / Nico 2020 年 3 月 25 日 上午 12:59 
The way I did it was to extend the transparents so that the desired counter location is in the middle of the picture
Flyndad 2020 年 3 月 22 日 下午 10:39 
how would I move the location of the counters relative to the object?
AJBruner77 2019 年 12 月 21 日 上午 3:27 
This is a nice complimentary package for any game that requires tracking amounts. Easy to configure and simple to alter.
kakashi 2019 年 7 月 22 日 上午 10:22 
Is there a way to add shift click +5 or Ctrl +10 functions to this? I tried a couple ideas but it seems to mess up a bit. So i figured is ask instead :)
Groule 2018 年 3 月 17 日 上午 7:08 
Awesome
Minty 2018 年 2 月 18 日 下午 3:37 
Would it be possible to edit the counters to either show the button while it's in your hand, or set the name/ description to show it's current value when updated?
Rose 2017 年 12 月 2 日 上午 10:03 
modesty is cute and all, but seriously, you dont need modesty :D youre one of the pillars of this modding community. thank you so much
MrStump  [作者] 2017 年 12 月 2 日 上午 9:53 
haha thanks!
Rose 2017 年 12 月 1 日 下午 11:16 
Same dude who does the turn trackers and egg timers. this guy is the man. it would litterally be impossible to play RPG on table top without this dude
Marquise* 2017 年 10 月 10 日 上午 1:11 
What a great idea!!! :D
MrStump  [作者] 2017 年 8 月 16 日 下午 9:59 
Check out this guy http://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=730142339&searchtext=counter

It lets you put multiple counters on an object with some setup. Might be able to poke it into doing what you want.
Luap26 2017 年 8 月 16 日 下午 8:16 
yeah I dont know any lua, sadly.
MrStump  [作者] 2017 年 8 月 16 日 下午 7:32 
You'd need to know lua to know how to format the code correctly. In concept, you just make 3 "display" buttons, 3 + buttons and 3 - buttons.
Luap26 2017 年 8 月 16 日 下午 12:04 
Hey, I am lookin for a counter similar to this. I am lookin for a counter similar to the 3 dail combination lock of a brief case. How would I make an object that contains 3 different counters that go between 0 - 9?
Axis 2017 年 6 月 17 日 下午 6:37 
I appreciate the help. Thanks very much.
MrStump  [作者] 2017 年 6 月 17 日 下午 6:29 
I purposefully disabled them with a couple of lines of code. If you wanted them to go below 0, then you can remove the following little bits of code in 2 steps. On line 44 is this: --Prevents count from going below 0

Right beneath that is if count > 0 then . Delete that line. Then 3 lines down is the word end . Delete that.

Now go down to what was line 59. Again it says --Prevents count from going below 0 . Erase the line right below it that says if count > 4 then . Then skip the next line and delete the following 3 lines that say else , count = 0 , and end .

That's it. It should now count down into the negatives. Sorry for the trouble, its an old script and I didn't write in nearly as much flexibility as I do now. I might revisit this concept if I ever thing of a good addition to make besides the negative thing.
Axis 2017 年 6 月 17 日 下午 5:43 
As far as I can tell, this doesn't seem to support negative numbers. Am I correct in saying so?
kensuaga 2017 年 6 月 10 日 上午 11:29 
Thank you!
MrStump  [作者] 2017 年 6 月 10 日 上午 6:48 
If you look in the code, you can see position={number, number, number}. Those are the coordinates of where the buttons are placed. Don't change the middle number. The first number is left/right, second number is up down. 0 is centered, -1 would be left/up and 1 would be down/right
kensuaga 2017 年 6 月 9 日 下午 11:57 
Is there any possibility to move the numbers and button to the side of the token?
Mag Roader 2017 年 6 月 2 日 上午 8:06 
I was adding a feature to Terraforming Mars, which uses this counter. I needed to add some stuff. Maybe consider adding these to the default script!

Read and set value externally
I can now check and modify the counter value externally. This let me add a feature to Terraforming Mars in which you frequently transfer one counter (Energy) to another (Heat).

This just required I add 2 functions:

function getCount()
return count
end

function setCount(t)
count = t[1]
updateDisplay()
end

Usage from elsewhere:
local counterValue = counterToken.call("getCount")
counterToken.call("setCount", {whatever})
Mag Roader 2017 年 6 月 2 日 上午 8:06 
I was adding a feature to Terraforming Mars, which uses this counter. I needed to add some stuff. Maybe consider adding these to the default script!

Add buttons externally
I can now add buttons externally from Global. There was a bug where the code was assuming the display index was 1 all the time, which if you add buttons from Global it won't be. To do this, I removed the index from b_display in generateButtonParamiters and changed the button creation calls to this:

self.createButton(b_display)
self.createButton(b_plus)
self.createButton(b_minus)
self.createButton(b_plus5)
self.createButton(b_minus5)

-- Find the index if b_display because we will need to update it later
local allButtons = self.getButtons()
for i,bt in ipairs(allButtons) do
if bt.click_function == b_display.click_function then
b_display.index = bt.index
end
end
Dot0Dot 2017 年 2 月 25 日 下午 2:00 
Hi. Made use of your code in - SPI's Barbarian Kings (scripted) - very helpful. Thanks
MrStump  [作者] 2016 年 9 月 23 日 上午 6:20 
The solution to this one was to make a tiny image with a lot of transparent background.
Olsen 2016 年 9 月 22 日 下午 9:14 
any chane a counter could be loaded on blank tile i tried an empty png and smaller 100x100 images no such luck
Heyzel 2016 年 6 月 24 日 上午 8:33 
i love u 4 this awesome dude!!!!!!!!!!!!!!
Vic 2016 年 6 月 23 日 下午 12:25 
This is amazing!
_n 2016 年 6 月 22 日 上午 4:17 
This is really useful! Thanks a million
WEAPON 2016 年 6 月 20 日 下午 1:47 
@MrStump -- Bingo! Thank you. I must have disabled scripting at some point...
Paffers 2016 年 6 月 17 日 上午 10:51 
I also did not see buttons until I turned on scripting :) I actually looked at your code as I have never looked at TTS scripting, and following what you had done managed to add a 'clear to zero' button in about 10 minutes . So thanks for again for these.
MrStump  [作者] 2016 年 6 月 17 日 上午 10:42 
@WeApOn I've checked. The scripting is fine, and loads for people. Maybe you have scripting disabled? Go to Host > Options > Scripting and make sure the box is checked.

Also, the buttons appear once the loading is complete. Did the loading finish? Did you get any errors popping up or in chat?
WEAPON 2016 年 6 月 17 日 上午 10:18 
I am not seeing the counters on these tokens? I load the workshop to see the following... http://i.imgur.com/N7Qmofi.jpg

How do I get the counters to appear?
Paffers 2016 年 6 月 17 日 上午 2:14 
Nice
darleth 2016 年 6 月 16 日 下午 11:54 
Great work...