Sunday, September 28, 2014

Counting Train Rides


I've been meaning for a while to make a sign that tells how many times the little steam train at Whimsy has been ridden. Tonight I did it. It took about an hour.

Using Google images, I found an icon of a steam locomotive and, with the free program GIMP created a sign that read "...Train Rides Since April, 2006." Whimsy was born in April, 2006.

I used the free XY Text scripts as the counter. One script transformed a cube into an almost-flat prim that can display six numbers, then deleted itself. A second script sends text to a third script, which changes the visible message--in this case a number between 0 and 999,999 that displays against the image of the locomotive, like so:


I'd used the scripts before in my altimeter, so it was easy to modify them for use as a counter.

Because Kitto Flora's train is now phantom, I was unable to use a collision event, so I recycled the same scanner I used earlier to trigger messages for train riders. A script checks every three seconds to see if  one of Kitto's engines is close by; if it detects an engine, it tells the sign to add one to the number of rides. I set the appropriate XY Text script to listen for and respond to the message, and all was well. Every time the train passes, the number increases by one.


I've been saving messages from the train and did a tabulation, extrapolating back to 2006. I set the script to start with 23,400 rides. That's almost certainly an underestimate, but I'm certain it's reasonably close to the actual number of trips. For most trips, more than one avatar is riding (sometimes as many as five!), so the number of people served is more like 40,000 - 50,000. I might in the near future revise the script to count avatars rather than respond to the engine, but for now I'm satisfied. 23,446 rides it is!

No comments: