{"id":900,"date":"2010-05-14T06:50:00","date_gmt":"2010-05-14T05:50:00","guid":{"rendered":"\/blog\/?p=900"},"modified":"2010-05-14T06:50:00","modified_gmt":"2010-05-14T05:50:00","slug":"animated-digital-station-clocks-and-3d-cab-for-1992-stock-released","status":"publish","type":"post","link":"https:\/\/railsimroutes.net\/blog\/openbve\/animated-digital-station-clocks-and-3d-cab-for-1992-stock-released\/","title":{"rendered":"Animated digital station clocks for openBVE, and 3D cab for 1992 stock released at BVE Routes &#038; Trains"},"content":{"rendered":"<p><span style=\"text-decoration: underline;\"><strong>Animated digital station clocks<\/strong><\/span><\/p>\n<p><img decoding=\"async\" style=\"padding-right: 4px; vertical-align: middle; float: left; margin-top: 0px; margin-bottom: 0px;\" src=\"\/interface\/themes\/clarity\/icons\/rsr_icon_30.png\" alt=\"Railsimroutes Logo\" \/><a class=\"imglink\" href=\"\/images\/openbve_demoroute1_1.jpg\"><img decoding=\"async\" style=\"float: right; padding-left: 10px; padding-right: 0px\" title=\"openBVE\/DemoRoute1 screenshot - click to enlarge\" src=\"\/images\/thumbnails\/openbve_demoroute1_1.jpg\" alt=\"openBVE\/DemoRoute1 screenshot - click to enlarge\" \/><\/a>I&#8217;m not sure if any other openBVE developers have attempted this yet, but a feature I&#8217;ve been wanting to add to my routes for some time now, is animated digital station clocks which show the actual in-game time. Of course, we&#8217;ve seen a very nice working analogue station clock featured in <span style=\"white-space: nowrap\"><a href=\"http:\/\/openbve.trainsimcentral.co.uk\/develop\/index.html\">\u00bb DemoRoute1 \u00ab<\/a><\/span> (see right), but a digital clock would be useful, too.<\/p>\n<p>I studied the functions in DemoRoute1&#8217;s analogue clock .animated file, along with openBVE 1&#8217;s source code to see how the display of in-game time is handled, and eventually opted to use multiplication rather than division in my functions as per the animated object in DemoRoute1. You can find some details of the finished set of files below.<\/p>\n<table style=\"width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td align=\"center\"><a class=\"imglink\" href=\"\/downloads\/digital_clock.7z\"><br \/>\n<img decoding=\"async\" style=\"padding: 0px;\" title=\"Animated digital clock shown in the openBVE Object Viewer utility -- click to download sample files\" src=\"\/images\/thumbnails\/anim_clock_1.gif\" alt=\"Animated digital clock shown in the openBVE Object Viewer utility -- click to download sample files\" \/><\/a><br \/>\nAnimated 24-hour digital clock shown in the openBVE Object Viewer utility.<br \/>\nSample files can be <a href=\"\/downloads\/digital_clock.7z\">downloaded here<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Please feel free to download and use the above files if you&#8217;d like to adapt them for your own route, all you need to do is create an enclosure for the digits, and translate or resize the digits, to suit your own needs. The digital clock consists of an object which shows a single digit from a texture containing a strip of digits from 0-9, a separator, and a black background. The .animated file is as follows:<\/p>\n<div class=\"codebox\" style=\"width: 625px\">\n<strong><span style=\"text-decoration: underline\">digital_clock.animated:<\/span><\/strong><\/p>\n<p>[Object]<br \/>\nStates = back.csv<br \/>\nPosition = 0, 0, 0<\/p>\n<p>; Hours<\/p>\n<p>[Object]<br \/>\nStates = digit.csv<br \/>\nPosition = -0.51, 0, 0<br \/>\nTextureShiftYFunction = 0.1 * floor[mod[time * 0.000277777777777778, 24] * 0.1]<\/p>\n<p>[Object]<br \/>\nStates = digit.csv<br \/>\nPosition = -0.33, 0, 0<br \/>\nTextureShiftYFunction = 0.1 * floor[mod[time * 0.000277777777777778, 24]]<\/p>\n<p>[Object]<br \/>\nStates = digit_separator.csv<br \/>\nPosition = -0.21, 0, 0<\/p>\n<p>; Minutes<\/p>\n<p>[Object]<br \/>\nStates = digit.csv<br \/>\nPosition = -0.09, 0, 0<br \/>\nTextureShiftYFunction = 0.1 * floor[mod[time * 0.0166666666666667, 60] * 0.1]<\/p>\n<p>[Object]<br \/>\nStates = digit.csv<br \/>\nPosition = 0.09, 0, 0<br \/>\nTextureShiftYFunction = 0.1 * floor[time * 0.0166666666666667]<\/p>\n<p>[Object]<br \/>\nStates = digit_separator.csv<br \/>\nPosition = 0.21, 0, 0<br \/>\nStateFunction = value == 0<br \/>\nRefreshRate = 0.5<\/p>\n<p>; Seconds<\/p>\n<p>[Object]<br \/>\nStates = digit.csv<br \/>\nPosition = 0.33, 0, 0<br \/>\nTextureShiftYFunction = 0.1 * floor[mod[time, 60] * 0.1]<\/p>\n<p>[Object]<br \/>\nStates = digit.csv<br \/>\nPosition = 0.51, 0, 0<br \/>\nTextureShiftYFunction = 0.1 * floor[time]\n<\/p><\/div>\n<p><strong>Note:<\/strong> The purpose of the <tt>mod[]<\/tt> function used in displaying the hour digits, is to ensure that the displayed time wraps around back to 00 when passing midnight, rather than 24 or higher being displayed.<\/p>\n<p>Here&#8217;s a screenshot of the above working digital clock, adapted for use in a prototypical structure at Kings Langley on the Watford Junction to Rugby route; note the displayed time on the clock, matching the in-game time shown at the bottom left of the screen:<\/p>\n<table style=\"width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td align=\"center\"><a class=\"imglink\" href=\"\/images\/hi-res\/wj-r_openbve_56.jpg\"><br \/>\n<img decoding=\"async\" style=\"padding: 0px;\" title=\"openBVE \/ Watford Junction to Rugby screenshot showing animated digital clock - click to enlarge\" src=\"\/images\/thumbnails\/wj-r_openbve_56.jpg\" alt=\"openBVE \/ Watford Junction to Rugby screenshot showing animated digital clock - click to enlarge\" \/><\/a><br \/>\nopenBVE \/ Watford Junction to Rugby screenshot showing animated digital clock &#8212; click to enlarge<br \/>\nNote: Station nameboard textures created using <a href=\"http:\/\/eezypeazy.co.uk\/page22.html\">\u00bb Station Nameboard Generator v2 \u00ab<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table style=\"width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td align=\"center\"><img loading=\"lazy\" decoding=\"async\" style=\"padding-top: 20px; padding-bottom: 10px;\" src=\"\/interface\/themes\/modern\/dividers\/divider.gif\" alt=\"Horizontal Rule\" width=\"150\" height=\"2\" \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"text-decoration: underline;\"><strong>3D cab for 1992 stock released<\/strong><\/span><\/p>\n<p><img decoding=\"async\" style=\"padding-right: 4px; vertical-align: middle; float: left; margin-top: 0px; margin-bottom: 0px;\" src=\"\/interface\/themes\/clarity\/icons\/information_30.png\" alt=\"Information Icon\" \/>I also just wanted to briefly mention that a new openBVE 3D cab has been released for the London Underground 1992 stock, with animated features including a traction\/brake controller, speedometer, and working in-cab CCTV monitor. Night-illuminated cab indicators and screens are also included, and the overall effect created by the cab is very nice, despite a couple of initial teething problems. The 3D cab is an add-on for the BVE4 1992TS, which needs to be installed first; both downloads can be found at <span style=\"white-space: nowrap\"><a href=\"http:\/\/www.bveroutes-trains.co.uk\/trains\/underground.html\">\u00bb http:\/\/bveroutes-trains.co.uk \u00ab<\/a><\/span>. A note on installing the 3D cab &#8212; at the time of writing, I noticed that the 3D cab download contains an incorrect folder structure, i.e. there&#8217;s no &#8220;1992TS&#8221; subfolder included, and the files could easily end up accidentally being placed in your Train folder directly instead, which won&#8217;t work, of course. You will need to be careful as to where you choose to extract the files. For further information, you might like to monitor <span style=\"white-space: nowrap\"><a href=\"http:\/\/www.bve-exchange.co.uk\/forum\/viewtopic.php?f=1&#038;t=6297\">\u00bb this thread \u00ab<\/a><\/span> on the BVE Exchange forum.<\/p>\n<table style=\"width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td align=\"center\"><a class=\"imglink\" href=\"\/images\/hi-res\/1992stock_openbve_1.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"padding: 0px;\" title=\"openBVE \/ 1992 Stock thumbnail image [Click to enlarge]\" src=\"\/images\/thumbnails\/1992stock_openbve_1.jpg\" alt=\"Screenshot\" width=\"200\" height=\"125\" \/><\/a><br \/>\nopenBVE \/ 1992 Stock screenshot<br \/>\n<span style=\"padding-bottom: 20px\"><a href=\"http:\/\/www.bveroutes-trains.co.uk\/trains\/underground.html\">\u00bb Download from http:\/\/bveroutes-trains.co.uk \u00ab<\/a><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Animated digital station clocks I&#8217;m not sure if any other openBVE developers have attempted this yet, but a feature I&#8217;ve been wanting to add to my routes for some time now, is animated digital station clocks which show the actual in-game time. Of course, we&#8217;ve seen a very nice working analogue station clock featured in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[6,9,11,13,15,21],"class_list":["post-900","post","type-post","status-publish","format-standard","hentry","category-openbve","tag-animated-objects","tag-functions","tag-openbve","tag-openbve-community","tag-screenshots","tag-watford-jn-to-rugby"],"_links":{"self":[{"href":"https:\/\/railsimroutes.net\/blog\/wp-json\/wp\/v2\/posts\/900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/railsimroutes.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/railsimroutes.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/railsimroutes.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/railsimroutes.net\/blog\/wp-json\/wp\/v2\/comments?post=900"}],"version-history":[{"count":0,"href":"https:\/\/railsimroutes.net\/blog\/wp-json\/wp\/v2\/posts\/900\/revisions"}],"wp:attachment":[{"href":"https:\/\/railsimroutes.net\/blog\/wp-json\/wp\/v2\/media?parent=900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/railsimroutes.net\/blog\/wp-json\/wp\/v2\/categories?post=900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/railsimroutes.net\/blog\/wp-json\/wp\/v2\/tags?post=900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}