View Full Version : Mafia Phase Timer
I have added a new feature to the forums to make it easier for players to know when mafia game phases are over. It is a bbcode timer which counts down to any date and time specified. The bbcode format is and you can enter it manually, or click the timer icon on the advanced editor (https://forums.totalwar.org/vb/images/editor/clock.gif).
The bbcode must be formatted in the following manner:
[TIMER=M/D/YYYY H:MM AM/PM ZONE; TIMEUP PHRASE][/ TIMER]
Where
M = The Month number, with or without a 0. So, for August, either 8 or 08.
D = The Day number, with or without a 0. So, for the fifth day, either 5 or 05.
YYYY = The Year in full four digit number format
H: The Hour, with or without a 0. So, for the seventh hour, either 7 or 07.
MM = The Minute, so quarter past the hour would be 15, half past would be 30, and on the hour would be 00.
AM/PM = AM or PM
ZONE = Time Zone of the deadline. It is very important that you put this in. If you do not, the timer will display the local time for each person viewing it, which means people in different parts of the world will see different (and incorrect) times. The time zone codes accept all of the usual zone abbreviations, such as UTC, GMT, EST, EDT, PST, PDT, etc. You can also use UTC referential times, such as UTC-1, UTC-2, UTC+7, etc.
TIMEUP PHRASE = Whatever text you want it to display when the timer is finished, such as "Day Phase Over" or "Night Phase Over".
So, to create a timer counting down to a Night Phase which ends on August 24, 2015 at 5pm, GMT, I would create the following bbcode:
[TIMER=8/24/2015 5:00 PM GMT; Night Phase Over][/ TIMER]
and it looks like this once I removed that extra space from the bbcode:
[TIMER=8/24/2015 5:00 PM GMT; Night Phase Over]
johnhughthom
08-04-2011, 21:00
That is awesome TC, great work. :bow:
TheLastDays
08-04-2011, 21:02
That's cool. Going to try that right away with the next phase. Great work!
GeneralHankerchief
08-04-2011, 21:42
I love having Tech Admins interested in the Gameroom. :smoking:
Tratorix
08-04-2011, 21:51
Wow this rules. Now if you can make one that automatically keeps a vote tally we'll be set. :laugh4:
Now if you can make one that automatically keeps a vote tally we'll be set. :laugh4:
I've actually thought about that, but it would be impossible to have it take into account things like misspellings, name abbreviations (i.e. ATPG), nicknames (i.e. Strawberry), etc. The only way it could work is if everyone used the exact same format to vote and if they all spelled out every name precisely and in full. That seems like trying to enforce that would cause more problems than it would solve.
Tratorix
08-04-2011, 22:23
I've actually thought about that, but it would be impossible to have it take into account things like misspellings, name abbreviations (i.e. ATPG), nicknames (i.e. Strawberry), etc. The only way it could work is if everyone used the exact same format to vote and if they all spelled out every name precisely and in full. That seems like trying to enforce that would cause more problems than it would solve.
Oh, screw that noise then. Warman would survive every game since no one would want to take the 5 minutes necessary to spell his name.
Diamondeye
08-04-2011, 22:37
Awesome TinCow!
About Vote tags...
Would it be possible if you used ? How would it recognize phase shifts (if you make a tag for that, people who aren't the host could post the tag to mechanically end the round, although it would of course be unsportsmanslike and disruptive). That way you could also implement and . It would be great!
Also, remember to buy me birthday presents!
Diamondeye
08-04-2011, 22:40
... Your timer seems to be actively ticking, while mine does not..?
TheLastDays
08-04-2011, 23:12
Awesome TinCow!
About Vote tags...
Would it be possible if you used ? How would it recognize phase shifts (if you make a tag for that, people who aren't the host could post the tag to mechanically end the round, although it would of course be unsportsmanslike and disruptive). That way you could also implement and . It would be great!
Also, remember to buy me birthday presents!
Fiyed that for ya :wink:
Seems like the Time Up Message cannot contain punctuation
EDIT: Also, cann I use bbcode like [b] in my time up message?
Fiyed that for ya :wink:
Seems like the Time Up Message cannot contain punctuation
EDIT: Also, cann I use bbcode like [b] in my time up message?
Unfortunately, no you can't, at least not as it's currently written. Any bbcode inside the message will break it. The timer interface is bbcode, but the animated timer itself runs on javascript. I don't know javascript well enough to be able to figure out how to insulate the time up message from the rest of the code. If anyone knows javascript and wants to tweak it to make it better, I'll happily post the code.
TheLastDays
08-04-2011, 23:49
Then how about adding a bolding in the HTML? I think most of the timeup messages should be bolded anyway.
Then how about adding a bolding in the HTML? I think most of the timeup messages should be bolded anyway.
As per my edit above, it's not HTML, it's javascript. I know enough HTML to tweak that, but I haven't done any javascript coding in about 13 years.
GeneralHankerchief
08-05-2011, 00:10
Also, remember to buy me birthday presents!
I am going to eternally go by this timer when determining your birthday.
I am going to eternally go by this timer when determining your birthday.
That timer actually works, it's just that his formatting broke the animation. If you refresh, you'll see it's actually still counting.
Ok, I've figured out how to modify the text as a whole. I've bolded the entire counter to make it easier to view. This makes it a bit more visible and will also bold whatever 'time up' text you put in.
TheLastDays
08-05-2011, 00:32
Ok, I've figured out how to modify the text as a whole. I've bolded the entire counter to make it easier to view. This makes it a bit more visible and will also bold whatever 'time up' text you put in.
:thumbsup:
seireikhaan
08-05-2011, 00:42
Oh yes. Excellent piece of tech. :2thumbsup: Muchos gracias, TinCow.
Made it red and made it use proper singular versions of the words when the count is 1. We must always be grammatically correct. :stare:
[edit]I've also made it completely drop the "Days" entry when Days hits 0, as most mafia timers are 24 hours, so we'd be staring at a lot of "0 Days" entries. I will not have it drop Hours and Minutes in the same way, as I think 0 Hours and 0 Minutes helps emphasize that the time limit is close in a manner that 0 Days does not.
Askthepizzaguy
08-05-2011, 03:40
I do believe TinCow is presently the MVP of the entire .org.
There aren't enough awards, dude.
Maybe now you'll make darn sure my idea of more awards happens. :laugh4:
classical_hero
08-05-2011, 05:55
I am going to presume that EST and EDT will only work on American timezones and not Australian one, or would AEST and AWST work or not? Anyway I would use GMT setting since I know that will work.
TheLastDays
08-05-2011, 08:21
The referencial time setting works well, at least with GMT, so going GMT+8 for you should do the trick.
I am going to presume that EST and EDT will only work on American timezones and not Australian one, or would AEST and AWST work or not? Anyway I would use GMT setting since I know that will work.
Hmmm... yeah, EST/EDT key to those US zones, and AEST/AEDT aren't recognized by the code. You'll have to use UTC/GMT referential codes. Both UTC and GMT work in the code, so pick whichever you prefer and than add +X, where X is the appropriate hour adjustment listed here:
http://www.timeanddate.com/library/abbreviations/timezones/au/
So, for Aussie EST, it might look like this:
[/ TIMER]
[TIMER=8/7/2011 12:00 AM GMT+10; Down Under]
Would CDT work, or would GMT-5 have to be used instead?
(first is using "CDT", second is using "GMT-5")
That's because were currently in daylight savings time. Use CDT.
TheLastDays
08-05-2011, 17:15
What is CST? GMT-5 would be EST, wouldn't it?
That's because were currently in daylight savings time. Use CDT.
Oh, duh.
CST is GMT-6, CDT is GMT-5
EST is GMT-5, EDT is GMT-4
Diamondeye
08-06-2011, 10:51
We must always be grammatically correct. :stare:
I concur! Civilization is not my only fanaticism :tongue:.
classical_hero
08-06-2011, 15:14
I am going to eternally go by this timer when determining your birthday.Then he is forever young.
Gameroom mods, feel free to unstick/move/merge this thread whenever you like. I just stuck it as a temporary measure so that it would be visible for a few days. The sticky has probably served its purpose now, so do with it what you will.
Askthepizzaguy
08-12-2011, 03:17
Gameroom mods, feel free to unstick/move/merge this thread whenever you like. I just stuck it as a temporary measure so that it would be visible for a few days. The sticky has probably served its purpose now, so do with it what you will.
I will personally need a reminder on how to use the timer tags when the time comes.
It's a whole new thing and not everyone is familiar with it yet, and I feel that keeping this thread as visible as possible will help; it's barely been a week.
I will personally need a reminder on how to use the timer tags when the time comes.
It's a whole new thing and not everyone is familiar with it yet, and I feel that keeping this thread as visible as possible will help; it's barely been a week.
Leave it up as long as you wish, I just wanted to make sure it wasn't being left here because I stuck it myself. I suspect at some point it might work to simply put the OP into the Rules and Reference thread.
I suspect at some point it might work to simply put the OP into the Rules and Reference thread.
I was about to suggest this.
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.