Hey Everyone. I am needing 2 questions answered regarding counters
First off i will say I want one counter to display a random number between 0 and 999999 which is easy enough.
But when the number is displayed if it is below 100000 it displays the numbers like this, eg: 2340 11223 etc.
Is there any way i can get the counter to still display the whole 6 digits but have a zero at the front if required using the examples again 002340 and 011223.
Secondly I want 5 other counters to display info feeding off the 6 digit counter.
For example If the 6 digit counter randomly reads 658092 How would I go about getting the first of the 5 counters (A) to disply the first 2 digits of the counter in this case - (65), then the second counter (B) to diplay (5, (C) = (80), (D) = 09) and finally (E) = 92.
Hope ppl understand
Any help here would be GRREATTLY APPRECIATED - Thanx - Greg
Either that or uncheck "Display as background" for the counter and put in a couple of background objects that look like the counter's zeroes in front of it (this only works on things like LED-like displays where the entire background of the counter is opaque and the digits are of a fixed width).
The String method (or Text Object if you're using TGF) is a much easier way to go, and also allows you to use Mid$() to get the individual values out.
The way I do it is to create an active object that displays the digits 0-9 in animation directions 0-9. Then I have a 'real value' counter, and have an Always event that sets each clone of the active to a direction equal to the value of the digit in that place in the number (using the mod function). Works great.
n/a
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
12th May, 2006 at 17:09:28 -
I was gonna say divide by 1000000.0 but the other 0's go away.
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath