Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
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.
Would it be alright if I use these in it, giving credit and linking here of course?
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?
giving all the credits to you of course
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.
It lets you put multiple counters on an object with some setup. Might be able to poke it into doing what you want.
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.
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})
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
Also, the buttons appear once the loading is complete. Did the loading finish? Did you get any errors popping up or in chat?
How do I get the counters to appear?